From 055e1e6291e8420eeec53a81664a36cddbc64246 Mon Sep 17 00:00:00 2001 From: maskpp Date: Mon, 14 Jul 2025 15:07:47 +0800 Subject: [PATCH 1/3] signer/core/apitypes: require blob txs to have tx.to set (#32197) Check the `to` address before building the blob tx. --------- Co-authored-by: jwasinger --- signer/core/apitypes/types.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/signer/core/apitypes/types.go b/signer/core/apitypes/types.go index b8b96bef92..9a32312d46 100644 --- a/signer/core/apitypes/types.go +++ b/signer/core/apitypes/types.go @@ -150,6 +150,9 @@ func (args *SendTxArgs) ToTransaction() (*types.Transaction, error) { if args.AccessList != nil { al = *args.AccessList } + if to == nil { + return nil, fmt.Errorf("transaction recipient must be set for blob transactions") + } data = &types.BlobTx{ To: *to, ChainID: uint256.MustFromBig((*big.Int)(args.ChainID)), From a9061cfd77a26634d459f824793335ea73be14da Mon Sep 17 00:00:00 2001 From: kilavvy <140459108+kilavvy@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:15:18 +0200 Subject: [PATCH 2/3] accounts/keystore: update links to documenation (#32194) --- **Description:** - Replaced outdated GitHub wiki links with the official Ethereum documentation for Web3 Secret Storage. - Updated references in `keystore.go` and `passphrase.go` for improved accuracy and reliability. --- --- accounts/keystore/keystore.go | 2 +- accounts/keystore/passphrase.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index df3dda60b6..3e85b0433b 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -17,7 +17,7 @@ // Package keystore implements encrypted storage of secp256k1 private keys. // // Keys are stored as encrypted JSON files according to the Web3 Secret Storage specification. -// See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information. +// See https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/ for more information. package keystore import ( diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index e7a7f8d0cb..fc7ea938e2 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -19,7 +19,7 @@ This key store behaves as KeyStorePlain with the difference that the private key is encrypted and on disk uses another JSON encoding. -The crypto is documented at https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition +The crypto is documented at https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/ */ From 90a098904f552ee722b0d0d5eccb3500d90a85a8 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Mon, 14 Jul 2025 11:27:42 +0200 Subject: [PATCH 3/3] ethclient/gethclient: remove race condition in tests (#32206) alternative to https://github.com/ethereum/go-ethereum/pull/32200 The race condition is not happening yet, since there is only a single call to `newTestBackend`, but there might be more in the future --- ethclient/gethclient/gethclient_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ethclient/gethclient/gethclient_test.go b/ethclient/gethclient/gethclient_test.go index 02635faabc..0eed63cacf 100644 --- a/ethclient/gethclient/gethclient_test.go +++ b/ethclient/gethclient/gethclient_test.go @@ -48,12 +48,11 @@ var ( testSlot = common.HexToHash("0xdeadbeef") testValue = crypto.Keccak256Hash(testSlot[:]) testBalance = big.NewInt(2e15) - testTxHashes []common.Hash ) -func newTestBackend(t *testing.T) (*node.Node, []*types.Block) { +func newTestBackend(t *testing.T) (*node.Node, []*types.Block, []common.Hash) { // Generate test chain. - genesis, blocks := generateTestChain() + genesis, blocks, txHashes := generateTestChain() // Create node n, err := node.New(&node.Config{ HTTPModules: []string{"debug", "eth", "admin"}, @@ -82,10 +81,10 @@ func newTestBackend(t *testing.T) (*node.Node, []*types.Block) { if _, err := ethservice.BlockChain().InsertChain(blocks[1:]); err != nil { t.Fatalf("can't import test blocks: %v", err) } - return n, blocks + return n, blocks, txHashes } -func generateTestChain() (*core.Genesis, []*types.Block) { +func generateTestChain() (*core.Genesis, []*types.Block, []common.Hash) { genesis := &core.Genesis{ Config: params.AllEthashProtocolChanges, Alloc: types.GenesisAlloc{ @@ -96,6 +95,7 @@ func generateTestChain() (*core.Genesis, []*types.Block) { ExtraData: []byte("test genesis"), Timestamp: 9000, } + txHashes := make([]common.Hash, 0) generate := func(i int, g *core.BlockGen) { g.OffsetTime(5) g.SetExtra([]byte("test")) @@ -111,15 +111,15 @@ func generateTestChain() (*core.Genesis, []*types.Block) { }) tx, _ = types.SignTx(tx, types.LatestSignerForChainID(genesis.Config.ChainID), testKey) g.AddTx(tx) - testTxHashes = append(testTxHashes, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) } _, blocks, _ := core.GenerateChainWithGenesis(genesis, ethash.NewFaker(), 1, generate) blocks = append([]*types.Block{genesis.ToBlock()}, blocks...) - return genesis, blocks + return genesis, blocks, txHashes } func TestGethClient(t *testing.T) { - backend, _ := newTestBackend(t) + backend, _, txHashes := newTestBackend(t) client := backend.Attach() defer backend.Close() defer client.Close() @@ -172,7 +172,7 @@ func TestGethClient(t *testing.T) { }, { "TestTraceTransaction", - func(t *testing.T) { testTraceTransactions(t, client) }, + func(t *testing.T) { testTraceTransactions(t, client, txHashes) }, }, { "TestSetHead", @@ -480,9 +480,9 @@ func testCallContract(t *testing.T, client *rpc.Client) { } } -func testTraceTransactions(t *testing.T, client *rpc.Client) { +func testTraceTransactions(t *testing.T, client *rpc.Client, txHashes []common.Hash) { ec := New(client) - for _, txHash := range testTxHashes { + for _, txHash := range txHashes { // Struct logger _, err := ec.TraceTransaction(context.Background(), txHash, nil) if err != nil {