-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic transaction repricing / replacement #847
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iamdefinitelyahuman
force-pushed
the
feat-replace-tx-auto
branch
4 times, most recently
from
November 18, 2020 14:27
848a93a
to
f2efb90
Compare
Still need to add another strategy or two here, but this is close! |
fubuloubu
reviewed
Nov 19, 2020
Another potentially useful default strategy for Geth with graphql enabled: def gas_price(position=500):
query = "{ pending { transactions { gasPrice }}}"
resp = requests.post(f"{ETH_RPC_URL}/graphql", json={"query": query})
data = resp.json()["data"]["pending"]["transactions"]
prices = [int(x["gasPrice"], 16) for x in data]
return Wei(sorted(prices, reverse=True)[:position][-1]) |
iamdefinitelyahuman
force-pushed
the
feat-replace-tx-auto
branch
6 times, most recently
from
November 20, 2020 18:38
4a15f97
to
8c22a84
Compare
banteg
previously approved these changes
Nov 20, 2020
iamdefinitelyahuman
force-pushed
the
feat-replace-tx-auto
branch
2 times, most recently
from
November 21, 2020 20:46
d3972c5
to
54e71ea
Compare
This should be gtg now |
banteg
previously approved these changes
Nov 22, 2020
iamdefinitelyahuman
force-pushed
the
feat-replace-tx-auto
branch
from
November 22, 2020 22:23
54e71ea
to
888fb2d
Compare
fubuloubu
previously approved these changes
Nov 23, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it a shot, looks pretty good to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What I did
Automatic repricing of transactions.
Closes #727
How I did it
When setting
gas_price
, you may now use an object that subclasses fromGasABC
:SimpleGasStrategy
for simple strategies that are called onceBlockGasStrategy
which is called everyn
blocksTimeGasStrategy
which is called everyn
secondsFor strategies that trigger tx replacement, returning a non-
None
value broadcasts a new transaction.Thus far I have created two actual strategies, based around the gasnow API.
How to verify it
Try it out!
TODO