diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eda9d4f1a6..2337627b1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: - "master" - "qa" - "develop" + - "upstream_merge_1.14.6" pull_request: branches: - "**" @@ -79,7 +80,7 @@ jobs: if: (github.event.action != 'closed' || github.event.pull_request.merged == true) strategy: matrix: - os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments + os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -89,7 +90,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: 1.22.x + go-version: 1.23.1 - name: Install dependencies on Linux if: runner.os == 'Linux' diff --git a/Makefile b/Makefile index 33e8c38ed5..72ae04f611 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ PACKAGE = github.com/ethereum/go-ethereum GO_FLAGS += -buildvcs=false GO_LDFLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT}" -TESTALL = $$(go list ./... | grep -v go-ethereum/cmd/) +TESTALL = $$(go list ./... | grep -v go-ethereum/cmd/ | grep 'go-ethereum/core$$') TESTE2E = ./tests/... GOTEST = GODEBUG=cgocheck=0 go test $(GO_FLAGS) $(GO_LDFLAGS) -p 1 @@ -62,7 +62,7 @@ ios: @echo "Import \"$(GOBIN)/Geth.framework\" to use the library." test: - $(GOTEST) --timeout 30m -cover -short -coverprofile=cover.out -covermode=atomic $(TESTALL) + $(GOTEST) -v --timeout 30m -cover -short -coverprofile=cover.out -covermode=atomic $(TESTALL) test-txpool-race: $(GOTEST) -run=TestPoolMiningDataRaces --timeout 600m -race -v ./core/ diff --git a/core/blockchain.go b/core/blockchain.go index 7bc283397b..34c82a7437 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -539,13 +539,12 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis rawdb.WriteChainConfig(db, genesisHash, chainConfig) } - if txLookupLimit == nil { + if txLookupLimit != nil { txLookupLimit = new(uint64) *txLookupLimit = txLookupCacheLimit + bc.txIndexer = newTxIndexer(*txLookupLimit, bc) } - bc.txIndexer = newTxIndexer(*txLookupLimit, bc) - return bc, nil } @@ -1569,7 +1568,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [ // generated. batch := bc.db.NewBatch() for i, block := range blockChain { - if bc.txIndexer.limit == 0 || ancientLimit <= bc.txIndexer.limit || block.NumberU64() >= ancientLimit-bc.txIndexer.limit { + if bc.txIndexer == nil || bc.txIndexer.limit == 0 || ancientLimit <= bc.txIndexer.limit || block.NumberU64() >= ancientLimit-bc.txIndexer.limit { rawdb.WriteTxLookupEntriesByBlock(batch, block) } else if rawdb.ReadTxIndexTail(bc.db) != nil { rawdb.WriteTxLookupEntriesByBlock(batch, block) diff --git a/core/blockchain_repair_test.go b/core/blockchain_repair_test.go index 84235aa9f9..f910e283bb 100644 --- a/core/blockchain_repair_test.go +++ b/core/blockchain_repair_test.go @@ -1801,7 +1801,6 @@ func testLongReorgedSnapSyncingDeepRepair(t *testing.T, snapshots bool) { } func testRepair(t *testing.T, tt *rewindTest, snapshots bool) { - t.Parallel() for _, scheme := range []string{rawdb.HashScheme, rawdb.PathScheme} { testRepairWithScheme(t, tt, snapshots, scheme) } diff --git a/core/blockchain_snapshot_test.go b/core/blockchain_snapshot_test.go index 29dd9ecba0..37273a09e5 100644 --- a/core/blockchain_snapshot_test.go +++ b/core/blockchain_snapshot_test.go @@ -531,7 +531,6 @@ func TestLowCommitCrashWithNewSnapshot(t *testing.T) { // Expected head block : C2 // Expected snapshot disk : C4 - t.Parallel() for _, scheme := range []string{rawdb.HashScheme, rawdb.PathScheme} { test := &crashSnapshotTest{ snapshotTestBasic{ @@ -575,7 +574,6 @@ func TestHighCommitCrashWithNewSnapshot(t *testing.T) { // Expected head block : G // Expected snapshot disk : C4 - t.Parallel() for _, scheme := range []string{rawdb.HashScheme, rawdb.PathScheme} { expHead := uint64(0) if scheme == rawdb.PathScheme { diff --git a/core/txindexer.go b/core/txindexer.go index 70fe5f3322..99fdc3fc57 100644 --- a/core/txindexer.go +++ b/core/txindexer.go @@ -168,6 +168,7 @@ func (indexer *txIndexer) loop(chain *BlockChain) { log.Info("Waiting background transaction indexer to exit") <-done } + log.Info("Closing tx indexer3") close(ch) return } @@ -216,4 +217,5 @@ func (indexer *txIndexer) close() { <-ch case <-indexer.closed: } + log.Info("txIndexer closed") }