Skip to content

Conversation

@Sparty
Copy link
Contributor

@Sparty Sparty commented Oct 31, 2021

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.

@MariusVanDerWijden MariusVanDerWijden changed the title Change sim backend suggestGasPrice's to return basefee #23752 accounts/abi/bin/backends: return basefee in suggestGasPrice's Nov 1, 2021
@holiman holiman added this to the 1.10.12 milestone Nov 1, 2021
@holiman holiman merged commit 57c252e into ethereum:master Nov 1, 2021
// 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
Copy link
Member

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.

sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Nov 1, 2021
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 1, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants