Better estimating of proposer gas price and gas limit #671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #666
The proposer uses the nf3 class to submit transactions. The way that this set the gasPrice and gasLimit was quite crude and results in the proposer paying over the odds for gas and using such a high gas limit that there is not enough in the proposer's account to submit the transaction. This PR fixes that and gives much better values for both. The strategy used is essentially the same as for the wallet.
For gasPrice:
In each case, the resulting figure is multiplied by a fixed multiplier (
GAS_PRICE_MULTIPLIER
) to give high confidence of a successful transaction.For gasLimit:
In each case, the resulting figure is multiplied by a fixed multiplier (
GAS_MULTIPLIER
) to give high confidence of a successful transaction.To test. Use the standard
npm t
test but temporarily edit thetest
script inpackage.json
so thatLOG_LEVEL=debug
. You can then see the gas price and gas limit chosen, as the test proceeds.