From 20ad4f500e7fafab93f6d94fa171a5c0309de6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Thu, 22 May 2025 11:30:20 +0200 Subject: [PATCH 01/11] core/txpool: add explicit max blob count limit (#31837) Fixes #31792. --------- Co-authored-by: lightclient --- core/txpool/blobpool/blobpool.go | 15 +++++-- core/txpool/blobpool/blobpool_test.go | 59 +++++++++++++++++++++++++++ core/txpool/errors.go | 4 ++ core/txpool/validation.go | 10 +++-- 4 files changed, 81 insertions(+), 7 deletions(-) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index e506da228d..2602d82104 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -62,6 +62,12 @@ const ( // limit can never hurt. txMaxSize = 1024 * 1024 + // maxBlobsPerTx is the maximum number of blobs that a single transaction can + // carry. We choose a smaller limit than the protocol-permitted MaxBlobsPerBlock + // in order to ensure network and txpool stability. + // Note: if you increase this, validation will fail on txMaxSize. + maxBlobsPerTx = 7 + // maxTxsPerAccount is the maximum number of blob transactions admitted from // a single account. The limit is enforced to minimize the DoS potential of // a private tx cancelling publicly propagated blobs. @@ -1095,10 +1101,11 @@ func (p *BlobPool) SetGasTip(tip *big.Int) { // and does not require the pool mutex to be held. func (p *BlobPool) ValidateTxBasics(tx *types.Transaction) error { opts := &txpool.ValidationOptions{ - Config: p.chain.Config(), - Accept: 1 << types.BlobTxType, - MaxSize: txMaxSize, - MinTip: p.gasTip.ToBig(), + Config: p.chain.Config(), + Accept: 1 << types.BlobTxType, + MaxSize: txMaxSize, + MinTip: p.gasTip.ToBig(), + MaxBlobCount: maxBlobsPerTx, } return txpool.ValidateTransaction(tx, p.head, p.signer, opts) } diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index 0a323179a6..12b64bf674 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -1142,6 +1142,65 @@ func TestChangingSlotterSize(t *testing.T) { } } +// TestBlobCountLimit tests the blobpool enforced limits on the max blob count. +func TestBlobCountLimit(t *testing.T) { + var ( + key1, _ = crypto.GenerateKey() + key2, _ = crypto.GenerateKey() + + addr1 = crypto.PubkeyToAddress(key1.PublicKey) + addr2 = crypto.PubkeyToAddress(key2.PublicKey) + ) + + statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting()) + statedb.AddBalance(addr1, uint256.NewInt(1_000_000_000), tracing.BalanceChangeUnspecified) + statedb.AddBalance(addr2, uint256.NewInt(1_000_000_000), tracing.BalanceChangeUnspecified) + statedb.Commit(0, true, false) + + // Make Prague-enabled custom chain config. + cancunTime := uint64(0) + pragueTime := uint64(0) + config := ¶ms.ChainConfig{ + ChainID: big.NewInt(1), + LondonBlock: big.NewInt(0), + BerlinBlock: big.NewInt(0), + CancunTime: &cancunTime, + PragueTime: &pragueTime, + BlobScheduleConfig: ¶ms.BlobScheduleConfig{ + Cancun: params.DefaultCancunBlobConfig, + Prague: params.DefaultPragueBlobConfig, + }, + } + chain := &testBlockChain{ + config: config, + basefee: uint256.NewInt(1050), + blobfee: uint256.NewInt(105), + statedb: statedb, + } + pool := New(Config{Datadir: t.TempDir()}, chain, nil) + if err := pool.Init(1, chain.CurrentBlock(), newReserver()); err != nil { + t.Fatalf("failed to create blob pool: %v", err) + } + + // Attempt to add transactions. + var ( + tx1 = makeMultiBlobTx(0, 1, 1000, 100, 7, key1) + tx2 = makeMultiBlobTx(0, 1, 800, 70, 8, key2) + ) + errs := pool.Add([]*types.Transaction{tx1, tx2}, true) + + // Check that first succeeds second fails. + if errs[0] != nil { + t.Fatalf("expected tx with 7 blobs to succeed") + } + if !errors.Is(errs[1], txpool.ErrTxBlobLimitExceeded) { + t.Fatalf("expected tx with 8 blobs to fail, got: %v", errs[1]) + } + + verifyPoolInternals(t, pool) + pool.Close() +} + // Tests that adding transaction will correctly store it in the persistent store // and update all the indices. // diff --git a/core/txpool/errors.go b/core/txpool/errors.go index 968c9d9542..9bc435d67e 100644 --- a/core/txpool/errors.go +++ b/core/txpool/errors.go @@ -58,6 +58,10 @@ var ( // making the transaction invalid, rather a DOS protection. ErrOversizedData = errors.New("oversized data") + // ErrTxBlobLimitExceeded is returned if a transaction would exceed the number + // of blobs allowed by blobpool. + ErrTxBlobLimitExceeded = errors.New("transaction blob limit exceeded") + // ErrAlreadyReserved is returned if the sender address has a pending transaction // in a different subpool. For example, this error is returned in response to any // input transaction of non-blob type when a blob transaction from this sender diff --git a/core/txpool/validation.go b/core/txpool/validation.go index e370f2ce84..720d0d3b72 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -42,9 +42,10 @@ var ( type ValidationOptions struct { Config *params.ChainConfig // Chain configuration to selectively validate based on current fork rules - Accept uint8 // Bitmap of transaction types that should be accepted for the calling pool - MaxSize uint64 // Maximum size of a transaction that the caller can meaningfully handle - MinTip *big.Int // Minimum gas tip needed to allow a transaction into the caller pool + Accept uint8 // Bitmap of transaction types that should be accepted for the calling pool + MaxSize uint64 // Maximum size of a transaction that the caller can meaningfully handle + MaxBlobCount int // Maximum number of blobs allowed per transaction + MinTip *big.Int // Minimum gas tip needed to allow a transaction into the caller pool } // ValidationFunction is an method type which the pools use to perform the tx-validations which do not @@ -63,6 +64,9 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types if opts.Accept&(1< opts.MaxBlobCount { + return fmt.Errorf("%w: blob count %v, limit %v", ErrTxBlobLimitExceeded, blobCount, opts.MaxBlobCount) + } // Before performing any expensive validations, sanity check that the tx is // smaller than the maximum limit the pool can meaningfully handle if tx.Size() > opts.MaxSize { From 29a87e442645bc34d08e5c8709c619411c6c3624 Mon Sep 17 00:00:00 2001 From: Mario Vega Date: Thu, 22 May 2025 15:49:11 -0600 Subject: [PATCH 02/11] build: Update EEST to v4.5.0 (#31880) We deleted outdated pectra-devnet-6@v1.0.0 release by mistake, so this PR updates the referenced EEST release to the correct latest version. @s1na I removed the TODO comment because I think this solves it, unless it meant something else. --------- Co-authored-by: MariusVanDerWijden --- build/checksums.txt | 6 +++--- build/ci.go | 2 +- tests/block_test.go | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build/checksums.txt b/build/checksums.txt index c819429969..cf52172c2e 100644 --- a/build/checksums.txt +++ b/build/checksums.txt @@ -1,9 +1,9 @@ # This file contains sha256 checksums of optional build dependencies. -# version:spec-tests pectra-devnet-6@v1.0.0 +# version:spec-tests v4.5.0 # https://github.com/ethereum/execution-spec-tests/releases -# https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-6%40v1.0.0/ -b69211752a3029083c020dc635fe12156ca1a6725a08559da540a0337586a77e fixtures_pectra-devnet-6.tar.gz +# https://github.com/ethereum/execution-spec-tests/releases/download/v4.5.0/ +58afb92a0075a2cb7c4dec1281f7cb88b21b02afbedad096b580f3f8cc14c54c fixtures_develop.tar.gz # version:golang 1.24.3 # https://go.dev/dl/ diff --git a/build/ci.go b/build/ci.go index 88e4e82282..58c769e0d7 100644 --- a/build/ci.go +++ b/build/ci.go @@ -332,7 +332,7 @@ func doTest(cmdline []string) { // downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures. func downloadSpecTestFixtures(csdb *download.ChecksumDB, cachedir string) string { ext := ".tar.gz" - base := "fixtures_pectra-devnet-6" // TODO(s1na) rename once the version becomes part of the filename + base := "fixtures_develop" archivePath := filepath.Join(cachedir, base+ext) if err := csdb.DownloadFileFromKnownURL(archivePath); err != nil { log.Fatal(err) diff --git a/tests/block_test.go b/tests/block_test.go index f146e4ee6a..91d9f2e653 100644 --- a/tests/block_test.go +++ b/tests/block_test.go @@ -81,6 +81,9 @@ func TestExecutionSpecBlocktests(t *testing.T) { } bt := new(testMatcher) + bt.skipLoad(".*prague/eip7251_consolidations/contract_deployment/system_contract_deployment.json") + bt.skipLoad(".*prague/eip7002_el_triggerable_withdrawals/contract_deployment/system_contract_deployment.json") + bt.walk(t, executionSpecBlockchainTestDir, func(t *testing.T, name string, test *BlockTest) { execBlockTest(t, bt, test) }) From 1fd806d3e59b1da29297611e0046df0bc742658d Mon Sep 17 00:00:00 2001 From: Merkel Tranjes <140164174+rnkrtt@users.noreply.github.com> Date: Fri, 23 May 2025 09:21:03 +0200 Subject: [PATCH 03/11] internal/era: update link to documentation (#31879) Updated reference URL in accumulator.go comment to point to the correct location of the historical-hashes-accumulator documentation in the Ethereum portal network specs --- internal/era/accumulator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/era/accumulator.go b/internal/era/accumulator.go index cb383d8e63..83a761f1fd 100644 --- a/internal/era/accumulator.go +++ b/internal/era/accumulator.go @@ -49,7 +49,7 @@ func ComputeAccumulator(hashes []common.Hash, tds []*big.Int) (common.Hash, erro // headerRecord is an individual record for a historical header. // -// See https://github.com/ethereum/portal-network-specs/blob/master/history-network.md#the-header-accumulator +// See https://github.com/ethereum/portal-network-specs/blob/master/history/history-network.md#the-historical-hashes-accumulator // for more information. type headerRecord struct { Hash common.Hash From a53fdf1fe6eac47899738dccba5a652936aebb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Fri, 23 May 2025 12:14:40 +0300 Subject: [PATCH 04/11] crypto: use pure Go signature implementation in tinygo (#31878) tinygo is having problems compiling the C implementation --- crypto/signature_cgo.go | 4 ++-- crypto/signature_nocgo.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index 5c7810c14c..18b78f4aac 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -14,8 +14,8 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . -//go:build !nacl && !js && !wasip1 && cgo && !gofuzz -// +build !nacl,!js,!wasip1,cgo,!gofuzz +//go:build !nacl && !js && !wasip1 && cgo && !gofuzz && !tinygo +// +build !nacl,!js,!wasip1,cgo,!gofuzz,!tinygo package crypto diff --git a/crypto/signature_nocgo.go b/crypto/signature_nocgo.go index 2d35b49403..d76127c258 100644 --- a/crypto/signature_nocgo.go +++ b/crypto/signature_nocgo.go @@ -14,8 +14,8 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . -//go:build nacl || js || wasip1 || !cgo || gofuzz -// +build nacl js wasip1 !cgo gofuzz +//go:build nacl || js || wasip1 || !cgo || gofuzz || tinygo +// +build nacl js wasip1 !cgo gofuzz tinygo package crypto From f21adaf245e320a809f9bb6ec96c330726c9078f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Fri, 23 May 2025 12:29:01 +0300 Subject: [PATCH 05/11] consensus: remove clique RPC APIs (#31875) --- consensus/beacon/consensus.go | 6 - consensus/clique/api.go | 235 ---------------------------------- consensus/clique/clique.go | 10 -- consensus/consensus.go | 4 - consensus/ethash/ethash.go | 7 - eth/backend.go | 3 - 6 files changed, 265 deletions(-) delete mode 100644 consensus/clique/api.go diff --git a/consensus/beacon/consensus.go b/consensus/beacon/consensus.go index cc9f44e460..f9a5a3233b 100644 --- a/consensus/beacon/consensus.go +++ b/consensus/beacon/consensus.go @@ -30,7 +30,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" "github.com/holiman/uint256" ) @@ -445,11 +444,6 @@ func (beacon *Beacon) CalcDifficulty(chain consensus.ChainHeaderReader, time uin return beaconDifficulty } -// APIs implements consensus.Engine, returning the user facing RPC APIs. -func (beacon *Beacon) APIs(chain consensus.ChainHeaderReader) []rpc.API { - return beacon.ethone.APIs(chain) -} - // Close shutdowns the consensus engine func (beacon *Beacon) Close() error { return beacon.ethone.Close() diff --git a/consensus/clique/api.go b/consensus/clique/api.go deleted file mode 100644 index 374b50692d..0000000000 --- a/consensus/clique/api.go +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2017 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see . - -package clique - -import ( - "encoding/json" - "fmt" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" -) - -// API is a user facing RPC API to allow controlling the signer and voting -// mechanisms of the proof-of-authority scheme. -type API struct { - chain consensus.ChainHeaderReader - clique *Clique -} - -// GetSnapshot retrieves the state snapshot at a given block. -func (api *API) GetSnapshot(number *rpc.BlockNumber) (*Snapshot, error) { - // Retrieve the requested block number (or current if none requested) - var header *types.Header - if number == nil || *number == rpc.LatestBlockNumber { - header = api.chain.CurrentHeader() - } else { - header = api.chain.GetHeaderByNumber(uint64(number.Int64())) - } - // Ensure we have an actually valid block and return its snapshot - if header == nil { - return nil, errUnknownBlock - } - return api.clique.snapshot(api.chain, header.Number.Uint64(), header.Hash(), nil) -} - -// GetSnapshotAtHash retrieves the state snapshot at a given block. -func (api *API) GetSnapshotAtHash(hash common.Hash) (*Snapshot, error) { - header := api.chain.GetHeaderByHash(hash) - if header == nil { - return nil, errUnknownBlock - } - return api.clique.snapshot(api.chain, header.Number.Uint64(), header.Hash(), nil) -} - -// GetSigners retrieves the list of authorized signers at the specified block. -func (api *API) GetSigners(number *rpc.BlockNumber) ([]common.Address, error) { - // Retrieve the requested block number (or current if none requested) - var header *types.Header - if number == nil || *number == rpc.LatestBlockNumber { - header = api.chain.CurrentHeader() - } else { - header = api.chain.GetHeaderByNumber(uint64(number.Int64())) - } - // Ensure we have an actually valid block and return the signers from its snapshot - if header == nil { - return nil, errUnknownBlock - } - snap, err := api.clique.snapshot(api.chain, header.Number.Uint64(), header.Hash(), nil) - if err != nil { - return nil, err - } - return snap.signers(), nil -} - -// GetSignersAtHash retrieves the list of authorized signers at the specified block. -func (api *API) GetSignersAtHash(hash common.Hash) ([]common.Address, error) { - header := api.chain.GetHeaderByHash(hash) - if header == nil { - return nil, errUnknownBlock - } - snap, err := api.clique.snapshot(api.chain, header.Number.Uint64(), header.Hash(), nil) - if err != nil { - return nil, err - } - return snap.signers(), nil -} - -// Proposals returns the current proposals the node tries to uphold and vote on. -func (api *API) Proposals() map[common.Address]bool { - api.clique.lock.RLock() - defer api.clique.lock.RUnlock() - - proposals := make(map[common.Address]bool) - for address, auth := range api.clique.proposals { - proposals[address] = auth - } - return proposals -} - -// Propose injects a new authorization proposal that the signer will attempt to -// push through. -func (api *API) Propose(address common.Address, auth bool) { - api.clique.lock.Lock() - defer api.clique.lock.Unlock() - - api.clique.proposals[address] = auth -} - -// Discard drops a currently running proposal, stopping the signer from casting -// further votes (either for or against). -func (api *API) Discard(address common.Address) { - api.clique.lock.Lock() - defer api.clique.lock.Unlock() - - delete(api.clique.proposals, address) -} - -type status struct { - InturnPercent float64 `json:"inturnPercent"` - SigningStatus map[common.Address]int `json:"sealerActivity"` - NumBlocks uint64 `json:"numBlocks"` -} - -// Status returns the status of the last N blocks, -// - the number of active signers, -// - the number of signers, -// - the percentage of in-turn blocks -func (api *API) Status() (*status, error) { - var ( - numBlocks = uint64(64) - header = api.chain.CurrentHeader() - diff = uint64(0) - optimals = 0 - ) - snap, err := api.clique.snapshot(api.chain, header.Number.Uint64(), header.Hash(), nil) - if err != nil { - return nil, err - } - var ( - signers = snap.signers() - end = header.Number.Uint64() - start = end - numBlocks - ) - if numBlocks > end { - start = 1 - numBlocks = end - start - } - signStatus := make(map[common.Address]int) - for _, s := range signers { - signStatus[s] = 0 - } - for n := start; n < end; n++ { - h := api.chain.GetHeaderByNumber(n) - if h == nil { - return nil, fmt.Errorf("missing block %d", n) - } - if h.Difficulty.Cmp(diffInTurn) == 0 { - optimals++ - } - diff += h.Difficulty.Uint64() - sealer, err := api.clique.Author(h) - if err != nil { - return nil, err - } - signStatus[sealer]++ - } - return &status{ - InturnPercent: float64(100*optimals) / float64(numBlocks), - SigningStatus: signStatus, - NumBlocks: numBlocks, - }, nil -} - -type blockNumberOrHashOrRLP struct { - *rpc.BlockNumberOrHash - RLP hexutil.Bytes `json:"rlp,omitempty"` -} - -func (sb *blockNumberOrHashOrRLP) UnmarshalJSON(data []byte) error { - bnOrHash := new(rpc.BlockNumberOrHash) - // Try to unmarshal bNrOrHash - if err := bnOrHash.UnmarshalJSON(data); err == nil { - sb.BlockNumberOrHash = bnOrHash - return nil - } - // Try to unmarshal RLP - var input string - if err := json.Unmarshal(data, &input); err != nil { - return err - } - blob, err := hexutil.Decode(input) - if err != nil { - return err - } - sb.RLP = blob - return nil -} - -// GetSigner returns the signer for a specific clique block. -// Can be called with a block number, a block hash or a rlp encoded blob. -// The RLP encoded blob can either be a block or a header. -func (api *API) GetSigner(rlpOrBlockNr *blockNumberOrHashOrRLP) (common.Address, error) { - if len(rlpOrBlockNr.RLP) == 0 { - blockNrOrHash := rlpOrBlockNr.BlockNumberOrHash - var header *types.Header - if blockNrOrHash == nil { - header = api.chain.CurrentHeader() - } else if hash, ok := blockNrOrHash.Hash(); ok { - header = api.chain.GetHeaderByHash(hash) - } else if number, ok := blockNrOrHash.Number(); ok { - header = api.chain.GetHeaderByNumber(uint64(number.Int64())) - } - if header == nil { - return common.Address{}, fmt.Errorf("missing block %v", blockNrOrHash.String()) - } - return api.clique.Author(header) - } - block := new(types.Block) - if err := rlp.DecodeBytes(rlpOrBlockNr.RLP, block); err == nil { - return api.clique.Author(block.Header()) - } - header := new(types.Header) - if err := rlp.DecodeBytes(rlpOrBlockNr.RLP, header); err != nil { - return common.Address{}, err - } - return api.clique.Author(header) -} diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index d31efd7445..b593d2117d 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -41,7 +41,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" "golang.org/x/crypto/sha3" ) @@ -641,15 +640,6 @@ func (c *Clique) Close() error { return nil } -// APIs implements consensus.Engine, returning the user facing RPC API to allow -// controlling the signer voting. -func (c *Clique) APIs(chain consensus.ChainHeaderReader) []rpc.API { - return []rpc.API{{ - Namespace: "clique", - Service: &API{chain: chain, clique: c}, - }} -} - // SealHash returns the hash of a block prior to it being sealed. func SealHash(header *types.Header) (hash common.Hash) { hasher := sha3.NewLegacyKeccak256() diff --git a/consensus/consensus.go b/consensus/consensus.go index c59b9a4744..a68351f7ff 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" ) // ChainHeaderReader defines a small collection of methods needed to access the local @@ -109,9 +108,6 @@ type Engine interface { // that a new block should have. CalcDifficulty(chain ChainHeaderReader, time uint64, parent *types.Header) *big.Int - // APIs returns the RPC APIs this consensus engine provides. - APIs(chain ChainHeaderReader) []rpc.API - // Close terminates any background threads maintained by the consensus engine. Close() error } diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index f37ec26056..f624f73875 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -22,7 +22,6 @@ import ( "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rpc" ) // Ethash is a consensus engine based on proof-of-work implementing the ethash @@ -71,12 +70,6 @@ func (ethash *Ethash) Close() error { return nil } -// APIs implements consensus.Engine, returning no APIs as ethash is an empty -// shell in the post-merge world. -func (ethash *Ethash) APIs(chain consensus.ChainHeaderReader) []rpc.API { - return []rpc.API{} -} - // Seal generates a new sealing request for the given input block and pushes // the result into the given channel. For the ethash engine, this method will // just panic as sealing is not supported anymore. diff --git a/eth/backend.go b/eth/backend.go index 6d1b6bae99..15243ad5c9 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -337,9 +337,6 @@ func makeExtraData(extra []byte) []byte { func (s *Ethereum) APIs() []rpc.API { apis := ethapi.GetAPIs(s.APIBackend) - // Append any APIs exposed explicitly by the consensus engine - apis = append(apis, s.engine.APIs(s.BlockChain())...) - // Append all the local APIs and return return append(apis, []rpc.API{ { From 94481d13513f94ef4a76ef847e7c3d436fde2546 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 23 May 2025 12:33:43 +0200 Subject: [PATCH 06/11] .gitea: add initial workflow file (#31885) --- .gitea/workflows/release.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000000..fa7b7f25ab --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release Builds + +on: + push: + branches: [ master ] + +jobs: + docker: + name: Docker Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23.0 + cache: false + + - name: Run docker build + run: | + go run build/ci.go docker -platform linux/amd64,linux/arm64 + + linux: + name: Docker Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23.0 + cache: false + + - name: Run build + run: | + go run build/ci.go install From 8f598e85ade64653b6490b8ca742a51274ec328a Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 23 May 2025 12:44:30 +0200 Subject: [PATCH 07/11] .gitea: update release build actions (#31886) Trying to make the docker build work. --- .gitea/workflows/release.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index fa7b7f25ab..4a169127ea 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -11,18 +11,24 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.23.0 + go-version: 1.24 cache: false - name: Run docker build run: | - go run build/ci.go docker -platform linux/amd64,linux/arm64 + go run build/ci.go dockerx -platform linux/amd64,linux/arm64,linux/riscv64 linux: - name: Docker Image + name: Linux Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -30,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.23.0 + go-version: 1.24 cache: false - name: Run build From 8781e93013d286538a8848b695f2b1e102f4af6a Mon Sep 17 00:00:00 2001 From: buddho Date: Fri, 23 May 2025 19:10:10 +0800 Subject: [PATCH 08/11] core/state: fix copy of storageChange (#31874) Missing field origvalue when copying storageChange. --- core/state/journal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/state/journal.go b/core/state/journal.go index 13332dbd79..f3f976f24f 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -408,6 +408,7 @@ func (ch storageChange) copy() journalEntry { account: ch.account, key: ch.key, prevvalue: ch.prevvalue, + origvalue: ch.origvalue, } } From b97198379b824d8e331d9e024afead4fe03cc50a Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 23 May 2025 16:21:08 +0200 Subject: [PATCH 09/11] .gitea: add cron build script (#31890) Also swaps the push build scripts and adds environment output. --- .gitea/workflows/release-cron.yml | 42 +++++++++++++++++++++++++++++++ .gitea/workflows/release.yml | 38 +++++++++++++++------------- 2 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 .gitea/workflows/release-cron.yml diff --git a/.gitea/workflows/release-cron.yml b/.gitea/workflows/release-cron.yml new file mode 100644 index 0000000000..3a03d0ef14 --- /dev/null +++ b/.gitea/workflows/release-cron.yml @@ -0,0 +1,42 @@ +name: Release Builds (cron) + +on: + schedule: + cron: '0 0 * * *' + +jobs: + azure-cleanup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.24 + cache: false + + - name: Run cleanup script + run: | + go run build/ci.go purge -store gethstore/builds -days 14 + + ppa: + name: PPA Upload (master) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.24 + cache: false + + - name: Install deb toolchain + run: | + apt-get -yq --no-install-suggests --no-install-recommends install devscripts debhelper dput fakeroot + + - name: Run ci.go + run: | + echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts + go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder " diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 4a169127ea..a91bebda7f 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,10 +1,30 @@ -name: Release Builds +name: Release Builds (push) on: push: branches: [ master ] jobs: + linux: + name: Linux Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.24 + cache: false + + - name: display environment + run: | + env + + - name: Run build + run: | + go run build/ci.go install + docker: name: Docker Image runs-on: ubuntu-latest @@ -26,19 +46,3 @@ jobs: - name: Run docker build run: | go run build/ci.go dockerx -platform linux/amd64,linux/arm64,linux/riscv64 - - linux: - name: Linux Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.24 - cache: false - - - name: Run build - run: | - go run build/ci.go install From f14813fea99f69d5ff11a6e0c96aebd44a2fc288 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 23 May 2025 17:48:15 +0200 Subject: [PATCH 10/11] internal/build: add support for Github Actions CI environment (#31891) This adds support for the Github actions environment in the build tool. Information from environment variables, like the build number and branch/tag name, is used to make decisions about uploads and package filenames. --- internal/build/env.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/internal/build/env.go b/internal/build/env.go index 35b2cd6ae7..23501d0ece 100644 --- a/internal/build/env.go +++ b/internal/build/env.go @@ -92,6 +92,33 @@ func Env() Environment { IsPullRequest: os.Getenv("APPVEYOR_PULL_REQUEST_NUMBER") != "", IsCronJob: os.Getenv("APPVEYOR_SCHEDULED_BUILD") == "True", } + case os.Getenv("CI") == "true" && os.Getenv("GITHUB_ACTIONS") == "true": + commit := os.Getenv("GITHUB_SHA") + reftype := os.Getenv("GITHUB_REF_TYPE") + isPR := os.Getenv("GITHUB_HEAD_REF") != "" + tag := "" + branch := "" + switch { + case isPR: + branch = os.Getenv("GITHUB_BASE_REF") + case reftype == "branch": + branch = os.Getenv("GITHUB_REF_NAME") + case reftype == "tag": + tag = os.Getenv("GITHUB_REF_NAME") + } + return Environment{ + CI: true, + Name: "github-actions", + Repo: os.Getenv("GITHUB_REPOSITORY"), + Commit: commit, + Date: getDate(commit), + Branch: branch, + Tag: tag, + IsPullRequest: isPR, + Buildnum: os.Getenv("GITHUB_RUN_ID"), + IsCronJob: os.Getenv("GITHUB_EVENT_NAME") == "schedule", + } + default: return LocalEnv() } From 9fd3f8a0dd0a82514bf0ab5ed65dbdcf48c5e155 Mon Sep 17 00:00:00 2001 From: Marcel <153717436+MonkeyMarcel@users.noreply.github.com> Date: Fri, 23 May 2025 23:50:25 +0800 Subject: [PATCH 11/11] core: remove unused queued import status (#31870) --- core/blockchain_insert.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/blockchain_insert.go b/core/blockchain_insert.go index 695aa6679b..d7c2696f08 100644 --- a/core/blockchain_insert.go +++ b/core/blockchain_insert.go @@ -27,10 +27,10 @@ import ( // insertStats tracks and reports on block insertion. type insertStats struct { - queued, processed, ignored int - usedGas uint64 - lastIndex int - startTime mclock.AbsTime + processed, ignored int + usedGas uint64 + lastIndex int + startTime mclock.AbsTime } // statsReportLimit is the time limit during import and export after which we @@ -78,9 +78,6 @@ func (st *insertStats) report(chain []*types.Block, index int, snapDiffItems, sn } context = append(context, []interface{}{"triedirty", triebufNodes}...) - if st.queued > 0 { - context = append(context, []interface{}{"queued", st.queued}...) - } if st.ignored > 0 { context = append(context, []interface{}{"ignored", st.ignored}...) }