Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Fine tune
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathb1 committed Sep 15, 2023
1 parent 38fc5b4 commit 056b5a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
12 changes: 5 additions & 7 deletions txpool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,18 +727,16 @@ func TestBlobTxReplacement(t *testing.T) {
ch := make(chan types.Announcements, 5)
db, coreDB := memdb.NewTestPoolDB(t), memdb.NewTestDB(t)
cfg := txpoolcfg.DefaultConfig
sendersCache := kvcache.New(kvcache.DefaultCoherentConfig)
pool, err := New(ch, coreDB, cfg, sendersCache, *u256.N1, nil, common.Big0, log.New())
pool, err := New(ch, coreDB, cfg, &kvcache.DummyCache{}, *u256.N1, nil, common.Big0, log.New())
assert.NoError(err)
require.True(pool != nil)
ctx := context.Background()
var stateVersionID uint64 = 0
pendingBaseFee := uint64(200_000)

h1 := gointerfaces.ConvertHashToH256([32]byte{})
change := &remote.StateChangeBatch{
StateVersionId: stateVersionID,
PendingBlockBaseFee: pendingBaseFee,
PendingBlockBaseFee: 200_000,
BlockGasLimit: 1000000,
PendingBlobFeePerGas: 100_000,
ChangeBatch: []*remote.StateChange{
Expand Down Expand Up @@ -832,7 +830,7 @@ func TestBlobTxReplacement(t *testing.T) {
blobTxn.Nonce = 0x2
txSlots := types.TxSlots{}

//Get the config of the pool for BlobPriceBump and bump all prices
//Get the config of the pool for BlobPriceBump and bump ALL prices
requiredPriceBump := pool.cfg.BlobPriceBump
blobTxn.Tip.MulDivOverflow(tip, uint256.NewInt(requiredPriceBump+100), uint256.NewInt(100))
blobTxn.FeeCap.MulDivOverflow(feeCap, uint256.NewInt(requiredPriceBump+100), uint256.NewInt(100))
Expand Down Expand Up @@ -865,8 +863,8 @@ func makeBlobTx() types.TxSlot {
blobRlpPrefix := hexutility.MustDecodeHex("ba020000")

var blob0, blob1 = gokzg4844.Blob{}, gokzg4844.Blob{}
copy(blob0[:], hexutility.MustDecodeHex(ValidBlob1))
copy(blob1[:], hexutility.MustDecodeHex(ValidBlob2))
copy(blob0[:], hexutility.MustDecodeHex(validBlob1))
copy(blob1[:], hexutility.MustDecodeHex(validBlob2))

var err error
proofsRlpPrefix := hexutility.MustDecodeHex("f862")
Expand Down
7 changes: 5 additions & 2 deletions txpool/testdata.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion txpool/txpoolcfg/txpoolcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var DefaultConfig = Config{

MinFeeCap: 1,
AccountSlots: 16, //TODO: to choose right value (16 to be compatible with Geth)
BlobSlots: 48, // Number of blobs (not txs) allowed per account
BlobSlots: 12, // Number of blobs (not txs) allowed per account
PriceBump: 10, // Price bump percentage to replace an already existing transaction
BlobPriceBump: 100,
}
Expand Down

0 comments on commit 056b5a8

Please sign in to comment.