From 418e96b9580c4a77f6156e48febc2902980abaec Mon Sep 17 00:00:00 2001 From: lightclient Date: Mon, 27 Jan 2025 09:03:00 -0700 Subject: [PATCH] core/txpool: add setcode tx to filter list of accepted txs --- core/txpool/legacypool/legacypool.go | 2 +- core/txpool/legacypool/legacypool_test.go | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index d7c2d6eecd..d3dba3d8d7 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -266,7 +266,7 @@ func New(config Config, chain BlockChain) *LegacyPool { // pool, specifically, whether it is a Legacy, AccessList or Dynamic transaction. func (pool *LegacyPool) Filter(tx *types.Transaction) bool { switch tx.Type() { - case types.LegacyTxType, types.AccessListTxType, types.DynamicFeeTxType: + case types.LegacyTxType, types.AccessListTxType, types.DynamicFeeTxType, types.SetCodeTxType: return true default: return false diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index 60be01b58d..06e53590b7 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -2224,19 +2224,6 @@ func TestSetCodeTransactions(t *testing.T) { testAddBalance(pool, addrB, big.NewInt(params.Ether)) testAddBalance(pool, addrC, big.NewInt(params.Ether)) - // A few situations to test: - // 1. Accounts with delegation set can only have one in-flight transaction. - // 2. Setcode tx should be rejected if any authority has a known pooled tx. - // 3. New txs from senders with pooled delegations should not be accepted. - // 4. Ensure setcode tx can replace itself provided the fee bump is enough. - // 5. Make sure that if a setcode tx is replaced, the auths associated with - // the tx are removed. - // 5.1. This should also work when a self-sponsored setcode tx attempts - // to replace itself. - - // make sure auth list recreated correctly after full reorg? - // (in different test?) verify that a setcode tx cannot invalidate a blob tx. - for _, tt := range []struct { name string pending int