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.
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
Add config to toggle the TXM #15714
Add config to toggle the TXM #15714
Changes from 7 commits
1a6a2ac
28f95e7
e29572f
6eadab5
e6c2fa3
76364ea
4f5e7d4
f373dff
7f58819
604da4c
ee2bae1
8a7be45
1d8500a
2e0a39a
e74a2e2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should we consider creating a gas estimator even if TXM is disabled? Are there any paths in the code that might call it apart from the TXM. If they do, we might panic.
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.
I could for sanity. Otherwise, the existing code also returned nil for the gas estimator if
EVMRPCEnabled=false
.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.
Updated the code to initialize the gas estimator regardless of the TXM toggle. I looked around and don't think there was any reference to gas estimator that would cause a panic but made the change anyways in case I missed something or if that changes in the future.
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.
There is an issue with the BlockHistory estimator though. Currently, TXM subscribes to HT and implements OnNewLongestChain, providing BHE with a new head. If TXM is nil, BHE won't be getting updates at all.
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.
That would only be an issue if the gas estimator gets started though right? I only separated out the initialization of the gas estimator from the TXM but it still relies on the TXM to start/stop it.
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.
I assumed that since it gets initialized we would also want to start it, but I guess we don't. My only issue was that because it's initialized someone might try to fetch prices causing issues, but I noticed BHE has an
IfStarted
method for bothGetLegacyGas
andGetDynamicFee
so we're ok.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.
We could separate out the gas estimator lifecycle from the TXM and truly make it a standalone service but that's probably a separate ticket. For now, I'll still keep the initialization separate just to make sure we don't hit a panic anywhere in case this is called outside of the TXM.