-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RPC-based Gas Estimation for Moonbeam-based Networks #6460
RPC-based Gas Estimation for Moonbeam-based Networks #6460
Conversation
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 outlined solution makes sense, though I think you forgot to include it 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.
please restore other formatting issues like trailing ;
crates/cli/src/utils/cmd.rs
Outdated
| NamedChain::Moonbeam | ||
| NamedChain::Moonriver | ||
| NamedChain::Moonbase | ||
| NamedChain::MoonbeamDev |
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.
ah nvm, I overlooked it hehe
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.
looks good, pending mattsse's nit
Ah apologies I did not understand you wanted me to revert the I tested this implementation in a local Foundry Forge instance and it worked btw. |
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.
lgtm
Motivation
Moonbeam introduced MBIP-5 in which gas estimation deviated from Ethereum. The reasoning is that now storage changes are reflected now on gas estimation. This is to prevent spamming the network with junk data. This is a problem on a lot of cheap-to-transact networks
Solution
Solution was simple, just add Moonbeam-based networks to the
has_different_gas_calc
function (like with Arbitrum) hereIf this function returns
true
then gas estimation is done using the actual provider URL andeth_estimateGas
.