From d02469cea510d678340b7f1e1e241d9d667933ef Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Thu, 25 May 2023 22:43:25 +0530
Subject: [PATCH 01/19] test to ensure DIFFICULTY/PREVRANDAO opcode returns the
 expected value of 1

---
 contracts                       |  2 +-
 go-ethereum                     |  2 +-
 system_tests/common_test.go     | 17 +++++++++++---
 system_tests/estimation_test.go | 40 +++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/contracts b/contracts
index f48ce451e4..fa5f512150 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit f48ce451e4bc2dbea9024cdc08fd0eb410fa61b5
+Subproject commit fa5f51215083e35382cc7ad8cdccf3e72b76fc30
diff --git a/go-ethereum b/go-ethereum
index a23dc84cfd..ffad045d01 160000
--- a/go-ethereum
+++ b/go-ethereum
@@ -1 +1 @@
-Subproject commit a23dc84cfd8a00f1a971edf917563a72fdf4304f
+Subproject commit ffad045d01f9c98135797f84ca80a16088d21ec2
diff --git a/system_tests/common_test.go b/system_tests/common_test.go
index e471899ff9..6b6b2e9155 100644
--- a/system_tests/common_test.go
+++ b/system_tests/common_test.go
@@ -597,17 +597,28 @@ func createTestNodeOnL1WithConfigImpl(
 // L2 -Only. Enough for tests that needs no interface to L1
 // Requires precompiles.AllowDebugPrecompiles = true
 func CreateTestL2(t *testing.T, ctx context.Context) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
-	return CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true)
+	return CreateTestL2WithArbOS(t, ctx, 11)
+}
+
+func CreateTestL2WithArbOS(t *testing.T, ctx context.Context, arbOS uint64) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
+	return CreateTestL2WithConfigArbOS(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, arbOS)
 }
 
 func CreateTestL2WithConfig(
 	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, takeOwnership bool,
+) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
+	return CreateTestL2WithConfigArbOS(t, ctx, l2Info, nodeConfig, takeOwnership, 11)
+}
+
+func CreateTestL2WithConfigArbOS(
+	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, takeOwnership bool, arbOS uint64,
 ) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
 	feedErrChan := make(chan error, 10)
 
 	AddDefaultValNode(t, ctx, nodeConfig, true)
-
-	l2info, stack, chainDb, arbDb, blockchain := createL2BlockChain(t, l2Info, "", params.ArbitrumDevTestChainConfig())
+	chainConfig := params.ArbitrumDevTestChainConfig()
+	chainConfig.ArbitrumChainParams.InitialArbOSVersion = arbOS
+	l2info, stack, chainDb, arbDb, blockchain := createL2BlockChain(t, l2Info, "", chainConfig)
 	currentNode, err := arbnode.CreateNode(ctx, stack, chainDb, arbDb, NewFetcherFromConfig(nodeConfig), blockchain, nil, nil, nil, nil, nil, feedErrChan)
 	Require(t, err)
 
diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index c80492326c..3b967ae81e 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -127,6 +127,46 @@ func TestEstimate(t *testing.T) {
 	}
 }
 
+func TestDifficultyForLatestArbOS(t *testing.T) {
+	ctx, cancel := context.WithCancel(context.Background())
+	defer cancel()
+
+	l2info, node, client := CreateTestL2(t, ctx)
+	defer node.StopAndWait()
+
+	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
+
+	// deploy a test contract
+	_, _, simple, err := mocksgen.DeploySimple(&auth, client)
+	Require(t, err, "could not deploy contract")
+
+	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
+	Require(t, err)
+	if difficulty.Uint64() != 1 {
+		Fail(t, "Expected difficulty to be 1 by got:", difficulty)
+	}
+}
+
+func TestDifficultyForArbOSTen(t *testing.T) {
+	ctx, cancel := context.WithCancel(context.Background())
+	defer cancel()
+
+	l2info, node, client := CreateTestL2WithArbOS(t, ctx, 10)
+	defer node.StopAndWait()
+
+	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
+
+	// deploy a test contract
+	_, _, simple, err := mocksgen.DeploySimple(&auth, client)
+	Require(t, err, "could not deploy contract")
+
+	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
+	Require(t, err)
+	if difficulty.Uint64() != 1 {
+		Fail(t, "Expected difficulty to be 1 by got:", difficulty)
+	}
+}
+
 func TestComponentEstimate(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()

From 31a0a67d0285e385e3afb165d96067ef73b3a392 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Thu, 25 May 2023 22:49:20 +0530
Subject: [PATCH 02/19] Fix contracts branch

---
 contracts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contracts b/contracts
index fa5f512150..3138c4b62e 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit fa5f51215083e35382cc7ad8cdccf3e72b76fc30
+Subproject commit 3138c4b62e4e180d62f324101c0448eb4ab78484

From ccf472d95e5559d959a54560cbace548be8cc068 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Thu, 25 May 2023 22:53:23 +0530
Subject: [PATCH 03/19] Fix contracts branch

---
 contracts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contracts b/contracts
index 3138c4b62e..7436762ab4 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit 3138c4b62e4e180d62f324101c0448eb4ab78484
+Subproject commit 7436762ab4236d31578e1f599a328eedeb2a632f

From 9b632f9ec1e09375d0501641b151d3300c4ebcdd Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Fri, 26 May 2023 00:00:49 +0530
Subject: [PATCH 04/19] update submodules

---
 contracts   | 2 +-
 go-ethereum | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contracts b/contracts
index 7436762ab4..08ac127e96 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit 7436762ab4236d31578e1f599a328eedeb2a632f
+Subproject commit 08ac127e966fa87a4d5ba3d23cd3132b57701132
diff --git a/go-ethereum b/go-ethereum
index ffad045d01..87c313c37b 160000
--- a/go-ethereum
+++ b/go-ethereum
@@ -1 +1 @@
-Subproject commit ffad045d01f9c98135797f84ca80a16088d21ec2
+Subproject commit 87c313c37b8b59f0e5a6abed53ed169c2788e5b9

From e7220b6523cb037cfc4b900bc513263a15a24247 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Fri, 26 May 2023 00:06:34 +0530
Subject: [PATCH 05/19] update submodules

---
 contracts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contracts b/contracts
index 08ac127e96..f79f136972 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit 08ac127e966fa87a4d5ba3d23cd3132b57701132
+Subproject commit f79f136972fa30588cef6e6082a54217fbdb4a84

From 1d3a93cd98d9824cef35170aee3bfb444c4c2670 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Tue, 30 May 2023 23:44:56 +0530
Subject: [PATCH 06/19] Changes based on PR comments

---
 system_tests/estimation_test.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 3b967ae81e..cbf757988f 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -142,7 +142,7 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
-	if difficulty.Uint64() != 1 {
+	if arbmath.BigEquals(difficulty, common.Big1) {
 		Fail(t, "Expected difficulty to be 1 by got:", difficulty)
 	}
 }
@@ -162,7 +162,7 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
-	if difficulty.Uint64() != 1 {
+	if arbmath.BigEquals(difficulty, common.Big1) {
 		Fail(t, "Expected difficulty to be 1 by got:", difficulty)
 	}
 }

From b517b8ef4c24707deaebc067aa103b1da794216b Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 21 Jun 2023 20:58:52 +0530
Subject: [PATCH 07/19] Changes based on PR comments

---
 system_tests/bloom_test.go              |  2 +-
 system_tests/common_test.go             | 23 +++++++----------------
 system_tests/conditionaltx_test.go      |  2 +-
 system_tests/contract_tx_test.go        |  2 +-
 system_tests/estimation_test.go         | 16 +++++++++-------
 system_tests/infra_fee_test.go          |  2 +-
 system_tests/initialization_test.go     |  2 +-
 system_tests/log_subscription_test.go   |  2 +-
 system_tests/outbox_test.go             |  2 +-
 system_tests/precompile_test.go         |  8 ++++----
 system_tests/reorg_resequencing_test.go |  2 +-
 system_tests/retryable_test.go          |  2 +-
 system_tests/seq_coordinator_test.go    |  2 +-
 system_tests/seq_nonce_test.go          |  6 +++---
 system_tests/seq_pause_test.go          |  2 +-
 system_tests/seq_reject_test.go         |  4 ++--
 system_tests/seq_whitelist_test.go      |  2 +-
 system_tests/seqfeed_test.go            |  8 ++++----
 system_tests/transfer_test.go           |  2 +-
 19 files changed, 42 insertions(+), 49 deletions(-)

diff --git a/system_tests/bloom_test.go b/system_tests/bloom_test.go
index 9ad3253d4a..f2a9bd408e 100644
--- a/system_tests/bloom_test.go
+++ b/system_tests/bloom_test.go
@@ -28,7 +28,7 @@ func TestBloom(t *testing.T) {
 	nodeconfig := arbnode.ConfigDefaultL2Test()
 	nodeconfig.RPC.BloomBitsBlocks = 256
 	nodeconfig.RPC.BloomConfirms = 1
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nodeconfig, false)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nodeconfig, false, nil)
 	defer node.StopAndWait()
 
 	l2info.GenerateAccount("User2")
