-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
core/vm: evm fixes + add london to allprotocolchanges #22901
Conversation
@@ -43,6 +43,7 @@ type Config struct { | |||
Value *big.Int | |||
Debug bool | |||
EVMConfig vm.Config | |||
Basefee *big.Int |
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.
Basefee *big.Int | |
BaseFee *big.Int |
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 don't understand where is this being used?
if cfg.Basefee == nil { | ||
cfg.Basefee = new(big.Int) |
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.
if cfg.Basefee == nil { | |
cfg.Basefee = new(big.Int) | |
if cfg.BaseFee == nil { | |
cfg.BaseFee = new(big.Int) |
@@ -35,6 +35,7 @@ func NewEnv(cfg *Config) *vm.EVM { | |||
Time: cfg.Time, | |||
Difficulty: cfg.Difficulty, | |||
GasLimit: cfg.GasLimit, | |||
BaseFee: cfg.Basefee, |
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.
BaseFee: cfg.Basefee, | |
BaseFee: cfg.BaseFee, |
@@ -426,9 +426,9 @@ 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. | |||
// chain doesn't have miners, we just return a gas price of 875000000 (initial basefee) for any call. |
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.
initial basefee is 1000000000
// We want to simulate an empty middle block, having the same state as the | ||
// first one. The last is needs a state change again to force a reorg. | ||
if i != 1 { | ||
tx, err := types.SignTx(types.NewTransaction(block.TxNonce(addr), common.Address{0x00}, new(big.Int), params.TxGas, nil, nil), signer, key) | ||
tx, err := types.SignTx(types.NewTransaction(block.TxNonce(addr), common.Address{0x00}, new(big.Int), params.TxGas, big.NewInt(875000000), nil), signer, key) |
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.
Not sure where 875 came from, use initial basefee instead
@@ -20,7 +20,9 @@ import ( | |||
"bytes" | |||
"context" | |||
"errors" | |||
"github.com/ethereum/go-ethereum/log" |
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.
gofmt please
if g.Config == nil { | ||
g.Config = params.AllEthashProtocolChanges | ||
} | ||
config := g.Config | ||
block := g.ToBlock(db) |
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 to move these codes up?
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.
Yes, for setting the basefee. nvm
Closing, fixed by 7a7abe3 instead |
This PR fixes some minor evm nits, like making it possible to execute
/evm --json --code 0x48 run
and see theBASEFEE
opcode in all it's glory