From 2700d76524209545c1ec4e65b82bffdc9c414770 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:00:59 +0100 Subject: [PATCH] EIP-7840: Add blob schedule to EL config files (#13443) See also https://eips.ethereum.org/EIPS/eip-7840 --------- Co-authored-by: Somnath Banerjee --- core/types/blob_tx_wrapper.go | 6 -- erigon-lib/chain/chain_config.go | 109 +++++++++++++++---------- erigon-lib/chain/chain_config_test.go | 16 ++++ erigon-lib/common/fixedgas/protocol.go | 7 +- params/chainspecs/chiado.json | 15 +++- params/chainspecs/gnosis.json | 15 +++- params/chainspecs/holesky.json | 12 +++ params/chainspecs/mainnet.json | 12 +++ params/chainspecs/sepolia.json | 12 +++ params/config_test.go | 36 ++++++++ txnprovider/txpool/assemble.go | 6 +- txnprovider/txpool/pool.go | 18 +--- txnprovider/txpool/pool_fuzz_test.go | 5 +- txnprovider/txpool/pool_test.go | 24 +++--- 14 files changed, 201 insertions(+), 92 deletions(-) diff --git a/core/types/blob_tx_wrapper.go b/core/types/blob_tx_wrapper.go index 6e961151748..53dd95391b0 100644 --- a/core/types/blob_tx_wrapper.go +++ b/core/types/blob_tx_wrapper.go @@ -281,12 +281,6 @@ func (txw *BlobTxWrapper) ValidateBlobTransactionWrapper() error { if l1 != l2 || l1 != l3 || l1 != l4 { return fmt.Errorf("lengths don't match %v %v %v %v", l1, l2, l3, l4) } - // the following check isn't strictly necessary as it would be caught by blob gas processing - // (and hence it is not explicitly in the spec for this function), but it doesn't hurt to fail - // early in case we are getting spammed with too many blobs or there is a bug somewhere: - if uint64(l1) > fixedgas.DefaultMaxBlobsPerBlock { - return fmt.Errorf("number of blobs exceeds max: %v", l1) - } kzgCtx := libkzg.Ctx() err := kzgCtx.VerifyBlobKZGProofBatch(toBlobs(txw.Blobs), toComms(txw.Commitments), toProofs(txw.Proofs)) if err != nil { diff --git a/erigon-lib/chain/chain_config.go b/erigon-lib/chain/chain_config.go index ddbe8a6439a..2020a58db7b 100644 --- a/erigon-lib/chain/chain_config.go +++ b/erigon-lib/chain/chain_config.go @@ -70,16 +70,9 @@ type Config struct { PragueTime *big.Int `json:"pragueTime,omitempty"` OsakaTime *big.Int `json:"osakaTime,omitempty"` - // Optional EIP-4844 parameters - MinBlobGasPrice *uint64 `json:"minBlobGasPrice,omitempty"` - MaxBlobGasPerBlock *uint64 `json:"maxBlobGasPerBlock,omitempty"` - TargetBlobGasPerBlock *uint64 `json:"targetBlobGasPerBlock,omitempty"` - BlobGasPriceUpdateFraction *uint64 `json:"blobGasPriceUpdateFraction,omitempty"` - - // EIP-7691 - MaxBlobGasPerBlockPrague *uint64 `json:"maxBlobGasPerBlockPrague,omitempty"` - TargetBlobGasPerBlockPrague *uint64 `json:"targetBlobGasPerBlockPrague,omitempty"` - BlobGasPriceUpdateFractionPrague *uint64 `json:"blobGasPriceUpdateFractionPrague,omitempty"` + // Optional EIP-4844 parameters (see also EIP-7691 & EIP-7840) + MinBlobGasPrice *uint64 `json:"minBlobGasPrice,omitempty"` + BlobSchedule *BlobSchedule `json:"blobSchedule,omitempty"` // (Optional) governance contract where EIP-1559 fees will be sent to, which otherwise would be burnt since the London fork. // A key corresponds to the block number, starting from which the fees are sent to the address (map value). @@ -100,6 +93,57 @@ type Config struct { BorJSON json.RawMessage `json:"bor,omitempty"` } +type BlobConfig struct { + Target uint64 `json:"target"` + Max uint64 `json:"max"` + BaseFeeUpdateFraction uint64 `json:"baseFeeUpdateFraction"` +} + +// See EIP-7840: Add blob schedule to EL config files +type BlobSchedule struct { + Cancun *BlobConfig `json:"cancun,omitempty"` + Prague *BlobConfig `json:"prague,omitempty"` +} + +func (b *BlobSchedule) TargetBlobsPerBlock(isPrague bool) uint64 { + if isPrague { + if b != nil && b.Prague != nil { + return b.Prague.Target + } + return 6 // EIP-7691 + } + if b != nil && b.Cancun != nil { + return b.Cancun.Target + } + return 3 // EIP-4844 +} + +func (b *BlobSchedule) MaxBlobsPerBlock(isPrague bool) uint64 { + if isPrague { + if b != nil && b.Prague != nil { + return b.Prague.Max + } + return 9 // EIP-7691 + } + if b != nil && b.Cancun != nil { + return b.Cancun.Max + } + return 6 // EIP-4844 +} + +func (b *BlobSchedule) BaseFeeUpdateFraction(isPrague bool) uint64 { + if isPrague { + if b != nil && b.Prague != nil { + return b.Prague.BaseFeeUpdateFraction + } + return 5007716 // EIP-7691 + } + if b != nil && b.Cancun != nil { + return b.Cancun.BaseFeeUpdateFraction + } + return 3338477 // EIP-4844 +} + type BorConfig interface { fmt.Stringer IsAgra(num uint64) bool @@ -276,50 +320,31 @@ func (c *Config) GetMinBlobGasPrice() uint64 { } func (c *Config) GetMaxBlobGasPerBlock(t uint64) uint64 { + return c.GetMaxBlobsPerBlock(t) * fixedgas.BlobGasPerBlob +} + +func (c *Config) GetMaxBlobsPerBlock(time uint64) uint64 { + var b *BlobSchedule if c != nil { - if c.IsPrague(t) { - if c.MaxBlobGasPerBlockPrague != nil { - return *c.MaxBlobGasPerBlockPrague - } - return 1179648 // EIP-7691 - } else if c.MaxBlobGasPerBlock != nil { - return *c.MaxBlobGasPerBlock - } + b = c.BlobSchedule } - return 786432 // MAX_BLOB_GAS_PER_BLOCK (EIP-4844) + return b.MaxBlobsPerBlock(c.IsPrague(time)) } func (c *Config) GetTargetBlobGasPerBlock(t uint64) uint64 { + var b *BlobSchedule if c != nil { - if c.IsPrague(t) { - if c.TargetBlobGasPerBlockPrague != nil { - return *c.TargetBlobGasPerBlockPrague - } - return 786432 - } else if c.TargetBlobGasPerBlock != nil { - return *c.TargetBlobGasPerBlock - } + b = c.BlobSchedule } - return 393216 // TARGET_BLOB_GAS_PER_BLOCK (EIP-4844) + return b.TargetBlobsPerBlock(c.IsPrague(t)) * fixedgas.BlobGasPerBlob } func (c *Config) GetBlobGasPriceUpdateFraction(t uint64) uint64 { + var b *BlobSchedule if c != nil { - if c.IsPrague(t) { - if c.BlobGasPriceUpdateFractionPrague != nil { - return *c.BlobGasPriceUpdateFractionPrague - } - return 5007716 - - } else if c.BlobGasPriceUpdateFraction != nil { - return *c.BlobGasPriceUpdateFraction - } + b = c.BlobSchedule } - return 3338477 // BLOB_GASPRICE_UPDATE_FRACTION (EIP-4844) -} - -func (c *Config) GetMaxBlobsPerBlock(time uint64) uint64 { - return c.GetMaxBlobGasPerBlock(time) / fixedgas.BlobGasPerBlob + return b.BaseFeeUpdateFraction(c.IsPrague(t)) } func (c *Config) SecondsPerSlot() uint64 { diff --git a/erigon-lib/chain/chain_config_test.go b/erigon-lib/chain/chain_config_test.go index 406610b941c..3c1decd5177 100644 --- a/erigon-lib/chain/chain_config_test.go +++ b/erigon-lib/chain/chain_config_test.go @@ -66,3 +66,19 @@ func TestConfigValueLookup(t *testing.T) { assert.Equal(t, ConfigValueLookup(burntContract, 41874000), address2) assert.Equal(t, ConfigValueLookup(burntContract, 41874000+1), address2) } + +func TestNilBlobSchedule(t *testing.T) { + var b *BlobSchedule + + // Original EIP-4844 values + isPrague := false + assert.Equal(t, uint64(3), b.TargetBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(6), b.MaxBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(3338477), b.BaseFeeUpdateFraction(isPrague)) + + // EIP-7691: Blob throughput increase + isPrague = true + assert.Equal(t, uint64(6), b.TargetBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(9), b.MaxBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(5007716), b.BaseFeeUpdateFraction(isPrague)) +} diff --git a/erigon-lib/common/fixedgas/protocol.go b/erigon-lib/common/fixedgas/protocol.go index c002d070cf3..4d91180b708 100644 --- a/erigon-lib/common/fixedgas/protocol.go +++ b/erigon-lib/common/fixedgas/protocol.go @@ -33,10 +33,9 @@ const ( InitCodeWordGas = 2 // EIP-4844: Shard Blob Transactions - FieldElementsPerBlob = 4096 // each field element is 32 bytes - BlobSize = FieldElementsPerBlob * 32 - BlobGasPerBlob uint64 = 0x20000 - DefaultMaxBlobsPerBlock uint64 = 6 // lower for Gnosis + FieldElementsPerBlob = 4096 // each field element is 32 bytes + BlobSize = FieldElementsPerBlob * 32 + BlobGasPerBlob uint64 = 0x20000 // EIP-7702: set code tx PerEmptyAccountCost = 25000 diff --git a/params/chainspecs/chiado.json b/params/chainspecs/chiado.json index 9d251f72575..c109ac65466 100644 --- a/params/chainspecs/chiado.json +++ b/params/chainspecs/chiado.json @@ -16,9 +16,18 @@ "shanghaiTime": 1684934220, "cancunTime": 1706724940, "minBlobGasPrice": 1000000000, - "maxBlobGasPerBlock": 262144, - "targetBlobGasPerBlock": 131072, - "blobGasPriceUpdateFraction": 1112826, + "blobSchedule": { + "cancun": { + "target": 1, + "max": 2, + "baseFeeUpdateFraction": 1112826 + }, + "prague": { + "target": 1, + "max": 2, + "baseFeeUpdateFraction": 1112826 + } + }, "burntContract": { "0": "0x1559000000000000000000000000000000000000" }, diff --git a/params/chainspecs/gnosis.json b/params/chainspecs/gnosis.json index f7deadd85b7..3de091974dd 100644 --- a/params/chainspecs/gnosis.json +++ b/params/chainspecs/gnosis.json @@ -16,9 +16,18 @@ "shanghaiTime": 1690889660, "cancunTime": 1710181820, "minBlobGasPrice": 1000000000, - "maxBlobGasPerBlock": 262144, - "targetBlobGasPerBlock": 131072, - "blobGasPriceUpdateFraction": 1112826, + "blobSchedule": { + "cancun": { + "target": 1, + "max": 2, + "baseFeeUpdateFraction": 1112826 + }, + "prague": { + "target": 1, + "max": 2, + "baseFeeUpdateFraction": 1112826 + } + }, "burntContract": { "19040000": "0x6BBe78ee9e474842Dbd4AB4987b3CeFE88426A92" }, diff --git a/params/chainspecs/holesky.json b/params/chainspecs/holesky.json index 525d4c80e84..ee93474ef45 100644 --- a/params/chainspecs/holesky.json +++ b/params/chainspecs/holesky.json @@ -16,5 +16,17 @@ "terminalTotalDifficultyPassed": true, "shanghaiTime": 1696000704, "cancunTime": 1707305664, + "blobSchedule": { + "cancun": { + "target": 3, + "max": 6, + "baseFeeUpdateFraction": 3338477 + }, + "prague": { + "target": 6, + "max": 9, + "baseFeeUpdateFraction": 5007716 + } + }, "depositContractAddress": "0x4242424242424242424242424242424242424242" } diff --git a/params/chainspecs/mainnet.json b/params/chainspecs/mainnet.json index 349c5c8e2a4..f7c485a345e 100644 --- a/params/chainspecs/mainnet.json +++ b/params/chainspecs/mainnet.json @@ -19,6 +19,18 @@ "terminalTotalDifficultyPassed": true, "shanghaiTime": 1681338455, "cancunTime": 1710338135, + "blobSchedule": { + "cancun": { + "target": 3, + "max": 6, + "baseFeeUpdateFraction": 3338477 + }, + "prague": { + "target": 6, + "max": 9, + "baseFeeUpdateFraction": 5007716 + } + }, "depositContractAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "ethash": {} } diff --git a/params/chainspecs/sepolia.json b/params/chainspecs/sepolia.json index c584f3c05b7..033b2191129 100644 --- a/params/chainspecs/sepolia.json +++ b/params/chainspecs/sepolia.json @@ -17,6 +17,18 @@ "mergeNetsplitBlock": 1735371, "shanghaiTime": 1677557088, "cancunTime": 1706655072, + "blobSchedule": { + "cancun": { + "target": 3, + "max": 6, + "baseFeeUpdateFraction": 3338477 + }, + "prague": { + "target": 6, + "max": 9, + "baseFeeUpdateFraction": 5007716 + } + }, "depositContractAddress": "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D", "ethash": {} } diff --git a/params/config_test.go b/params/config_test.go index 913a052ce49..d58503e45f6 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -141,3 +141,39 @@ func TestGetBurntContract(t *testing.T) { require.NotNil(t, addr) assert.Equal(t, common.HexToAddress("0x000000000000000000000000000000000000dead"), *addr) } + +func TestMainnetBlobSchedule(t *testing.T) { + // Original EIP-4844 values + assert.Equal(t, uint64(6), MainnetChainConfig.GetMaxBlobsPerBlock(0)) + assert.Equal(t, uint64(786432), MainnetChainConfig.GetMaxBlobGasPerBlock(0)) + assert.Equal(t, uint64(393216), MainnetChainConfig.GetTargetBlobGasPerBlock(0)) + assert.Equal(t, uint64(3338477), MainnetChainConfig.GetBlobGasPriceUpdateFraction(0)) + + b := MainnetChainConfig.BlobSchedule + isPrague := false + assert.Equal(t, uint64(3), b.TargetBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(6), b.MaxBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(3338477), b.BaseFeeUpdateFraction(isPrague)) + + // EIP-7691: Blob throughput increase + isPrague = true + assert.Equal(t, uint64(6), b.TargetBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(9), b.MaxBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(5007716), b.BaseFeeUpdateFraction(isPrague)) +} + +func TestGnosisBlobSchedule(t *testing.T) { + b := GnosisChainConfig.BlobSchedule + + // Cancun values + isPrague := false + assert.Equal(t, uint64(1), b.TargetBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(2), b.MaxBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(1112826), b.BaseFeeUpdateFraction(isPrague)) + + // should remain the same in Pectra for Gnosis + isPrague = true + assert.Equal(t, uint64(1), b.TargetBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(2), b.MaxBlobsPerBlock(isPrague)) + assert.Equal(t, uint64(1112826), b.BaseFeeUpdateFraction(isPrague)) +} diff --git a/txnprovider/txpool/assemble.go b/txnprovider/txpool/assemble.go index afd3cffd492..5d2dcdbc825 100644 --- a/txnprovider/txpool/assemble.go +++ b/txnprovider/txpool/assemble.go @@ -19,7 +19,6 @@ package txpool import ( "context" "math/big" - "time" "github.com/c2h5oh/datasize" "github.com/holiman/uint256" @@ -56,7 +55,6 @@ func Assemble( } chainID, _ := uint256.FromBig(chainConfig.ChainID) - maxBlobsPerBlock := chainConfig.GetMaxBlobsPerBlock(uint64(time.Now().Second())) shanghaiTime := chainConfig.ShanghaiTime var agraBlock *big.Int @@ -68,7 +66,6 @@ func Assemble( if cfg.OverridePragueTime != nil { pragueTime = cfg.OverridePragueTime } - maxBlobsPerBlockPrague := chainConfig.MaxBlobGasPerBlockPrague newTxns := make(chan Announcements, 1024) newSlotsStreams := &NewSlotsStreams{} @@ -84,8 +81,7 @@ func Assemble( agraBlock, cancunTime, pragueTime, - maxBlobsPerBlock, - maxBlobsPerBlockPrague, + chainConfig.BlobSchedule, sentryClients, stateChangesClient, builderNotifyNewTxns, diff --git a/txnprovider/txpool/pool.go b/txnprovider/txpool/pool.go index bcf70b216d1..5e8ec711dd3 100644 --- a/txnprovider/txpool/pool.go +++ b/txnprovider/txpool/pool.go @@ -143,8 +143,7 @@ type TxPool struct { isPostCancun atomic.Bool pragueTime *uint64 isPostPrague atomic.Bool - maxBlobsPerBlock uint64 - maxBlobsPerBlockPrague *uint64 + blobSchedule *chain.BlobSchedule feeCalculator FeeCalculator p2pFetcher *Fetch p2pSender *Send @@ -170,8 +169,7 @@ func New( agraBlock *big.Int, cancunTime *big.Int, pragueTime *big.Int, - maxBlobsPerBlock uint64, - maxBlobsPerBlockPrague *uint64, + blobSchedule *chain.BlobSchedule, sentryClients []sentryproto.SentryClient, stateChangesClient StateChangesClient, builderNotifyNewTxns func(), @@ -224,8 +222,7 @@ func New( unprocessedRemoteByHash: map[string]int{}, minedBlobTxnsByBlock: map[uint64][]*metaTxn{}, minedBlobTxnsByHash: map[string]*metaTxn{}, - maxBlobsPerBlock: maxBlobsPerBlock, - maxBlobsPerBlockPrague: maxBlobsPerBlockPrague, + blobSchedule: blobSchedule, feeCalculator: options.feeCalculator, builderNotifyNewTxns: builderNotifyNewTxns, newSlotsStreams: newSlotsStreams, @@ -1097,14 +1094,7 @@ func (p *TxPool) isPrague() bool { } func (p *TxPool) GetMaxBlobsPerBlock() uint64 { - if p.isPrague() { - if p.maxBlobsPerBlockPrague != nil { - return *p.maxBlobsPerBlockPrague - } - return 9 // EIP-7691 default - } else { - return p.maxBlobsPerBlock - } + return p.blobSchedule.MaxBlobsPerBlock(p.isPrague()) } // Check that the serialized txn should not exceed a certain max size diff --git a/txnprovider/txpool/pool_fuzz_test.go b/txnprovider/txpool/pool_fuzz_test.go index edd13ed4931..da86d7496aa 100644 --- a/txnprovider/txpool/pool_fuzz_test.go +++ b/txnprovider/txpool/pool_fuzz_test.go @@ -30,7 +30,6 @@ import ( "github.com/erigontech/erigon-lib/common" "github.com/erigontech/erigon-lib/common/datadir" - "github.com/erigontech/erigon-lib/common/fixedgas" "github.com/erigontech/erigon-lib/common/u256" "github.com/erigontech/erigon-lib/gointerfaces" remote "github.com/erigontech/erigon-lib/gointerfaces/remoteproto" @@ -325,7 +324,7 @@ func FuzzOnNewBlocks(f *testing.F) { cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) err = pool.start(ctx) @@ -551,7 +550,7 @@ func FuzzOnNewBlocks(f *testing.F) { check(p2pReceived, TxnSlots{}, "after_flush") checkNotify(p2pReceived, TxnSlots{}, "after_flush") - p2, err := New(ctx, ch, db, coreDB, txpoolcfg.DefaultConfig, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + p2, err := New(ctx, ch, db, coreDB, txpoolcfg.DefaultConfig, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) p2.senders = pool.senders // senders are not persisted diff --git a/txnprovider/txpool/pool_test.go b/txnprovider/txpool/pool_test.go index f8c1be071e3..b5c659cd53f 100644 --- a/txnprovider/txpool/pool_test.go +++ b/txnprovider/txpool/pool_test.go @@ -59,7 +59,7 @@ func TestNonceFromAddress(t *testing.T) { db := memdb.NewTestPoolDB(t) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) var stateVersionID uint64 = 0 @@ -179,7 +179,7 @@ func TestMultipleAuthorizations(t *testing.T) { cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, common.Big0 /* shanghaiTime */, nil /* agraBlock */, common.Big0 /* cancunTime */, common.Big0 /* pragueTime */, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, common.Big0 /* shanghaiTime */, nil /* agraBlock */, common.Big0 /* cancunTime */, common.Big0 /* pragueTime */, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(t, err) require.True(t, pool != nil) @@ -431,7 +431,7 @@ func TestReplaceWithHigherFee(t *testing.T) { t.Cleanup(cancel) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.NotEqual(nil, pool) var stateVersionID uint64 = 0 @@ -548,7 +548,7 @@ func TestReverseNonces(t *testing.T) { t.Cleanup(cancel) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) var stateVersionID uint64 = 0 @@ -672,7 +672,7 @@ func TestTxnPoke(t *testing.T) { t.Cleanup(cancel) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) var stateVersionID uint64 = 0 @@ -897,7 +897,7 @@ func TestShanghaiValidateTxn(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) cache := &kvcache.DummyCache{} - pool, err := New(ctx, ch, nil, coreDB, cfg, cache, *u256.N1, shanghaiTime, nil /* agraBlock */, nil /* cancunTime */, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, logger, WithFeeCalculator(nil)) + pool, err := New(ctx, ch, nil, coreDB, cfg, cache, *u256.N1, shanghaiTime, nil /* agraBlock */, nil /* cancunTime */, nil, nil, nil, nil, func() {}, nil, logger, WithFeeCalculator(nil)) asrt.NoError(err) tx, err := coreDB.BeginRw(ctx) defer tx.Rollback() @@ -944,7 +944,7 @@ func TestTooHighGasLimitTxnValidation(t *testing.T) { t.Cleanup(cancel) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) var stateVersionID uint64 = 0 @@ -1004,7 +1004,7 @@ func TestSetCodeTxnValidationWithLargeAuthorizationValues(t *testing.T) { cache := &kvcache.DummyCache{} logger := log.New() pool, err := New(ctx, ch, nil, coreDB, cfg, cache, chainID, common.Big0 /* shanghaiTime */, nil, /* agraBlock */ - common.Big0 /* cancunTime */, common.Big0 /* pragueTime */, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, logger, WithFeeCalculator(nil)) + common.Big0 /* cancunTime */, common.Big0 /* pragueTime */, nil, nil, nil, func() {}, nil, logger, WithFeeCalculator(nil)) assert.NoError(t, err) pool.blockGasLimit.Store(30_000_000) tx, err := coreDB.BeginRw(ctx) @@ -1052,7 +1052,7 @@ func TestBlobTxnReplacement(t *testing.T) { t.Cleanup(cancel) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, common.Big0, nil, common.Big0, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, common.Big0, nil, common.Big0, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) @@ -1230,7 +1230,7 @@ func TestDropRemoteAtNoGossip(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) - txnPool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, big.NewInt(0), big.NewInt(0), nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, logger, WithFeeCalculator(nil)) + txnPool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, nil, func() {}, nil, logger, WithFeeCalculator(nil)) assert.NoError(err) require.True(txnPool != nil) @@ -1335,7 +1335,7 @@ func TestBlobSlots(t *testing.T) { cfg.TotalBlobPoolLimit = 20 sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, common.Big0, nil, common.Big0, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, common.Big0, nil, common.Big0, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) var stateVersionID uint64 = 0 @@ -1409,7 +1409,7 @@ func TestGasLimitChanged(t *testing.T) { db := memdb.NewTestPoolDB(t) cfg := txpoolcfg.DefaultConfig sendersCache := kvcache.New(kvcache.DefaultCoherentConfig) - pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, fixedgas.DefaultMaxBlobsPerBlock, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) + pool, err := New(ctx, ch, db, coreDB, cfg, sendersCache, *u256.N1, nil, nil, nil, nil, nil, nil, nil, func() {}, nil, log.New(), WithFeeCalculator(nil)) assert.NoError(err) require.True(pool != nil) var stateVersionID uint64 = 0