diff --git a/system_tests/common_test.go b/system_tests/common_test.go
index 844ca63f1f..b9908a7f06 100644
--- a/system_tests/common_test.go
+++ b/system_tests/common_test.go
@@ -622,32 +622,23 @@ func createTestNodeOnL1WithConfigImpl(
 
 // L2 -Only. Enough for tests that needs no interface to L1
 // Requires precompiles.AllowDebugPrecompiles = true
-func CreateTestL2(t *testing.T, ctx context.Context) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
-	return CreateTestL2WithArbOS(t, ctx, 11)
-}
-
-func CreateTestL2WithArbOS(t *testing.T, ctx context.Context, arbOS uint64) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
-	return CreateTestL2WithConfigArbOS(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, arbOS)
+func CreateTestL2(t *testing.T, ctx context.Context, chainConfig *params.ChainConfig) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
+	return CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, chainConfig)
 }
 
 func CreateTestL2WithConfig(
-	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, takeOwnership bool,
-) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
-	return CreateTestL2WithConfigArbOS(t, ctx, l2Info, nodeConfig, takeOwnership, 11)
-}
-
-func CreateTestL2WithConfigArbOS(
-	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, takeOwnership bool, arbOS uint64,
+	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, takeOwnership bool, chainConfig *params.ChainConfig,
 ) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
 	feedErrChan := make(chan error, 10)
 
 	AddDefaultValNode(t, ctx, nodeConfig, true)
-	chainConfig := params.ArbitrumDevTestChainConfig()
-	chainConfig.ArbitrumChainParams.InitialArbOSVersion = arbOS
+
+	if chainConfig == nil {
+		chainConfig = params.ArbitrumDevTestChainConfig()
+	}
 	l2info, stack, chainDb, arbDb, blockchain := createL2BlockChain(t, l2Info, "", chainConfig)
 	currentNode, err := arbnode.CreateNode(ctx, stack, chainDb, arbDb, NewFetcherFromConfig(nodeConfig), blockchain, nil, nil, nil, nil, nil, feedErrChan)
 	Require(t, err)
-
 	// Give the node an init message
 	err = currentNode.TxStreamer.AddFakeInitMessage()
 	Require(t, err)
