Skip to content

Commit 1ee4784

Browse files
committed
make lint happy and remove duplicate initReorg
Signed-off-by: Igor Braga <[email protected]>
1 parent 4c75922 commit 1ee4784

File tree

2 files changed

+2
-40
lines changed

2 files changed

+2
-40
lines changed

cmd/nitro/nitro.go

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ import (
3838
"github.com/ethereum/go-ethereum/graphql"
3939
"github.com/ethereum/go-ethereum/log"
4040
"github.com/ethereum/go-ethereum/node"
41-
"github.com/ethereum/go-ethereum/params"
4241

4342
"github.com/offchainlabs/nitro/arbnode"
4443
nitroversionalerter "github.com/offchainlabs/nitro/arbnode/nitro-version-alerter"
4544
"github.com/offchainlabs/nitro/arbnode/resourcemanager"
46-
"github.com/offchainlabs/nitro/arbutil"
4745
blocksreexecutor "github.com/offchainlabs/nitro/blocks_reexecutor"
4846
"github.com/offchainlabs/nitro/cmd/chaininfo"
4947
"github.com/offchainlabs/nitro/cmd/conf"
@@ -560,7 +558,7 @@ func mainImpl() int {
560558
stack,
561559
execNode,
562560
consensusDB,
563-
&config.ConsensusNodeConfigFetcher{liveNodeConfig},
561+
&config.ConsensusNodeConfigFetcher{LiveConfig: liveNodeConfig},
564562
l2BlockChain.Config(),
565563
l1Client,
566564
&rollupAddrs,
@@ -758,43 +756,6 @@ func mainImpl() int {
758756
return 0
759757
}
760758

761-
func initReorg(initConfig conf.InitConfig, chainConfig *params.ChainConfig, inboxTracker *arbnode.InboxTracker) error {
762-
var batchCount uint64
763-
if initConfig.ReorgToBatch >= 0 {
764-
// #nosec G115
765-
batchCount = uint64(initConfig.ReorgToBatch) + 1
766-
} else {
767-
var messageIndex arbutil.MessageIndex
768-
if initConfig.ReorgToMessageBatch >= 0 {
769-
// #nosec G115
770-
messageIndex = arbutil.MessageIndex(initConfig.ReorgToMessageBatch)
771-
} else if initConfig.ReorgToBlockBatch > 0 {
772-
genesis := chainConfig.ArbitrumChainParams.GenesisBlockNum
773-
// #nosec G115
774-
blockNum := uint64(initConfig.ReorgToBlockBatch)
775-
if blockNum < genesis {
776-
return fmt.Errorf("ReorgToBlockBatch %d before genesis %d", blockNum, genesis)
777-
}
778-
messageIndex = arbutil.MessageIndex(blockNum - genesis)
779-
} else {
780-
log.Warn("Tried to do init reorg, but no init reorg options specified")
781-
return nil
782-
}
783-
// Reorg out the batch containing the next message
784-
var found bool
785-
var err error
786-
batchCount, found, err = inboxTracker.FindInboxBatchContainingMessage(messageIndex + 1)
787-
if err != nil {
788-
return err
789-
}
790-
if !found {
791-
log.Warn("init-reorg: no need to reorg, because message ahead of chain", "messageIndex", messageIndex)
792-
return nil
793-
}
794-
}
795-
return inboxTracker.ReorgBatchesTo(batchCount)
796-
}
797-
798759
func checkWasmModuleRootCompatibility(ctx context.Context, wasmConfig valnode.WasmConfig, l1Client *ethclient.Client, rollupAddrs chaininfo.RollupAddresses) error {
799760
// Fetch current on-chain WASM module root
800761
rollupUserLogic, err := rollupgen.NewRollupUserLogic(rollupAddrs.Rollup, l1Client)

system_tests/genesis_assertion_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ func createL2NodeWithRollupAddresses(
315315
AddValNodeIfNeeded(t, ctx, nodeConfig, true, "", "")
316316

317317
parentChainId, err := l1client.ChainID(ctx)
318+
Require(t, err)
318319
execNode, err = gethexec.CreateExecutionNode(ctx, l2stack, l2executionDB, l2blockchain, l1client, NewCommonConfigFetcher(execConfig), parentChainId, 0)
319320
Require(t, err)
320321

0 commit comments

Comments
 (0)