-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
accounts/abi/bin/backends: return basefee in suggestGasPrice's #23838
Conversation
@@ -462,7 +462,7 @@ func (b *SimulatedBackend) PendingNonceAt(ctx context.Context, account common.Ad | |||
// SuggestGasPrice implements ContractTransactor.SuggestGasPrice. Since the simulated | |||
// chain doesn't have miners, we just return a gas price of 1 for any call. | |||
func (b *SimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) { | |||
return big.NewInt(1), nil |
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.
Header might not have a basefee (if the simulated backend was instantiated without the london block)
So the correct logic would be
if header.BaseFee != nil {
return header.Basefee
}
return big.NewInt(1)
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
…m#23838) Co-authored-by: mrx <[email protected]>
EIP-1559 changes the min amount of gas price we can execute a transaction with (current basefee).
The simulated backend always returned 1 on suggestGasPrice. With 1559 we need to return at least the basefee, otherwise transactions will never be mined.