diff --git a/system_tests/conditionaltx_test.go b/system_tests/conditionaltx_test.go
index c65103694a..09260d7a76 100644
--- a/system_tests/conditionaltx_test.go
+++ b/system_tests/conditionaltx_test.go
@@ -308,7 +308,7 @@ func TestSendRawTransactionConditionalBasic(t *testing.T) {
 func TestSendRawTransactionConditionalMultiRoutine(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 	rpcClient, err := node.Stack.Attach()
 	Require(t, err)
diff --git a/system_tests/contract_tx_test.go b/system_tests/contract_tx_test.go
index e671dcc6ac..fb6e72080a 100644
--- a/system_tests/contract_tx_test.go
+++ b/system_tests/contract_tx_test.go
@@ -27,7 +27,7 @@ func TestContractTxDeploy(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 	nodeconfig := arbnode.ConfigDefaultL2Test()
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nodeconfig, false)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nodeconfig, false, nil)
 	defer node.StopAndWait()
 
 	from := common.HexToAddress("0x123412341234")
diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 58b14fe7ee..8dd1163625 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -26,7 +26,7 @@ func TestDeploy(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -51,7 +51,7 @@ func TestEstimate(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -131,7 +131,7 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -143,7 +143,7 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
 	if arbmath.BigEquals(difficulty, common.Big1) {
-		Fail(t, "Expected difficulty to be 1 by got:", difficulty)
+		Fatal(t, "Expected difficulty to be 1 by got:", difficulty)
 	}
 }
 
@@ -151,7 +151,9 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2WithArbOS(t, ctx, 10)
+	chainConfig := params.ArbitrumDevTestChainConfig()
+	chainConfig.ArbitrumChainParams.InitialArbOSVersion = 10
+	l2info, node, client := CreateTestL2(t, ctx, chainConfig)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -163,7 +165,7 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
 	if arbmath.BigEquals(difficulty, common.Big1) {
-		Fail(t, "Expected difficulty to be 1 by got:", difficulty)
+		Fatal(t, "Expected difficulty to be 1 by got:", difficulty)
 	}
 }
 
@@ -171,7 +173,7 @@ func TestComponentEstimate(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	l1BaseFee := new(big.Int).Set(arbostypes.DefaultInitialL1BaseFee)
diff --git a/system_tests/infra_fee_test.go b/system_tests/infra_fee_test.go
index 89f869576d..237854beae 100644
--- a/system_tests/infra_fee_test.go
+++ b/system_tests/infra_fee_test.go
@@ -25,7 +25,7 @@ func TestInfraFee(t *testing.T) {
 	defer cancel()
 	nodeconfig := arbnode.ConfigDefaultL2Test()
 
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nodeconfig, true)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nodeconfig, true, nil)
 	defer node.StopAndWait()
 
 	l2info.GenerateAccount("User2")
diff --git a/system_tests/initialization_test.go b/system_tests/initialization_test.go
index c7797d35e6..90f9f2f6f4 100644
--- a/system_tests/initialization_test.go
+++ b/system_tests/initialization_test.go
@@ -63,7 +63,7 @@ func TestInitContract(t *testing.T) {
 		l2info.ArbInitData.Accounts = append(l2info.ArbInitData.Accounts, accountInfo)
 		expectedSums[accountAddress] = sum
 	}
-	_, node, client := CreateTestL2WithConfig(t, ctx, l2info, arbnode.ConfigDefaultL2Test(), true)
+	_, node, client := CreateTestL2WithConfig(t, ctx, l2info, arbnode.ConfigDefaultL2Test(), true, nil)
 	defer node.StopAndWait()
 
 	for accountAddress, sum := range expectedSums {
diff --git a/system_tests/log_subscription_test.go b/system_tests/log_subscription_test.go
index 5ee1732fb0..54ad0fe5ee 100644
--- a/system_tests/log_subscription_test.go
+++ b/system_tests/log_subscription_test.go
@@ -19,7 +19,7 @@ func TestLogSubscription(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
diff --git a/system_tests/outbox_test.go b/system_tests/outbox_test.go
index 6b43cc83b0..d79f74c5b2 100644
--- a/system_tests/outbox_test.go
+++ b/system_tests/outbox_test.go
@@ -35,7 +35,7 @@ func TestOutboxProofs(t *testing.T) {
 	withdrawTopic := arbSysAbi.Events["L2ToL1Tx"].ID
 	merkleTopic := arbSysAbi.Events["SendMerkleUpdate"].ID
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
diff --git a/system_tests/precompile_test.go b/system_tests/precompile_test.go
index ad08ff7471..66feccf46c 100644
--- a/system_tests/precompile_test.go
+++ b/system_tests/precompile_test.go
@@ -21,7 +21,7 @@ func TestPurePrecompileMethodCalls(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	_, node, client := CreateTestL2(t, ctx)
+	_, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	arbSys, err := precompilesgen.NewArbSys(common.HexToAddress("0x64"), client)
@@ -37,7 +37,7 @@ func TestViewLogReverts(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	_, node, client := CreateTestL2(t, ctx)
+	_, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	arbDebug, err := precompilesgen.NewArbDebug(common.HexToAddress("0xff"), client)
@@ -53,7 +53,7 @@ func TestCustomSolidityErrors(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	_, node, client := CreateTestL2(t, ctx)
+	_, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	callOpts := &bind.CallOpts{Context: ctx}
@@ -86,7 +86,7 @@ func TestPrecompileErrorGasLeft(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	info, node, client := CreateTestL2(t, ctx)
+	info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	auth := info.GetDefaultTransactOpts("Faucet", ctx)
diff --git a/system_tests/reorg_resequencing_test.go b/system_tests/reorg_resequencing_test.go
index f132d46487..c3a46b1390 100644
--- a/system_tests/reorg_resequencing_test.go
+++ b/system_tests/reorg_resequencing_test.go
@@ -19,7 +19,7 @@ func TestReorgResequencing(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
+	l2info, node, client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	startMsgCount, err := node.TxStreamer.GetMessageCount()
diff --git a/system_tests/retryable_test.go b/system_tests/retryable_test.go
index 7b0c3a7563..41190831ad 100644
--- a/system_tests/retryable_test.go
+++ b/system_tests/retryable_test.go
@@ -104,7 +104,7 @@ func retryableSetup(t *testing.T) (
 func TestRetryableNoExist(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	_, node, l2client := CreateTestL2(t, ctx)
+	_, node, l2client := CreateTestL2(t, ctx, nil)
 	defer node.StopAndWait()
 
 	arbRetryableTx, err := precompilesgen.NewArbRetryableTx(common.HexToAddress("6e"), l2client)
diff --git a/system_tests/seq_coordinator_test.go b/system_tests/seq_coordinator_test.go
index 2209e82d93..77b2c12add 100644
--- a/system_tests/seq_coordinator_test.go
+++ b/system_tests/seq_coordinator_test.go
@@ -62,7 +62,7 @@ func TestRedisSeqCoordinatorPriorities(t *testing.T) {
 
 	createStartNode := func(nodeNum int) {
 		nodeConfig.SeqCoordinator.MyUrlImpl = nodeNames[nodeNum]
-		_, node, _ := CreateTestL2WithConfig(t, ctx, l2Info, nodeConfig, false)
+		_, node, _ := CreateTestL2WithConfig(t, ctx, l2Info, nodeConfig, false, nil)
 		nodes[nodeNum] = node
 	}
 
diff --git a/system_tests/seq_nonce_test.go b/system_tests/seq_nonce_test.go
index 968f141364..3d15199ae3 100644
--- a/system_tests/seq_nonce_test.go
+++ b/system_tests/seq_nonce_test.go
@@ -26,7 +26,7 @@ func TestSequencerParallelNonces(t *testing.T) {
 
 	config := arbnode.ConfigDefaultL2Test()
 	config.Sequencer.NonceFailureCacheExpiry = time.Minute
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, config, false)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, config, false, nil)
 	defer node.StopAndWait()
 
 	l2info.GenerateAccount("Destination")
@@ -63,7 +63,7 @@ func TestSequencerNonceTooHigh(t *testing.T) {
 	defer cancel()
 
 	config := arbnode.ConfigDefaultL2Test()
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, config, false)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, config, false, nil)
 	defer node.StopAndWait()
 
 	l2info.GetInfoWithPrivKey("Owner").Nonce++
@@ -91,7 +91,7 @@ func TestSequencerNonceTooHighQueueFull(t *testing.T) {
 	config := arbnode.ConfigDefaultL2Test()
 	config.Sequencer.NonceFailureCacheSize = 5
 	config.Sequencer.NonceFailureCacheExpiry = time.Minute
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, config, false)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, config, false, nil)
 	defer node.StopAndWait()
 
 	count := 15
diff --git a/system_tests/seq_pause_test.go b/system_tests/seq_pause_test.go
index fd057c0181..2bd0139fc3 100644
--- a/system_tests/seq_pause_test.go
+++ b/system_tests/seq_pause_test.go
@@ -16,7 +16,7 @@ func TestSequencerPause(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info1, nodeA, client := CreateTestL2(t, ctx)
+	l2info1, nodeA, client := CreateTestL2(t, ctx, nil)
 	defer nodeA.StopAndWait()
 
 	const numUsers = 100
diff --git a/system_tests/seq_reject_test.go b/system_tests/seq_reject_test.go
index 19c06c4bc3..35018d9751 100644
--- a/system_tests/seq_reject_test.go
+++ b/system_tests/seq_reject_test.go
@@ -31,14 +31,14 @@ func TestSequencerRejection(t *testing.T) {
 	seqNodeConfig := arbnode.ConfigDefaultL2Test()
 	seqNodeConfig.Feed.Output = *newBroadcasterConfigTest()
 	feedErrChan := make(chan error, 10)
-	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, true)
+	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, true, nil)
 	defer nodeA.StopAndWait()
 
 	clientNodeConfig := arbnode.ConfigDefaultL2Test()
 	port := nodeA.BroadcastServer.ListenerAddr().(*net.TCPAddr).Port
 	clientNodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
 
-	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, false)
+	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, false, nil)
 	defer nodeB.StopAndWait()
 
 	auth := l2info1.GetDefaultTransactOpts("Owner", ctx)
diff --git a/system_tests/seq_whitelist_test.go b/system_tests/seq_whitelist_test.go
index 2d671dcdd6..e8a2e27428 100644
--- a/system_tests/seq_whitelist_test.go
+++ b/system_tests/seq_whitelist_test.go
@@ -18,7 +18,7 @@ func TestSequencerWhitelist(t *testing.T) {
 
 	config := arbnode.ConfigDefaultL2Test()
 	config.Sequencer.SenderWhitelist = GetTestAddressForAccountName(t, "Owner").String() + "," + GetTestAddressForAccountName(t, "User").String()
-	l2info, l2node, client := CreateTestL2WithConfig(t, ctx, nil, config, true)
+	l2info, l2node, client := CreateTestL2WithConfig(t, ctx, nil, config, true, nil)
 	defer l2node.StopAndWait()
 
 	l2info.GenerateAccount("User")
diff --git a/system_tests/seqfeed_test.go b/system_tests/seqfeed_test.go
index 0ae72e384f..bcdf41d9b7 100644
--- a/system_tests/seqfeed_test.go
+++ b/system_tests/seqfeed_test.go
@@ -44,13 +44,13 @@ func TestSequencerFeed(t *testing.T) {
 
 	seqNodeConfig := arbnode.ConfigDefaultL2Test()
 	seqNodeConfig.Feed.Output = *newBroadcasterConfigTest()
-	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, true)
+	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, true, nil)
 	defer nodeA.StopAndWait()
 	clientNodeConfig := arbnode.ConfigDefaultL2Test()
 	port := nodeA.BroadcastServer.ListenerAddr().(*net.TCPAddr).Port
 	clientNodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
 
-	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, false)
+	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, false, nil)
 	defer nodeB.StopAndWait()
 
 	l2info1.GenerateAccount("User2")
@@ -79,7 +79,7 @@ func TestRelayedSequencerFeed(t *testing.T) {
 
 	seqNodeConfig := arbnode.ConfigDefaultL2Test()
 	seqNodeConfig.Feed.Output = *newBroadcasterConfigTest()
-	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, true)
+	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, true, nil)
 	defer nodeA.StopAndWait()
 
 	bigChainId, err := client1.ChainID(ctx)
@@ -101,7 +101,7 @@ func TestRelayedSequencerFeed(t *testing.T) {
 	clientNodeConfig := arbnode.ConfigDefaultL2Test()
 	port = currentRelay.GetListenerAddr().(*net.TCPAddr).Port
 	clientNodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
-	_, nodeC, client3 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, false)
+	_, nodeC, client3 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, false, nil)
 	defer nodeC.StopAndWait()
 	StartWatchChanErr(t, ctx, feedErrChan, nodeC)
 
diff --git a/system_tests/transfer_test.go b/system_tests/transfer_test.go
index 2e3317907b..b7328f2b72 100644
--- a/system_tests/transfer_test.go
+++ b/system_tests/transfer_test.go
@@ -13,7 +13,7 @@ import (
 func TestTransfer(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	l2info, l2node, client := CreateTestL2(t, ctx)
+	l2info, l2node, client := CreateTestL2(t, ctx, nil)
 	defer l2node.StopAndWait()
 
 	l2info.GenerateAccount("User2")

From 37ff4e7a4e487fde17e40bc9b8eeb8ee2b3b2d3c Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 21 Jun 2023 21:24:32 +0530
Subject: [PATCH 08/19] minor fix

---
 system_tests/estimation_test.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 8dd1163625..eceaebddbe 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -142,8 +142,8 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
-	if arbmath.BigEquals(difficulty, common.Big1) {
-		Fatal(t, "Expected difficulty to be 1 by got:", difficulty)
+	if !arbmath.BigEquals(difficulty, common.Big1) {
+		Fatal(t, "Expected difficulty to be 1 but got:", difficulty)
 	}
 }
 
@@ -164,8 +164,8 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
-	if arbmath.BigEquals(difficulty, common.Big1) {
-		Fatal(t, "Expected difficulty to be 1 by got:", difficulty)
+	if !arbmath.BigEquals(difficulty, common.Big1) {
+		Fatal(t, "Expected difficulty to be 1 but got:", difficulty)
 	}
 }
 

From bc8e7bb970d62634831b9a69d15b186161af7f02 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 21 Jun 2023 22:20:06 +0530
Subject: [PATCH 09/19] Changes based on PR comments

---
 system_tests/block_validator_test.go | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/system_tests/block_validator_test.go b/system_tests/block_validator_test.go
index b3fd8ddb6c..13658c898c 100644
--- a/system_tests/block_validator_test.go
+++ b/system_tests/block_validator_test.go
@@ -14,13 +14,16 @@ import (
 	"time"
 
 	"github.com/ethereum/go-ethereum"
+	"github.com/ethereum/go-ethereum/accounts/abi/bind"
 	"github.com/ethereum/go-ethereum/common"
 	"github.com/ethereum/go-ethereum/core/types"
 	"github.com/ethereum/go-ethereum/core/vm"
 
 	"github.com/offchainlabs/nitro/arbnode"
 	"github.com/offchainlabs/nitro/arbos/l2pricing"
+	"github.com/offchainlabs/nitro/solgen/go/mocksgen"
 	"github.com/offchainlabs/nitro/solgen/go/precompilesgen"
+	"github.com/offchainlabs/nitro/util/arbmath"
 )
 
 type workloadType uint
@@ -60,6 +63,7 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 
 	perTransfer := big.NewInt(1e12)
 
+	var simple *mocksgen.Simple
 	if workload != upgradeArbOs {
 		for i := 0; i < workloadLoops; i++ {
 			var tx *types.Transaction
@@ -108,6 +112,16 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 		}
 	} else {
 		auth := l2info.GetDefaultTransactOpts("Owner", ctx)
+		// deploy a test contract
+		var err error
+		_, _, simple, err = mocksgen.DeploySimple(&auth, l2client)
+		Require(t, err, "could not deploy contract")
+
+		difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
+		Require(t, err)
+		if !arbmath.BigEquals(difficulty, common.Big1) {
+			Fatal(t, "Expected difficulty to be 1 but got:", difficulty)
+		}
 		// make auth a chain owner
 		arbDebug, err := precompilesgen.NewArbDebug(common.HexToAddress("0xff"), l2client)
 		Require(t, err)
@@ -122,6 +136,12 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 		_, err = EnsureTxSucceeded(ctx, l2client, tx)
 		Require(t, err)
 
+		difficulty, err = simple.GetBlockDifficulty(&bind.CallOpts{})
+		Require(t, err)
+		if !arbmath.BigEquals(difficulty, common.Big1) {
+			Fatal(t, "Expected difficulty to be 1 but got:", difficulty)
+		}
+
 		tx = l2info.PrepareTxTo("Owner", nil, l2info.TransferGas, perTransfer, []byte{byte(vm.PUSH0)})
 		err = l2client.SendTransaction(ctx, tx)
 		Require(t, err)
@@ -157,6 +177,13 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 			Fatal(t, "Unexpected balance:", l2balance)
 		}
 	}
+	if workload == upgradeArbOs {
+		difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
+		Require(t, err)
+		if !arbmath.BigEquals(difficulty, common.Big1) {
+			Fatal(t, "Expected difficulty to be 1 but got:", difficulty)
+		}
+	}
 
 	lastBlock, err := l2clientB.BlockByNumber(ctx, nil)
 	Require(t, err)

From b725fece91ebfdf29c4796933d72c3fcf4158e66 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Fri, 29 Sep 2023 19:07:57 +0530
Subject: [PATCH 10/19] Changes based on PR comments

---
 system_tests/common_test.go             |  4 ++--
 system_tests/conditionaltx_test.go      |  2 +-
 system_tests/estimation_test.go         | 11 ++++++-----
 system_tests/log_subscription_test.go   |  2 +-
 system_tests/outbox_test.go             |  2 +-
 system_tests/precompile_test.go         |  8 ++++----
 system_tests/reorg_resequencing_test.go |  2 +-
 system_tests/retryable_test.go          |  2 +-
 system_tests/seq_pause_test.go          |  2 +-
 system_tests/transfer_test.go           |  2 +-
 10 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/system_tests/common_test.go b/system_tests/common_test.go
index f1922c734d..20e78f9d27 100644
--- a/system_tests/common_test.go
+++ b/system_tests/common_test.go
@@ -642,8 +642,8 @@ func createTestNodeOnL1WithConfigImpl(
 
 // L2 -Only. Enough for tests that needs no interface to L1
 // Requires precompiles.AllowDebugPrecompiles = true
-func CreateTestL2(t *testing.T, ctx context.Context, chainConfig *params.ChainConfig) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
-	return CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, chainConfig)
+func CreateTestL2(t *testing.T, ctx context.Context) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
+	return CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, nil)
 }
 
 func CreateTestL2WithConfig(
diff --git a/system_tests/conditionaltx_test.go b/system_tests/conditionaltx_test.go
index d2faf5c3e1..14aa000313 100644
--- a/system_tests/conditionaltx_test.go
+++ b/system_tests/conditionaltx_test.go
@@ -308,7 +308,7 @@ func TestSendRawTransactionConditionalBasic(t *testing.T) {
 func TestSendRawTransactionConditionalMultiRoutine(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 	rpcClient, err := node.Stack.Attach()
 	Require(t, err)
diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 4d5c4a8d05..18dda4d84b 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -5,6 +5,7 @@ package arbtest
 
 import (
 	"context"
+	"github.com/offchainlabs/nitro/arbnode"
 	"math/big"
 	"testing"
 
@@ -26,7 +27,7 @@ func TestDeploy(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -51,7 +52,7 @@ func TestEstimate(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -131,7 +132,7 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -153,7 +154,7 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 
 	chainConfig := params.ArbitrumDevTestChainConfig()
 	chainConfig.ArbitrumChainParams.InitialArbOSVersion = 10
-	l2info, node, client := CreateTestL2(t, ctx, chainConfig)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, chainConfig)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
@@ -173,7 +174,7 @@ func TestComponentEstimate(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	l1BaseFee := new(big.Int).Set(arbostypes.DefaultInitialL1BaseFee)
diff --git a/system_tests/log_subscription_test.go b/system_tests/log_subscription_test.go
index 54ad0fe5ee..5ee1732fb0 100644
--- a/system_tests/log_subscription_test.go
+++ b/system_tests/log_subscription_test.go
@@ -19,7 +19,7 @@ func TestLogSubscription(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
diff --git a/system_tests/outbox_test.go b/system_tests/outbox_test.go
index d79f74c5b2..6b43cc83b0 100644
--- a/system_tests/outbox_test.go
+++ b/system_tests/outbox_test.go
@@ -35,7 +35,7 @@ func TestOutboxProofs(t *testing.T) {
 	withdrawTopic := arbSysAbi.Events["L2ToL1Tx"].ID
 	merkleTopic := arbSysAbi.Events["SendMerkleUpdate"].ID
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
diff --git a/system_tests/precompile_test.go b/system_tests/precompile_test.go
index 66feccf46c..ad08ff7471 100644
--- a/system_tests/precompile_test.go
+++ b/system_tests/precompile_test.go
@@ -21,7 +21,7 @@ func TestPurePrecompileMethodCalls(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	_, node, client := CreateTestL2(t, ctx, nil)
+	_, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	arbSys, err := precompilesgen.NewArbSys(common.HexToAddress("0x64"), client)
@@ -37,7 +37,7 @@ func TestViewLogReverts(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	_, node, client := CreateTestL2(t, ctx, nil)
+	_, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	arbDebug, err := precompilesgen.NewArbDebug(common.HexToAddress("0xff"), client)
@@ -53,7 +53,7 @@ func TestCustomSolidityErrors(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	_, node, client := CreateTestL2(t, ctx, nil)
+	_, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	callOpts := &bind.CallOpts{Context: ctx}
@@ -86,7 +86,7 @@ func TestPrecompileErrorGasLeft(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	info, node, client := CreateTestL2(t, ctx, nil)
+	info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	auth := info.GetDefaultTransactOpts("Faucet", ctx)
diff --git a/system_tests/reorg_resequencing_test.go b/system_tests/reorg_resequencing_test.go
index c3a46b1390..f132d46487 100644
--- a/system_tests/reorg_resequencing_test.go
+++ b/system_tests/reorg_resequencing_test.go
@@ -19,7 +19,7 @@ func TestReorgResequencing(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx, nil)
+	l2info, node, client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	startMsgCount, err := node.TxStreamer.GetMessageCount()
diff --git a/system_tests/retryable_test.go b/system_tests/retryable_test.go
index 674b2311c2..b1dd32d1dc 100644
--- a/system_tests/retryable_test.go
+++ b/system_tests/retryable_test.go
@@ -116,7 +116,7 @@ func retryableSetup(t *testing.T) (
 func TestRetryableNoExist(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	_, node, l2client := CreateTestL2(t, ctx, nil)
+	_, node, l2client := CreateTestL2(t, ctx)
 	defer node.StopAndWait()
 
 	arbRetryableTx, err := precompilesgen.NewArbRetryableTx(common.HexToAddress("6e"), l2client)
diff --git a/system_tests/seq_pause_test.go b/system_tests/seq_pause_test.go
index 2bd0139fc3..fd057c0181 100644
--- a/system_tests/seq_pause_test.go
+++ b/system_tests/seq_pause_test.go
@@ -16,7 +16,7 @@ func TestSequencerPause(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info1, nodeA, client := CreateTestL2(t, ctx, nil)
+	l2info1, nodeA, client := CreateTestL2(t, ctx)
 	defer nodeA.StopAndWait()
 
 	const numUsers = 100
diff --git a/system_tests/transfer_test.go b/system_tests/transfer_test.go
index b7328f2b72..2e3317907b 100644
--- a/system_tests/transfer_test.go
+++ b/system_tests/transfer_test.go
@@ -13,7 +13,7 @@ import (
 func TestTransfer(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	l2info, l2node, client := CreateTestL2(t, ctx, nil)
+	l2info, l2node, client := CreateTestL2(t, ctx)
 	defer l2node.StopAndWait()
 
 	l2info.GenerateAccount("User2")

From 1b76e9e7188dd9653a1fa45432a00388511d42f4 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 25 Oct 2023 16:39:29 +0530
Subject: [PATCH 11/19] Changes based on PR comments

---
 contracts                            |  2 +-
 system_tests/block_validator_test.go | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/contracts b/contracts
index b16bf0b737..c3031ba6cc 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit b16bf0b737468382854dac28346fec8b65b55989
+Subproject commit c3031ba6cc39c70aad7ac8165b4a89f81ebae98c
diff --git a/system_tests/block_validator_test.go b/system_tests/block_validator_test.go
index 816f0bd73a..f2fd888dcb 100644
--- a/system_tests/block_validator_test.go
+++ b/system_tests/block_validator_test.go
@@ -127,6 +127,10 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 		_, _, simple, err = mocksgen.DeploySimple(&auth, l2client)
 		Require(t, err, "could not deploy contract")
 
+		tx, err := simple.StoreDifficulty(&auth)
+		Require(t, err)
+		_, err = EnsureTxSucceeded(ctx, l2client, tx)
+		Require(t, err)
 		difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 		Require(t, err)
 		if !arbmath.BigEquals(difficulty, common.Big1) {
@@ -135,7 +139,7 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 		// make auth a chain owner
 		arbDebug, err := precompilesgen.NewArbDebug(common.HexToAddress("0xff"), l2client)
 		Require(t, err)
-		tx, err := arbDebug.BecomeChainOwner(&auth)
+		tx, err = arbDebug.BecomeChainOwner(&auth)
 		Require(t, err)
 		_, err = EnsureTxSucceeded(ctx, l2client, tx)
 		Require(t, err)
@@ -146,6 +150,10 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 		_, err = EnsureTxSucceeded(ctx, l2client, tx)
 		Require(t, err)
 
+		tx, err = simple.StoreDifficulty(&auth)
+		Require(t, err)
+		_, err = EnsureTxSucceeded(ctx, l2client, tx)
+		Require(t, err)
 		difficulty, err = simple.GetBlockDifficulty(&bind.CallOpts{})
 		Require(t, err)
 		if !arbmath.BigEquals(difficulty, common.Big1) {
@@ -187,13 +195,6 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 			Fatal(t, "Unexpected balance:", l2balance)
 		}
 	}
-	if workload == upgradeArbOs {
-		difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
-		Require(t, err)
-		if !arbmath.BigEquals(difficulty, common.Big1) {
-			Fatal(t, "Expected difficulty to be 1 but got:", difficulty)
-		}
-	}
 
 	lastBlock, err := l2clientB.BlockByNumber(ctx, nil)
 	Require(t, err)

From b0c0db9be5be43d429f155a99bee63a8fb66608d Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 25 Oct 2023 17:03:31 +0530
Subject: [PATCH 12/19] update contract

---
 contracts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contracts b/contracts
index c3031ba6cc..e9b869d42f 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit c3031ba6cc39c70aad7ac8165b4a89f81ebae98c
+Subproject commit e9b869d42f1551a43f1aae540463e8b2cd05b0b1

From 9067c64d0bbb08f2f6fcb8cf33996e7e8ff852a0 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 25 Oct 2023 17:23:46 +0530
Subject: [PATCH 13/19] minor fix

---
 system_tests/estimation_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 00803d204c..6f741901d7 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -154,7 +154,7 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 
 	chainConfig := params.ArbitrumDevTestChainConfig()
 	chainConfig.ArbitrumChainParams.InitialArbOSVersion = 10
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), true, chainConfig)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), nil, true, chainConfig)
 	defer node.StopAndWait()
 
 	auth := l2info.GetDefaultTransactOpts("Owner", ctx)

From 35b4bcf8eaf63356361a9bdc00013c829e072c72 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 25 Oct 2023 17:27:26 +0530
Subject: [PATCH 14/19] update contract

---
 contracts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contracts b/contracts
index e9b869d42f..c3d98acd24 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit e9b869d42f1551a43f1aae540463e8b2cd05b0b1
+Subproject commit c3d98acd24279d88ca51367fe9ba77fb2b1cd074

From 17ce3cc9bfa771963a61d220a3f0a19d85a486f5 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 25 Oct 2023 17:32:02 +0530
Subject: [PATCH 15/19] update contract

---
 contracts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contracts b/contracts
index c3d98acd24..e9b869d42f 160000
--- a/contracts
+++ b/contracts
@@ -1 +1 @@
-Subproject commit c3d98acd24279d88ca51367fe9ba77fb2b1cd074
+Subproject commit e9b869d42f1551a43f1aae540463e8b2cd05b0b1

From 46287a1be3d942c53204800e7c981a856c8cf53b Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Wed, 25 Oct 2023 19:05:46 +0530
Subject: [PATCH 16/19] minor fix

---
 system_tests/estimation_test.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 6f741901d7..441c99bca0 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -141,6 +141,10 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 	_, _, simple, err := mocksgen.DeploySimple(&auth, client)
 	Require(t, err, "could not deploy contract")
 
+	tx, err := simple.StoreDifficulty(&auth)
+	Require(t, err)
+	_, err = EnsureTxSucceeded(ctx, client, tx)
+	Require(t, err)
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
 	if !arbmath.BigEquals(difficulty, common.Big1) {
@@ -163,6 +167,10 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 	_, _, simple, err := mocksgen.DeploySimple(&auth, client)
 	Require(t, err, "could not deploy contract")
 
+	tx, err := simple.StoreDifficulty(&auth)
+	Require(t, err)
+	_, err = EnsureTxSucceeded(ctx, client, tx)
+	Require(t, err)
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
 	if !arbmath.BigEquals(difficulty, common.Big1) {

From b5383bd6c8945da431fc71e4cd934e34e2b98f1b Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Thu, 26 Oct 2023 19:29:54 +0530
Subject: [PATCH 17/19] changes based on pr comments

---
 execution/gethexec/node.go           |  3 ++-
 system_tests/common_test.go          | 13 ++++++-------
 system_tests/contract_tx_test.go     |  2 +-
 system_tests/estimation_test.go      | 26 +++++++++++++-------------
 system_tests/infra_fee_test.go       |  2 +-
 system_tests/initialization_test.go  |  2 +-
 system_tests/seq_coordinator_test.go |  2 +-
 system_tests/seq_nonce_test.go       |  6 +++---
 system_tests/seq_reject_test.go      |  4 ++--
 system_tests/seq_whitelist_test.go   |  2 +-
 system_tests/seqfeed_test.go         |  8 ++++----
 11 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/execution/gethexec/node.go b/execution/gethexec/node.go
index 5a99d59c5a..7eb9b13149 100644
--- a/execution/gethexec/node.go
+++ b/execution/gethexec/node.go
@@ -7,6 +7,7 @@ import (
 	"reflect"
 	"sync/atomic"
 	"testing"
+	"time"
 
 	"github.com/ethereum/go-ethereum/arbitrum"
 	"github.com/ethereum/go-ethereum/common"
@@ -99,7 +100,7 @@ var ConfigDefault = Config{
 
 func ConfigDefaultNonSequencerTest() *Config {
 	config := ConfigDefault
-	config.ParentChainReader = headerreader.Config{}
+	config.ParentChainReader = headerreader.Config{OldHeaderTimeout: 5 * time.Minute}
 	config.Sequencer.Enable = false
 	config.Forwarder = DefaultTestForwarderConfig
 	config.ForwardingTarget = "null"
diff --git a/system_tests/common_test.go b/system_tests/common_test.go
index 21b8aa8961..d233631d4c 100644
--- a/system_tests/common_test.go
+++ b/system_tests/common_test.go
@@ -171,7 +171,7 @@ func (b *NodeBuilder) Build(t *testing.T) func() {
 	} else {
 		l2 := NewTestClient(b.ctx)
 		b.L2Info, l2.ConsensusNode, l2.Client =
-			CreateTestL2WithConfig(t, b.ctx, b.L2Info, b.nodeConfig, b.execConfig, b.takeOwnership, b.chainConfig)
+			CreateTestL2WithConfig(t, b.ctx, b.L2Info, b.nodeConfig, b.execConfig, b.takeOwnership)
 		b.L2 = l2
 	}
 	b.L2.ExecNode = getExecNode(t, b.L2.ConsensusNode)
@@ -797,11 +797,11 @@ func createTestNodeOnL1WithConfigImpl(
 // L2 -Only. Enough for tests that needs no interface to L1
 // Requires precompiles.AllowDebugPrecompiles = true
 func CreateTestL2(t *testing.T, ctx context.Context) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
-	return CreateTestL2WithConfig(t, ctx, nil, nil, nil, true, nil)
+	return CreateTestL2WithConfig(t, ctx, nil, nil, nil, true)
 }
 
 func CreateTestL2WithConfig(
-	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, execConfig *gethexec.Config, takeOwnership bool, chainConfig *params.ChainConfig,
+	t *testing.T, ctx context.Context, l2Info *BlockchainTestInfo, nodeConfig *arbnode.Config, execConfig *gethexec.Config, takeOwnership bool,
 ) (*BlockchainTestInfo, *arbnode.Node, *ethclient.Client) {
 	if nodeConfig == nil {
 		nodeConfig = arbnode.ConfigDefaultL2Test()
@@ -809,14 +809,12 @@ func CreateTestL2WithConfig(
 	if execConfig == nil {
 		execConfig = gethexec.ConfigDefaultTest()
 	}
-	if chainConfig == nil {
-		chainConfig = params.ArbitrumDevTestChainConfig()
-	}
+
 	feedErrChan := make(chan error, 10)
 
 	AddDefaultValNode(t, ctx, nodeConfig, true)
 
-	l2info, stack, chainDb, arbDb, blockchain := createL2BlockChain(t, l2Info, "", chainConfig, &execConfig.Caching)
+	l2info, stack, chainDb, arbDb, blockchain := createL2BlockChain(t, l2Info, "", params.ArbitrumDevTestChainConfig(), &execConfig.Caching)
 
 	Require(t, execConfig.Validate())
 	execConfigFetcher := func() *gethexec.Config { return execConfig }
@@ -825,6 +823,7 @@ func CreateTestL2WithConfig(
 
 	currentNode, err := arbnode.CreateNode(ctx, stack, execNode, arbDb, NewFetcherFromConfig(nodeConfig), blockchain.Config(), nil, nil, nil, nil, nil, feedErrChan)
 	Require(t, err)
+
 	// Give the node an init message
 	err = currentNode.TxStreamer.AddFakeInitMessage()
 	Require(t, err)
diff --git a/system_tests/contract_tx_test.go b/system_tests/contract_tx_test.go
index b35be36141..d6c2eb5f38 100644
--- a/system_tests/contract_tx_test.go
+++ b/system_tests/contract_tx_test.go
@@ -25,7 +25,7 @@ func TestContractTxDeploy(t *testing.T) {
 	t.Parallel()
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, nil, false, nil)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, nil, false)
 	defer node.StopAndWait()
 
 	from := common.HexToAddress("0x123412341234")
diff --git a/system_tests/estimation_test.go b/system_tests/estimation_test.go
index 441c99bca0..13f4e1f933 100644
--- a/system_tests/estimation_test.go
+++ b/system_tests/estimation_test.go
@@ -5,7 +5,6 @@ package arbtest
 
 import (
 	"context"
-	"github.com/offchainlabs/nitro/arbnode"
 	"math/big"
 	"testing"
 
@@ -132,18 +131,19 @@ func TestDifficultyForLatestArbOS(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2(t, ctx)
-	defer node.StopAndWait()
+	builder := NewNodeBuilder(ctx).DefaultConfig(t, false)
+	cleanup := builder.Build(t)
+	defer cleanup()
 
-	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
+	auth := builder.L2Info.GetDefaultTransactOpts("Owner", ctx)
 
 	// deploy a test contract
-	_, _, simple, err := mocksgen.DeploySimple(&auth, client)
+	_, _, simple, err := mocksgen.DeploySimple(&auth, builder.L2.Client)
 	Require(t, err, "could not deploy contract")
 
 	tx, err := simple.StoreDifficulty(&auth)
 	Require(t, err)
-	_, err = EnsureTxSucceeded(ctx, client, tx)
+	_, err = EnsureTxSucceeded(ctx, builder.L2.Client, tx)
 	Require(t, err)
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
@@ -156,20 +156,20 @@ func TestDifficultyForArbOSTen(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	chainConfig := params.ArbitrumDevTestChainConfig()
-	chainConfig.ArbitrumChainParams.InitialArbOSVersion = 10
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, arbnode.ConfigDefaultL2Test(), nil, true, chainConfig)
-	defer node.StopAndWait()
+	builder := NewNodeBuilder(ctx).DefaultConfig(t, false)
+	builder.chainConfig.ArbitrumChainParams.InitialArbOSVersion = 10
+	cleanup := builder.Build(t)
+	defer cleanup()
 
-	auth := l2info.GetDefaultTransactOpts("Owner", ctx)
+	auth := builder.L2Info.GetDefaultTransactOpts("Owner", ctx)
 
 	// deploy a test contract
-	_, _, simple, err := mocksgen.DeploySimple(&auth, client)
+	_, _, simple, err := mocksgen.DeploySimple(&auth, builder.L2.Client)
 	Require(t, err, "could not deploy contract")
 
 	tx, err := simple.StoreDifficulty(&auth)
 	Require(t, err)
-	_, err = EnsureTxSucceeded(ctx, client, tx)
+	_, err = EnsureTxSucceeded(ctx, builder.L2.Client, tx)
 	Require(t, err)
 	difficulty, err := simple.GetBlockDifficulty(&bind.CallOpts{})
 	Require(t, err)
diff --git a/system_tests/infra_fee_test.go b/system_tests/infra_fee_test.go
index ee9671914b..a56e054563 100644
--- a/system_tests/infra_fee_test.go
+++ b/system_tests/infra_fee_test.go
@@ -23,7 +23,7 @@ func TestInfraFee(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, nil, true, nil)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, nil, true)
 	defer node.StopAndWait()
 
 	l2info.GenerateAccount("User2")
diff --git a/system_tests/initialization_test.go b/system_tests/initialization_test.go
index dc01aeba43..0e055adc5f 100644
--- a/system_tests/initialization_test.go
+++ b/system_tests/initialization_test.go
@@ -62,7 +62,7 @@ func TestInitContract(t *testing.T) {
 		l2info.ArbInitData.Accounts = append(l2info.ArbInitData.Accounts, accountInfo)
 		expectedSums[accountAddress] = sum
 	}
-	_, node, client := CreateTestL2WithConfig(t, ctx, l2info, nil, nil, true, nil)
+	_, node, client := CreateTestL2WithConfig(t, ctx, l2info, nil, nil, true)
 	defer node.StopAndWait()
 
 	for accountAddress, sum := range expectedSums {
diff --git a/system_tests/seq_coordinator_test.go b/system_tests/seq_coordinator_test.go
index 37905fc18a..a213c366cf 100644
--- a/system_tests/seq_coordinator_test.go
+++ b/system_tests/seq_coordinator_test.go
@@ -63,7 +63,7 @@ func TestRedisSeqCoordinatorPriorities(t *testing.T) {
 
 	createStartNode := func(nodeNum int) {
 		nodeConfig.SeqCoordinator.MyUrl = nodeNames[nodeNum]
-		_, node, _ := CreateTestL2WithConfig(t, ctx, l2Info, nodeConfig, nil, false, nil)
+		_, node, _ := CreateTestL2WithConfig(t, ctx, l2Info, nodeConfig, nil, false)
 		nodes[nodeNum] = node
 	}
 
diff --git a/system_tests/seq_nonce_test.go b/system_tests/seq_nonce_test.go
index 2856e2946d..d70f47a146 100644
--- a/system_tests/seq_nonce_test.go
+++ b/system_tests/seq_nonce_test.go
@@ -26,7 +26,7 @@ func TestSequencerParallelNonces(t *testing.T) {
 
 	config := gethexec.ConfigDefaultTest()
 	config.Sequencer.NonceFailureCacheExpiry = time.Minute
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, false, nil)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, false)
 	defer node.StopAndWait()
 
 	l2info.GenerateAccount("Destination")
@@ -63,7 +63,7 @@ func TestSequencerNonceTooHigh(t *testing.T) {
 	defer cancel()
 
 	config := gethexec.ConfigDefaultTest()
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, false, nil)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, false)
 	defer node.StopAndWait()
 
 	l2info.GetInfoWithPrivKey("Owner").Nonce++
@@ -91,7 +91,7 @@ func TestSequencerNonceTooHighQueueFull(t *testing.T) {
 	config := gethexec.ConfigDefaultTest()
 	config.Sequencer.NonceFailureCacheSize = 5
 	config.Sequencer.NonceFailureCacheExpiry = time.Minute
-	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, false, nil)
+	l2info, node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, false)
 	defer node.StopAndWait()
 
 	count := 15
diff --git a/system_tests/seq_reject_test.go b/system_tests/seq_reject_test.go
index c067a66bce..34a14c660e 100644
--- a/system_tests/seq_reject_test.go
+++ b/system_tests/seq_reject_test.go
@@ -31,14 +31,14 @@ func TestSequencerRejection(t *testing.T) {
 	seqNodeConfig := arbnode.ConfigDefaultL2Test()
 	seqNodeConfig.Feed.Output = *newBroadcasterConfigTest()
 	feedErrChan := make(chan error, 10)
-	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, nil, true, nil)
+	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, nil, true)
 	defer nodeA.StopAndWait()
 
 	clientNodeConfig := arbnode.ConfigDefaultL2Test()
 	port := nodeA.BroadcastServer.ListenerAddr().(*net.TCPAddr).Port
 	clientNodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
 
-	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, nil, false, nil)
+	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, nil, false)
 	defer nodeB.StopAndWait()
 
 	auth := l2info1.GetDefaultTransactOpts("Owner", ctx)
diff --git a/system_tests/seq_whitelist_test.go b/system_tests/seq_whitelist_test.go
index b7d85c63ce..36e309a5d7 100644
--- a/system_tests/seq_whitelist_test.go
+++ b/system_tests/seq_whitelist_test.go
@@ -18,7 +18,7 @@ func TestSequencerWhitelist(t *testing.T) {
 
 	config := gethexec.ConfigDefaultTest()
 	config.Sequencer.SenderWhitelist = GetTestAddressForAccountName(t, "Owner").String() + "," + GetTestAddressForAccountName(t, "User").String()
-	l2info, l2node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, true, nil)
+	l2info, l2node, client := CreateTestL2WithConfig(t, ctx, nil, nil, config, true)
 	defer l2node.StopAndWait()
 
 	l2info.GenerateAccount("User")
diff --git a/system_tests/seqfeed_test.go b/system_tests/seqfeed_test.go
index 2a53cd8589..d0d05d569e 100644
--- a/system_tests/seqfeed_test.go
+++ b/system_tests/seqfeed_test.go
@@ -45,13 +45,13 @@ func TestSequencerFeed(t *testing.T) {
 
 	seqNodeConfig := arbnode.ConfigDefaultL2Test()
 	seqNodeConfig.Feed.Output = *newBroadcasterConfigTest()
-	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, nil, true, nil)
+	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, nil, true)
 	defer nodeA.StopAndWait()
 	clientNodeConfig := arbnode.ConfigDefaultL2Test()
 	port := nodeA.BroadcastServer.ListenerAddr().(*net.TCPAddr).Port
 	clientNodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
 
-	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, nil, false, nil)
+	_, nodeB, client2 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, nil, false)
 	defer nodeB.StopAndWait()
 
 	l2info1.GenerateAccount("User2")
@@ -80,7 +80,7 @@ func TestRelayedSequencerFeed(t *testing.T) {
 
 	seqNodeConfig := arbnode.ConfigDefaultL2Test()
 	seqNodeConfig.Feed.Output = *newBroadcasterConfigTest()
-	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, nil, true, nil)
+	l2info1, nodeA, client1 := CreateTestL2WithConfig(t, ctx, nil, seqNodeConfig, nil, true)
 	defer nodeA.StopAndWait()
 
 	bigChainId, err := client1.ChainID(ctx)
@@ -102,7 +102,7 @@ func TestRelayedSequencerFeed(t *testing.T) {
 	clientNodeConfig := arbnode.ConfigDefaultL2Test()
 	port = currentRelay.GetListenerAddr().(*net.TCPAddr).Port
 	clientNodeConfig.Feed.Input = *newBroadcastClientConfigTest(port)
-	_, nodeC, client3 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, nil, false, nil)
+	_, nodeC, client3 := CreateTestL2WithConfig(t, ctx, nil, clientNodeConfig, nil, false)
 	defer nodeC.StopAndWait()
 	StartWatchChanErr(t, ctx, feedErrChan, nodeC)
 

From ba0de156d74168800ccfde059802bd2f2a8e35cb Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Thu, 26 Oct 2023 20:05:19 +0530
Subject: [PATCH 18/19] update block validator test

---
 system_tests/block_validator_test.go | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/system_tests/block_validator_test.go b/system_tests/block_validator_test.go
index 61a2738b94..0be794edfc 100644
--- a/system_tests/block_validator_test.go
+++ b/system_tests/block_validator_test.go
@@ -54,10 +54,13 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 		delayEvery = workloadLoops / 3
 	}
 
-	l2info, nodeA, l2client, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfig(t, ctx, true, l1NodeConfigA, nil, chainConfig, nil)
-	defer requireClose(t, l1stack)
-	defer nodeA.StopAndWait()
-
+	builder := NewNodeBuilder(ctx).DefaultConfig(t, true)
+	builder.chainConfig = chainConfig
+	builder.nodeConfig = l1NodeConfigA
+	builder.L2Info = NewArbTestInfo(t, chainConfig.ChainID)
+	cleanup := builder.Build(t)
+	defer cleanup()
+	l2info, l2client, l1info, l1client := builder.L2Info, builder.L2.Client, builder.L1Info, builder.L1.Client
 	authorizeDASKeyset(t, ctx, dasSignerKey, l1info, l1client)
 
 	validatorConfig := arbnode.ConfigDefaultL1NonSequencerTest()
@@ -65,8 +68,9 @@ func testBlockValidatorSimple(t *testing.T, dasModeString string, workloadLoops
 	validatorConfig.DataAvailability = l1NodeConfigA.DataAvailability
 	validatorConfig.DataAvailability.RPCAggregator.Enable = false
 	AddDefaultValNode(t, ctx, validatorConfig, !arbitrator)
-	l2clientB, nodeB := Create2ndNodeWithConfig(t, ctx, nodeA, l1stack, l1info, &l2info.ArbInitData, validatorConfig, nil, nil)
-	defer nodeB.StopAndWait()
+	l2B, cleanup2nd := builder.Build2ndNode(t, &SecondNodeParams{nodeConfig: validatorConfig})
+	defer cleanup2nd()
+	l2clientB, nodeB := l2B.Client, l2B.ConsensusNode
 	l2info.GenerateAccount("User2")
 
 	perTransfer := big.NewInt(1e12)

From 5a478894297eb437bd9d4d75ab60657af47a90d0 Mon Sep 17 00:00:00 2001
From: amsanghi <asanghi@offchainlabs.com>
Date: Tue, 28 Nov 2023 22:59:33 +0530
Subject: [PATCH 19/19] minor fix

---
 execution/gethexec/node.go | 2 --
 1 file changed, 2 deletions(-)

diff --git a/execution/gethexec/node.go b/execution/gethexec/node.go
index 8e640ea6c8..7dd6e301fe 100644
--- a/execution/gethexec/node.go
+++ b/execution/gethexec/node.go
@@ -7,7 +7,6 @@ import (
 	"reflect"
 	"sync/atomic"
 	"testing"
-	"time"
 
 	"github.com/ethereum/go-ethereum/arbitrum"
 	"github.com/ethereum/go-ethereum/common"
@@ -103,7 +102,6 @@ var ConfigDefault = Config{
 
 func ConfigDefaultNonSequencerTest() *Config {
 	config := ConfigDefault
-	config.ParentChainReader = headerreader.Config{OldHeaderTimeout: 5 * time.Minute}
 	config.ParentChainReader = headerreader.TestConfig
 	config.Sequencer.Enable = false
 	config.Forwarder = DefaultTestForwarderConfig