feat(tx-builder): get actual gas price from node #1884
Merged
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.
closes #1786
This PR is supported by the Æternity Foundation
To protect from funds loss in case of a bug/misusage, I propose to add an upper limit for the gas price substituted by default. Known issues:
A single active client would compete with himself
If somebody posts transactions from a single client with high blockchain utilization, the gas price will increase for no reason. This is a special use case, I'm adding a note to
batch-requests.md
.Overall solution doesn't protect from mining time fluctuation
With a low utilization, it is expected to get a transaction mined within 3 seconds. Currently, it is cheap to increase utilization at any moment. The current solution would reflect utilization change in a minute. So, a user may experience arbitrary changes of mining time.
I've wrote a script to create several clients pushing transactions one by one and to visualize that gathered data. On the screenshot, I've added about 5 dynamic price clients and removed all of them with an interval from the middle to the end. It looks +/- as expected.