diff --git a/build/ci.go b/build/ci.go index 627549a722d..e8b7013edd7 100644 --- a/build/ci.go +++ b/build/ci.go @@ -62,6 +62,7 @@ import ( "github.com/ethereum/go-ethereum/eth/tracers" "github.com/ethereum/go-ethereum/internal/build" "github.com/ethereum/go-ethereum/internal/version" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/consensus/beacon/consensus.go b/consensus/beacon/consensus.go index 73552a6cacf..87a360ce8ed 100644 --- a/consensus/beacon/consensus.go +++ b/consensus/beacon/consensus.go @@ -512,5 +512,9 @@ func IsTTDReached(chain consensus.ChainHeaderReader, parentHash common.Hash, par if td == nil { return false, consensus.ErrUnknownAncestor } + ttd := chain.Config().TerminalTotalDifficulty + if ttd == nil { + return false, nil + } return td.Cmp(chain.Config().TerminalTotalDifficulty) >= 0, nil } diff --git a/consensus/bor/statefull/processor.go b/consensus/bor/statefull/processor.go index 79d7e0bc391..fe3a864bd70 100644 --- a/consensus/bor/statefull/processor.go +++ b/consensus/bor/statefull/processor.go @@ -77,7 +77,6 @@ func ApplyMessage( chainContext core.ChainContext, tracer *tracing.Hooks, ) (uint64, error) { - tx := types.NewTx(&types.LegacyTx{ Nonce: msg.Nonce(), GasPrice: msg.GasPrice(), diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index ba05ddf8e70..ab4f3484509 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -21,7 +21,6 @@ import ( "bytes" "errors" "fmt" - "github.com/ethereum/go-ethereum/core/tracing" "io" "math/big" "math/rand" @@ -36,6 +35,7 @@ import ( "github.com/ethereum/go-ethereum/consensus/misc" "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" diff --git a/consensus/consensus.go b/consensus/consensus.go index d418ff85240..df6f27b172f 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -18,11 +18,11 @@ package consensus import ( - "github.com/ethereum/go-ethereum/core/tracing" "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" diff --git a/core/state/journal.go b/core/state/journal.go index 23a09bbee56..4f2417fda80 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -153,6 +153,7 @@ func (j *journal) logChange(txHash common.Hash) { j.append(addLogChange{txhash: txHash}) } +// nolint:unused func (j *journal) createObject(addr common.Address) { j.append(createObjectChange{account: addr}) } diff --git a/eth/tracers/firehose.go b/eth/tracers/firehose.go index 99e3154fe6e..2eb1b6639ed 100644 --- a/eth/tracers/firehose.go +++ b/eth/tracers/firehose.go @@ -540,7 +540,6 @@ func (f *Firehose) OnBlockEnd(err error) { } else { f.printBlockToFirehose(f.block, f.blockFinality) } - } else { // An error occurred, could have happen in transaction/call context, we must not check if in trx/call, only check in block f.ensureInBlock(0) @@ -2360,7 +2359,6 @@ func maxFeePerGas(tx *types.Transaction) *pbeth.BigInt { case types.DynamicFeeTxType, types.BlobTxType, types.SetCodeTxType: return firehoseBigIntFromNative(tx.GasFeeCap()) - } panic(errUnhandledTransactionType("maxFeePerGas", tx.Type())) @@ -2374,7 +2372,6 @@ func maxPriorityFeePerGas(tx *types.Transaction) *pbeth.BigInt { case types.DynamicFeeTxType, types.BlobTxType, types.SetCodeTxType: return firehoseBigIntFromNative(tx.GasTipCap()) } - panic(errUnhandledTransactionType("maxPriorityFeePerGas", tx.Type())) } diff --git a/eth/tracers/firehose_concurrency.go b/eth/tracers/firehose_concurrency.go index 6059df7bcde..c6954368d16 100644 --- a/eth/tracers/firehose_concurrency.go +++ b/eth/tracers/firehose_concurrency.go @@ -1,8 +1,9 @@ package tracers import ( - pbeth "github.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2" "sync" + + pbeth "github.com/streamingfast/firehose-ethereum/types/pb/sf/ethereum/type/v2" ) type blockPrintJob struct { diff --git a/eth/tracers/firehose_concurrency_test.go b/eth/tracers/firehose_concurrency_test.go index 7ccc808a19e..ccfd921b45c 100644 --- a/eth/tracers/firehose_concurrency_test.go +++ b/eth/tracers/firehose_concurrency_test.go @@ -3,17 +3,17 @@ package tracers import ( "encoding/hex" "fmt" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" - "github.com/stretchr/testify/require" "regexp" "strconv" "strings" "testing" + + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" ) func TestFirehose_BlockPrintsToFirehose_SingleBlock(t *testing.T) { - f := NewFirehose(&FirehoseConfig{ ConcurrentBlockFlushing: 1, ApplyBackwardCompatibility: ptr(false), @@ -56,7 +56,6 @@ func TestFirehose_BlockPrintsToFirehose_SingleBlock(t *testing.T) { } func TestFirehose_BlocksPrintToFirehose_MultipleBlocksInOrder(t *testing.T) { - const blockCount = 100 const baseBlockNum = 0 diff --git a/eth/tracers/firehose_test.go b/eth/tracers/firehose_test.go index eeff3d333e3..73b836b5b59 100644 --- a/eth/tracers/firehose_test.go +++ b/eth/tracers/firehose_test.go @@ -37,7 +37,8 @@ func TestFirehoseCallStack_Push(t *testing.T) { actions []actionRunner }{ { - "push/pop emtpy", []actionRunner{ + "push/pop empty", + []actionRunner{ push(&pbeth.Call{}), pop(), check(func(t *testing.T, s *CallStack) { @@ -46,7 +47,8 @@ func TestFirehoseCallStack_Push(t *testing.T) { }, }, { - "push/push/push", []actionRunner{ + "push/push/push", + []actionRunner{ push(&pbeth.Call{}), push(&pbeth.Call{}), push(&pbeth.Call{}), @@ -193,7 +195,6 @@ func Test_FirehoseAndGethHeaderFieldMatches(t *testing.T) { var endsWithUnknownConstant = regexp.MustCompile(`.*\(\d+\)$`) func TestFirehose_BalanceChangeAllMappedCorrectly(t *testing.T) { - for i := 0; i <= math.MaxUint8; i++ { tracingReason := tracing.BalanceChangeReason(i) if tracingReason == tracing.BalanceChangeUnspecified || tracingReason == tracing.BalanceChangeRevert { @@ -405,7 +406,7 @@ func TestFirehose_reorderIsolatedTransactionsAndOrdinals(t *testing.T) { goldenPath := tt.expectedBlockFile if !goldenUpdate && !fileExits(t, goldenPath) { - t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the intial version", goldenPath, t.Name()) + t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the initial version", goldenPath, t.Name()) } content, err := protojson.MarshalOptions{Indent: " "}.Marshal(f.block) diff --git a/eth/tracers/internal/tracetest/firehose/helpers_test.go b/eth/tracers/internal/tracetest/firehose/helpers_test.go index f19dad3cd53..ca055ea23fc 100644 --- a/eth/tracers/internal/tracetest/firehose/helpers_test.go +++ b/eth/tracers/internal/tracetest/firehose/helpers_test.go @@ -56,6 +56,7 @@ func newFirehoseTestTracer(t *testing.T, model tracingModel, config *tracers.Fir } } +// nolint:unused func (lines firehoseBlockLines) assertEquals(t *testing.T, goldenDir string, expected ...firehoseBlockLineParams) { actualParams := slicesMap(lines, func(l firehoseBlockLine) firehoseBlockLineParams { return l.Params }) require.Equal(t, expected, actualParams, "Actual lines block params do not match expected lines block params") @@ -72,7 +73,7 @@ func (lines firehoseBlockLines) assertOnlyBlockEquals(t *testing.T, goldenDir st for _, line := range lines { goldenPath := filepath.Join(goldenDir, fmt.Sprintf("block.%d.golden.json", line.Block.Header.Number)) if !goldenUpdate && !fileExists(t, goldenPath) { - t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the intial version", goldenPath, t.Name()) + t.Fatalf("the golden file %q does not exist, re-run with 'GOLDEN_UPDATE=true go test ./... -run %q' to generate the initial version", goldenPath, t.Name()) } unnormalizedContent, err := protojson.MarshalOptions{Indent: " "}.Marshal(line.Block) diff --git a/go.mod b/go.mod index c7931c38336..45a0bbb32b4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ethereum/go-ethereum -go 1.23.6 +go 1.23.8 require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 diff --git a/tests/bor/helper.go b/tests/bor/helper.go index 6305da744f1..9c46e3580d7 100644 --- a/tests/bor/helper.go +++ b/tests/bor/helper.go @@ -287,7 +287,7 @@ func buildNextBlock(t *testing.T, _bor consensus.Engine, chain *core.BlockChain, // Finalize and seal the block block, err := _bor.FinalizeAndAssemble(chain, b.header, state, &types.Body{ Transactions: b.txs, - }, b.receipts) + }, b.receipts, nil) if err != nil { panic(fmt.Sprintf("error finalizing block: %v", err)) }