From 188e8ff5e65c5f71d919077f26c22ab1d75779af Mon Sep 17 00:00:00 2001 From: alecps Date: Thu, 15 Aug 2024 21:06:03 -0400 Subject: [PATCH] more cleanup --- cmd/geth/main.go | 1 - core/blockchain.go | 3 +++ core/error.go | 3 --- e2e_test/e2e_test.go | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 9223538eac..531567eba6 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -327,7 +327,6 @@ func geth(ctx *cli.Context) error { prepare(ctx) stack, backend := makeFullNode(ctx) - defer stack.Close() startNode(ctx, stack, backend) diff --git a/core/blockchain.go b/core/blockchain.go index d8eab43d13..4f7aca4188 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -811,6 +811,9 @@ func (bc *BlockChain) ExportN(w io.Writer, first uint64, last uint64) error { // // Note, this function assumes that the `mu` mutex is held! func (bc *BlockChain) writeHeadBlock(block *types.Block) { + // Normally the check at the end of the function will pass first, but if a node is restarted + // with the same l2-migration-block configured after already reaching and stopping on l2-migration-block, + // this check will pass first and log an error. if bc.Config().IsL2Migration(block.Number()) { log.Error("Attempt to insert block number >= l2MigrationBlock, stopping block insertion", "block", block.NumberU64(), "hash", block.Hash()) bc.StopInsert() diff --git a/core/error.go b/core/error.go index 0f2d0a154e..f5515dd858 100644 --- a/core/error.go +++ b/core/error.go @@ -33,9 +33,6 @@ var ( ErrNoGenesis = errors.New("genesis not found in chain") errSideChainReceipts = errors.New("side blocks can't be accepted as ancient chain data") - - // ErrL2Migration is returned when the current block is greater than or equal to the L2 migration block - ErrL2Migration = errors.New("chain has migrated to L2, data exists beyond the configured migration block") ) // List of evm-call-message pre-checking errors. All state transition messages will diff --git a/e2e_test/e2e_test.go b/e2e_test/e2e_test.go index db89790d7b..6daad1d886 100644 --- a/e2e_test/e2e_test.go +++ b/e2e_test/e2e_test.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "math/big" - "os" "os/exec" "strings" "sync" @@ -35,10 +34,10 @@ func init() { // This statement is commented out but left here since its very useful for // debugging problems and its non trivial to construct. // - log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) + // log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) // This disables all logging which in general we want, because there is a lot - // log.Root().SetHandler(log.DiscardHandler()) + log.Root().SetHandler(log.DiscardHandler()) } // This test starts a network submits a transaction and waits for the whole