-
Notifications
You must be signed in to change notification settings - Fork 487
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
Fix estimate gas for old runtimes #1409
Fix estimate gas for old runtimes #1409
Conversation
4925281
to
53eba3e
Compare
I rethink this issue again and this is not a totally correct patch. It will break the current runtime functionality. See the comment I wrote in the previous PR. Changing Because of this, I submited #1412 to revert your previous PR. The current final gas is the |
It's better to overestimate a bit the proof size on Also, can you point to the piece of code that compute the proof size badly in that case? Because it's not part of frontier What you should have done in your original PR is to create a new version of the runtime API so that the client can adapt to each runtime. You can do that on a new PR, but for runtimes published in the meantime, I don't see an ideal solution. Do you have an idea? |
Pass Some(0) and None, the calculated proof_size_base_cost is slightly different.
Yes, that's the way to do it. I didn't realise it would break this at that time. No ideas either. |
I agree with that. Would you mind picking the Moonbeam runtime call |
Done |
value, | ||
Some(<Runtime as pallet_evm::Config>::ChainId::get()), | ||
access_list.clone().unwrap_or_default(), | ||
); |
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.
Sorry for the delay in replying(just come back from holiday). I come up with another idea is that we can pass default value to the TransactionData::new(xxx)
for these field with Option<T>
type, such as max_fee_per_gas
and max_priority_fee_per_gas
, instead of None
. This way can also meet our needs and looks cleaner. What do you think? @librelois
This PR #1257 introduced a regression that make the client not compatible with old runtimes.
Old runtimes doesn't check properly non transactional evm calls, old runtimes rely on the fact that
max_fee_per_gas
is None to consider the evm call non transactional.It introduced a bug in Moonbeam where
eth_call
andestimate_gas
against past blocks produce the BalanceLow error.Because we can't change old runtimes, the client should not set max_fee_per_gas as Some(zero), otherwize old runtimes will assume that the evm call is transactional.
I submitted a PR upstream (#1404) to fix it for
eth_call
, but we have the same bug withestimate_gas
, this PR move the fix into thefee_details
function itself.