Skip to content

Add HistoryStorageAddress as part of arbos 40 upgrade #3132

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

Merged
merged 8 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions arbos/arbosState/arbosstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/triedb"
Expand Down Expand Up @@ -339,6 +340,11 @@ func (state *ArbosState) UpgradeArbosVersion(
// these versions are left to Orbit chains for custom upgrades.

case params.ArbosVersion_40:
// EIP-2935: Add support for historical block hashes.
if firstTime {
stateDB.SetNonce(params.HistoryStorageAddress, 1, tracing.NonceChangeUnspecified)
stateDB.SetCode(params.HistoryStorageAddress, params.HistoryStorageCodeArbitrum)
}
// The MaxWasmSize was a constant before arbos version 40, and can
// be read as a parameter after arbos version 40.
params, err := state.Programs().Params()
Expand Down
13 changes: 0 additions & 13 deletions system_tests/historical_block_hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/params"

"github.com/offchainlabs/nitro/statetransfer"
)

func TestHistoricalBlockHash(t *testing.T) {
Expand All @@ -19,17 +17,6 @@ func TestHistoricalBlockHash(t *testing.T) {
defer cancel()

builder := NewNodeBuilder(ctx).DefaultConfig(t, true)
contractInfo := &statetransfer.AccountInitContractInfo{
Code: params.HistoryStorageCodeArbitrum,
ContractStorage: make(map[common.Hash]common.Hash),
}
accountInfo := statetransfer.AccountInitializationInfo{
Addr: params.HistoryStorageAddress,
EthBalance: big.NewInt(0),
Nonce: 1,
ContractInfo: contractInfo,
}
builder.L2Info.ArbInitData.Accounts = append(builder.L2Info.ArbInitData.Accounts, accountInfo)
cleanup := builder.Build(t)
defer cleanup()

Expand Down
Loading