-
Notifications
You must be signed in to change notification settings - Fork 93
Txpool upgrades for EIP-4844 Blob Transactions #1075
Conversation
Depends on erigontech/interfaces#194 |
please don't merge erigon-lib PR if Erigon's CI is red. see: https://github.com/ledgerwatch/erigon-lib#dev-workflow |
PriceBump: 10, // Price bump percentage to replace an already existing transaction | ||
MinFeeCap: 1, | ||
AccountSlots: 16, //TODO: to choose right value (16 to be compatible with Geth) | ||
BlobSlots: 48, // Allows 8 txs of 6 blobs each - for hive tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: double check if we really need than many for Hive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out we do, but I added a flag for this. So will reduce the default. Not sure if normally many users should be sending many blobs and node operators in need could tune their nodes accordingly.
|
||
//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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably FeeCap & BlobFeeCap should be bumped by different amounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This two-dimensionality for replace txs could a little confusing, albeit not for target users. The rationale for continuing with a one-dimensional price bump (for 2D pricing) is that blob fee is burn-only and not paid to the node, while bumping both fields just makes the requirement to "go aggressive, or wait".
EIP-4844 proposed the new (type-3) Blob Transactions which are expensive (because blobs are big etc.). The tx-pool should be tightened to alleviate spam and dos attacks by way of these new transactions.
Changes
Keep blob txs cached
During new block, don't delete mined blobTxs, instead cache it till they are finalized. This is to avoid fetching them again for unwind. During unwind, if it's a previously seen blobTxn, try to fetch it from memory.
Pool config
BlobSlots: Similar to AccountSlots - limits how many blobs a single account is allowed to have until it's marked as spamming.
Blob txn priceBump: It's an added field in pool config (with a flag). Defaults to 100%, since blob txs of equal fee are costlier to process/execute