Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 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,9 @@ 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.
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
6 changes: 6 additions & 0 deletions system_tests/block_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ func TestBlockValidatorSimpleOnchain(t *testing.T) {
}

func TestBlockValidatorSimpleJITOnchainWithPublishedMachine(t *testing.T) {
t.Skip("Fails cause EIP-2935 (part of arbOs 40) is not implemented in the latest published machine i.e Consensus V32")
// TODO: Remove this skip when consensus V40 is published
// TODO: Make this more robust in the future, so that it can handle if the latest consensus release is behind the arbOS version we want to test.
cr, err := github.LatestConsensusRelease(context.Background())
Require(t, err)
machPath := populateMachineDir(t, cr)
Expand All @@ -326,6 +329,9 @@ func TestBlockValidatorSimpleJITOnchainWithPublishedMachine(t *testing.T) {
}

func TestBlockValidatorSimpleOnchainWithPublishedMachine(t *testing.T) {
t.Skip("Fails cause EIP-2935 (part of arbOs 40) is not implemented in the latest published machine i.e Consensus V32")
// TODO: Remove this skip when consensus V40 is published
// TODO: Make this more robust in the future, so that it can handle if the latest consensus release is behind the arbOS version we want to test.
cr, err := github.LatestConsensusRelease(context.Background())
Require(t, err)
machPath := populateMachineDir(t, cr)
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