-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
base: develop
Are you sure you want to change the base?
Add config to toggle the TXM #15714
Conversation
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
3b65ac2
to
e29572f
Compare
@@ -49,6 +49,7 @@ type EVM interface { | |||
NodeNoNewHeadsThreshold() time.Duration | |||
FinalizedBlockOffset() uint32 | |||
NoNewFinalizedHeadsThreshold() time.Duration | |||
TXMEnabled() bool |
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 already have EVM.Transactions
. Would EVM.Transactions.XYZ
make sense? Rather than EVM.TXMEnabled
?
EVM.Transactions.Enabled
EVM.Transactions.ManagerEnabled
- ??
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 considered adding it there but since this also affects the gas estimator I thought it was better to keep the config at the EVM level like LogBroadcasterEnabled
. I'm not steadfast on that though so not against moving this under EVM.Transactions
. That does remind me that I should update the config description to mention the gas estimator though.
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.
Why does the gas estimator change things? Does that suggest that we might have wanted it nested as Transactions.GasEstimator
?
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 think it still makes sense to have gas estimator configs outside of EVM.Transactions
since that component could still be referenced separately. But in the case for chain initialization, the gas estimator depends on the TXM to start its lifecycle which is why they go hand in hand.
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.
OK, but I am still not seeing how this new field is relevant to the gas estimator. The TXMEnabled()
method is only called from one place currently.
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.
The only relevance is that the new field is also responsible for enabling/disabling gas estimators along with the TXM. Maybe the config name is misleading since it only refers to the TXM.
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 think it should at least be expanded for clarity, but if there is a more general name that would be good.
TXMEnabled() bool | |
TransactionManagerEnabled() bool |
return nil, fmt.Errorf("failed to instantiate EvmTxm for chain with ID %s: %w", chainID.String(), err) | ||
var txm txmgr.TxManager | ||
var gasEstimator gas.EvmFeeEstimator | ||
//nolint:gocritic // ignoring styling issue |
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.
What rule is being suppressed here?
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.
It wanted me to covert this if-else to a switch statement which I thought wouldn't be as clear to read
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.
Can you reference that in the description?
core/chains/legacyevm/chain.go
Outdated
var err error | ||
txm, gasEstimator, err = newEvmTxm(opts.DS, cfg.EVM(), opts.AppConfig.Database(), opts.AppConfig.Database().Listener(), client, l, logPoller, opts, headTracker, clientsByChainID) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to instantiate EvmTxm for chain with ID %s: %w", chainID.String(), err) |
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.
return nil, fmt.Errorf("failed to instantiate EvmTxm for chain with ID %s: %w", chainID.String(), err) | |
return nil, fmt.Errorf("failed to instantiate EvmTxm for chain with ID %s: %w", chainID, err) |
MERC-6516
Added the
TXMEnabled
config to enable or disable the TXM. This toggle was added so a product that only needs read-only access (i.e client, head tracker, log poller) can disable the unused component.