Skip to content

Commit

Permalink
stateOverride: don't allow arbOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed May 10, 2024
1 parent 515e912 commit 37b6489
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,17 @@ type OverrideAccount struct {
// StateOverride is the collection of overridden accounts.
type StateOverride map[common.Address]OverrideAccount

var arbStorageAddress = common.HexToAddress("0xA4B05FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")

// Apply overrides the fields of specified accounts into the given state.
func (diff *StateOverride) Apply(state *state.StateDB) error {
if diff == nil {
return nil
}
for addr, account := range *diff {
if addr == arbStorageAddress {
return errors.New("overriding 0xA4B05FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF not allowed")
}
// Override account nonce.
if account.Nonce != nil {
state.SetNonce(addr, uint64(*account.Nonce))
Expand Down

0 comments on commit 37b6489

Please sign in to comment.