From 9c66cbdc60753dba2c43fdc3d2729bac84e32e8f Mon Sep 17 00:00:00 2001 From: Gabriel de Quadros Ligneul Date: Wed, 27 Aug 2025 08:46:37 -0300 Subject: [PATCH 1/5] Improve CPU performance when processing blocks Pull the changes from https://github.com/OffchainLabs/go-ethereum/pull/519 Close NIT-3769 --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index 060ec4165f5..8a5871262c2 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 060ec4165f5fef525ddff1d3facff142532413a2 +Subproject commit 8a5871262c201f06169a0e5422b58aa482f0c4fb From 343547646d14b90f1a2651cf8f018196069a35e3 Mon Sep 17 00:00:00 2001 From: Joshua Colvin Date: Fri, 29 Aug 2025 17:03:32 -0700 Subject: [PATCH 2/5] Add consensus v41 to Dockerfile Also removed deprecated v42-rc.1 since no one should ever use it --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9d86e6a791a..946adc48651 100644 --- a/Dockerfile +++ b/Dockerfile @@ -237,7 +237,7 @@ RUN ./download-machine.sh consensus-v31 0x260f5fa5c3176a856893642e149cf128b5a8de RUN ./download-machine.sh consensus-v32 0x184884e1eb9fefdc158f6c8ac912bb183bf3cf83f0090317e0bc4ac5860baa39 #RUN ./download-machine.sh consensus-v40-rc.1 0x6dae396b0b7644a2d63b4b22e6452b767aa6a04b6778dadebdd74aa40f40a5c5 #RUN ./download-machine.sh consensus-v40-rc.2 0xa8206be13d53e456c7ab061d94bab5b229d674ac57ffe7281216479a8820fcc0 -RUN ./download-machine.sh consensus-v42-rc.1 0x1be44d9f74056fc12af97ccbef7a2668bc5c946fe210505957b0a08b954b907f +RUN ./download-machine.sh consensus-v41 0xa18d6266cef250802c3cb2bfefe947ea1aa9a32dd30a8d1dfc4568a8714d3a7a RUN ./download-machine.sh consensus-v50-alpha.1 0x28cfd8d81613ce4ebe750e77bfd95d6d95d4f53240488095a11c1ad3a494fa82 RUN ./download-machine.sh consensus-v40 0xdb698a2576298f25448bc092e52cf13b1e24141c997135d70f217d674bbeb69a From 42be4feeea06a2a0a5b8645132d3a69e8625cb59 Mon Sep 17 00:00:00 2001 From: Joshua Colvin Date: Mon, 8 Sep 2025 22:47:03 -0700 Subject: [PATCH 3/5] Backport test Genesis assertion on nitro init to 3.7.x (#3596) * Test Genesis assertion on nitro init * revert go.mod changes --- cmd/conf/init.go | 3 +++ cmd/nitro/init.go | 54 ++++++++++++++++++++++++++++++++++++++++++ cmd/nitro/init_test.go | 2 ++ 3 files changed, 59 insertions(+) diff --git a/cmd/conf/init.go b/cmd/conf/init.go index 30153069fe2..777b25de5ae 100644 --- a/cmd/conf/init.go +++ b/cmd/conf/init.go @@ -41,6 +41,7 @@ type InitConfig struct { ReorgToBatch int64 `koanf:"reorg-to-batch"` ReorgToMessageBatch int64 `koanf:"reorg-to-message-batch"` ReorgToBlockBatch int64 `koanf:"reorg-to-block-batch"` + ValidateGenesisAssertion bool `koanf:"validate-genesis-assertion"` } var InitConfigDefault = InitConfig{ @@ -71,6 +72,7 @@ var InitConfigDefault = InitConfig{ ReorgToBatch: -1, ReorgToMessageBatch: -1, ReorgToBlockBatch: -1, + ValidateGenesisAssertion: true, } func InitConfigAddOptions(prefix string, f *pflag.FlagSet) { @@ -105,6 +107,7 @@ func InitConfigAddOptions(prefix string, f *pflag.FlagSet) { "\"force\"- force rebuilding which would commence rebuilding despite the status of previous attempts,\n"+ "\"false\"- do not rebuild on startup", ) + f.Bool(prefix+".validate-genesis-assertion", InitConfigDefault.ValidateGenesisAssertion, "tests genesis assertion posted on parent chain against the genesis block created on init") } func (c *InitConfig) Validate() error { diff --git a/cmd/nitro/init.go b/cmd/nitro/init.go index cd9acbc5bd2..4584ca11517 100644 --- a/cmd/nitro/init.go +++ b/cmd/nitro/init.go @@ -25,6 +25,7 @@ import ( "github.com/cavaliergopher/grab/v3" "github.com/codeclysm/extract/v3" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/rawdb" @@ -36,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" + protocol "github.com/offchainlabs/bold/chain-abstraction" "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbos/arbosState" "github.com/offchainlabs/nitro/arbos/arbostypes" @@ -44,10 +46,13 @@ import ( "github.com/offchainlabs/nitro/cmd/pruning" "github.com/offchainlabs/nitro/cmd/staterecovery" "github.com/offchainlabs/nitro/execution/gethexec" + "github.com/offchainlabs/nitro/solgen/go/rollupgen" + "github.com/offchainlabs/nitro/staker/bold" "github.com/offchainlabs/nitro/statetransfer" "github.com/offchainlabs/nitro/util" "github.com/offchainlabs/nitro/util/arbmath" "github.com/offchainlabs/nitro/util/dbutil" + "github.com/offchainlabs/nitro/util/headerreader" ) var notFoundError = errors.New("file not found") @@ -806,6 +811,14 @@ func openInitializeChainDb(ctx context.Context, stack *node.Node, config *NodeCo } testUpdateTxIndex(chainDb, chainConfig, &txIndexWg) } else { + var initDataReaderHasAccounts bool + if config.Init.ValidateGenesisAssertion { + accountsReader, err := initDataReader.GetAccountDataReader() + if err != nil { + return chainDb, nil, err + } + initDataReaderHasAccounts = accountsReader.More() + } genesisBlockNr, err := initDataReader.GetNextBlockNumber() if err != nil { return chainDb, nil, err @@ -895,6 +908,14 @@ func openInitializeChainDb(ctx context.Context, stack *node.Node, config *NodeCo if err != nil { return chainDb, nil, err } + if config.Init.ValidateGenesisAssertion { + if err := validateGenesisAssertion(ctx, rollupAddrs.Rollup, l1Client, l2BlockChain.Genesis().Hash(), initDataReaderHasAccounts); err != nil { + if !config.Init.Force { + return chainDb, nil, fmt.Errorf("error testing genesis assertion: %w", err) + } + log.Error("Error testing genesis assertions", "err", err) + } + } } txIndexWg.Wait() @@ -916,6 +937,39 @@ func openInitializeChainDb(ctx context.Context, stack *node.Node, config *NodeCo return rebuildLocalWasm(ctx, &config.Execution, l2BlockChain, chainDb, wasmDb, config.Init.RebuildLocalWasm) } +func validateGenesisAssertion(ctx context.Context, rollupAddress common.Address, l1Client *ethclient.Client, genesisBlockHash common.Hash, initDataReaderHasAccounts bool) error { + userLogic, err := rollupgen.NewRollupUserLogic(rollupAddress, l1Client) + if err != nil { + return err + } + _, err = userLogic.ChallengeGracePeriodBlocks(&bind.CallOpts{Context: ctx}) + if err != nil { + if !headerreader.IsExecutionReverted(err) { + return err + } + log.Warn("Genesis Assertion is not tested") // not a bold chain + return nil + } + genesisAssertionHash, err := userLogic.GenesisAssertionHash(&bind.CallOpts{Context: context.Background()}) + if err != nil { + return err + } + genesisAssertionCreationInfo, err := bold.ReadBoldAssertionCreationInfo(ctx, userLogic, l1Client, rollupAddress, genesisAssertionHash) + if err != nil { + return err + } + beforeGlobalState := protocol.GoGlobalStateFromSolidity(genesisAssertionCreationInfo.BeforeState.GlobalState) + afterGlobalState := protocol.GoGlobalStateFromSolidity(genesisAssertionCreationInfo.AfterState.GlobalState) + isNullAssertion := beforeGlobalState.Batch == afterGlobalState.Batch && beforeGlobalState.PosInBatch == afterGlobalState.PosInBatch + if isNullAssertion && initDataReaderHasAccounts { + return errors.New("genesis assertion is null but there are accounts in the init data") + } + if !isNullAssertion && afterGlobalState.BlockHash != genesisBlockHash { + return errors.New("genesis assertion is non null and its afterGlobalState.BlockHash doesn't match the genesis blockHash") + } + return nil +} + func testTxIndexUpdated(chainDb ethdb.Database, lastBlock uint64) bool { var transactions types.Transactions blockHash := rawdb.ReadCanonicalHash(chainDb, lastBlock) diff --git a/cmd/nitro/init_test.go b/cmd/nitro/init_test.go index 52ee76eac22..bb624ffbd96 100644 --- a/cmd/nitro/init_test.go +++ b/cmd/nitro/init_test.go @@ -429,6 +429,7 @@ func TestOpenInitializeChainDbIncompatibleStateScheme(t *testing.T) { nodeConfig.Node = *arbnode.ConfigDefaultL2Test() nodeConfig.Init.DevInit = true nodeConfig.Init.DevInitAddress = "0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E" + nodeConfig.Init.ValidateGenesisAssertion = false l1Client := ethclient.NewClient(stack.Attach()) @@ -696,6 +697,7 @@ func TestOpenInitializeChainDbEmptyInit(t *testing.T) { nodeConfig.Chain.ID = 42161 nodeConfig.Node = *arbnode.ConfigDefaultL2Test() nodeConfig.Init.Empty = true + nodeConfig.Init.ValidateGenesisAssertion = false l1Client := ethclient.NewClient(stack.Attach()) From ce11ab9e718fad8d385be43b212882c11d563d56 Mon Sep 17 00:00:00 2001 From: Daniil Ankushin Date: Mon, 15 Sep 2025 15:32:54 +0400 Subject: [PATCH 4/5] Add GitHub Actions workflow for Docker build (#22) --- .github/workflows/docker-build.yml | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000000..ab66c99441e --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,35 @@ +name: Build docker container + +on: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + id-token: write + attestations: write + contents: read + +jobs: + build: + uses: NethermindEth/github-workflows/.github/workflows/docker-build-push-jfrog.yaml@v1.5.1 + with: + group_name: core + runner: ubuntu-24.04-arm + image_name: 'arbitrum-nitro' + platforms: "linux/arm64" + pre_build_script: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/share/boost + sudo rm -rf /usr/local/graalvm/ + sudo rm -rf /usr/local/.ghcup/ + sudo rm -rf /usr/local/share/powershell + sudo rm -rf /usr/local/share/chromium + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/local/lib/node_modules + sudo apt-get clean + docker system prune -af --volumes + df -h From e8b01758f1f46033a190f49be240513a550ae74b Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Mon, 3 Nov 2025 14:03:01 +0400 Subject: [PATCH 5/5] chore: update submodules for consensus-v50-rc.6 on master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - go-ethereum: → 57fe4b732 - nitro-testnode: → 88aa1f4ee --- go-ethereum | 2 +- nitro-testnode | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go-ethereum b/go-ethereum index 8a5871262c2..57fe4b732d4 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 8a5871262c201f06169a0e5422b58aa482f0c4fb +Subproject commit 57fe4b732d4e640e696da40773f2dacba97e722b diff --git a/nitro-testnode b/nitro-testnode index aaa556d9f37..88aa1f4ee31 160000 --- a/nitro-testnode +++ b/nitro-testnode @@ -1 +1 @@ -Subproject commit aaa556d9f37fe8832d5da61b61ac011f9b8fec2e +Subproject commit 88aa1f4ee31182011195ec99992b5ff4d2e2c24d