Skip to content

Commit 7539ab9

Browse files
core/txpool/blobpool: factor out peerdas slotter
1 parent e5b7df3 commit 7539ab9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

core/txpool/blobpool/slotter.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ package blobpool
2626
// allowed in the current protocol, having an empty shelf is not a relevant use
2727
// of resources, but it makes stress testing with junk transactions simpler.
2828
func newSlotter(maxBlobsPerTransaction int) func() (uint32, bool) {
29+
slotsize := uint32(txAvgSize)
30+
slotsize -= uint32(blobSize) // underflows, it's ok, will overflow back in the first return
31+
32+
return func() (size uint32, done bool) {
33+
slotsize += blobSize
34+
finished := slotsize > uint32(maxBlobsPerTransaction)*blobSize+txMaxSize
35+
36+
return slotsize, finished
37+
}
38+
}
39+
40+
// newSlotterEIP7594 creates a different slotter for EIP-7594 transactions.
41+
// EIP-7594 (PeerDAS) changes the median transaction size which means the current
42+
// static 4KB average size is not enough anymore.
43+
// This slotter adds a dynamic overhead component to the slotter, which also
44+
// captures the notion that blob transactions with more blobs are also more likely to
45+
// to have more calldata.
46+
func newSlotterEIP7594(maxBlobsPerTransaction int) func() (uint32, bool) {
2947
slotsize := uint32(txAvgSize)
3048
slotsize -= uint32(blobSize) + txBlobOverhead // underflows, it's ok, will overflow back in the first return
3149

0 commit comments

Comments
 (0)