mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
move it to immediately after StateAndHeaderByNumberOrHash
This commit is contained in:
parent
120d3d6ad3
commit
62a07266b3
1 changed files with 9 additions and 7 deletions
|
|
@ -1144,6 +1144,15 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
|
|||
return nil, 0, nil, err
|
||||
}
|
||||
|
||||
// Apply state overrides immediately after StateAndHeaderByNumberOrHash.
|
||||
// If not applied here, there could be cases where user-specified overrides (e.g., nonce)
|
||||
// may conflict with default values from the database, leading to inconsistencies.
|
||||
if stateOverrides != nil {
|
||||
if err := stateOverrides.Apply(db, nil); err != nil {
|
||||
return nil, 0, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure any missing fields are filled, extract the recipient and input data
|
||||
if err = args.setFeeDefaults(ctx, b, header); err != nil {
|
||||
return nil, 0, nil, err
|
||||
|
|
@ -1157,13 +1166,6 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
|
|||
return nil, 0, nil, err
|
||||
}
|
||||
|
||||
// Apply state overrides if provided
|
||||
if stateOverrides != nil {
|
||||
if err := stateOverrides.Apply(db, nil); err != nil {
|
||||
return nil, 0, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
var to common.Address
|
||||
if args.To != nil {
|
||||
to = *args.To
|
||||
|
|
|
|||
Loading…
Reference in a new issue