mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
core/txpool/blobpool: bump per blob overhead
This commit is contained in:
parent
dd99cf07e4
commit
0a061be6a0
3 changed files with 18 additions and 20 deletions
|
|
@ -51,14 +51,18 @@ const (
|
||||||
// transaction. There can be multiple of these embedded into a single tx.
|
// transaction. There can be multiple of these embedded into a single tx.
|
||||||
blobSize = params.BlobTxFieldElementsPerBlob * params.BlobTxBytesPerFieldElement
|
blobSize = params.BlobTxFieldElementsPerBlob * params.BlobTxBytesPerFieldElement
|
||||||
|
|
||||||
|
// proofSize is the size in bytes that each cell proof requires.
|
||||||
|
proofSize = kzg4844.CellProofsPerBlob * 48
|
||||||
|
|
||||||
// txAvgSize is an approximate byte size of a transaction metadata to avoid
|
// txAvgSize is an approximate byte size of a transaction metadata to avoid
|
||||||
// tiny overflows causing all txs to move a shelf higher, wasting disk space.
|
// tiny overflows causing all txs to move a shelf higher, wasting disk space.
|
||||||
txAvgSize = 4 * 1024
|
txAvgSize = 4 * 1024
|
||||||
|
|
||||||
// txBlobOverhead is an approximation of the overhead that an additional blob
|
// txBlobOverhead is an approximation of the overhead that an additional blob
|
||||||
// has on transaction size. This is added to the slotter to avoid
|
// has on transaction size. This is added to the slotter to avoid tiny
|
||||||
// tiny overflows causing all txs to move a shelf higher, wasting disk space.
|
// overflows causing all txs to move a shelf higher, wasting disk space. A
|
||||||
txBlobOverhead = 2048
|
// small buffer is added to the proof overhead.
|
||||||
|
txBlobOverhead = kzg4844.CellProofsPerBlob*proofSize + 64
|
||||||
|
|
||||||
// txMaxSize is the maximum size a single transaction can have, outside
|
// txMaxSize is the maximum size a single transaction can have, outside
|
||||||
// the included blobs. Since blob transactions are pulled instead of pushed,
|
// the included blobs. Since blob transactions are pulled instead of pushed,
|
||||||
|
|
|
||||||
|
|
@ -82,13 +82,7 @@ func TestNewSlotterEIP7594(t *testing.T) {
|
||||||
5*blobSize + 5*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
5*blobSize + 5*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
||||||
6*blobSize + 6*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
6*blobSize + 6*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
||||||
7*blobSize + 7*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
7*blobSize + 7*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
||||||
8*blobSize + 8*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
8*blobSize + 8*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos >= 4 blobs + max tx metadata size
|
||||||
9*blobSize + 9*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
|
||||||
10*blobSize + 10*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
|
||||||
11*blobSize + 11*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
|
||||||
12*blobSize + 12*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
|
||||||
13*blobSize + 13*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos < 4 blobs + max tx metadata size
|
|
||||||
14*blobSize + 14*txBlobOverhead + txAvgSize, // 1-6 blobs + unexpectedly large tx infos >= 4 blobs + max tx metadata size
|
|
||||||
}
|
}
|
||||||
if len(shelves) != len(want) {
|
if len(shelves) != len(want) {
|
||||||
t.Errorf("shelves count mismatch: have %d, want %d", len(shelves), len(want))
|
t.Errorf("shelves count mismatch: have %d, want %d", len(shelves), len(want))
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@ var (
|
||||||
blobT = reflect.TypeFor[Blob]()
|
blobT = reflect.TypeFor[Blob]()
|
||||||
commitmentT = reflect.TypeFor[Commitment]()
|
commitmentT = reflect.TypeFor[Commitment]()
|
||||||
proofT = reflect.TypeFor[Proof]()
|
proofT = reflect.TypeFor[Proof]()
|
||||||
|
|
||||||
CellProofsPerBlob = 128
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const CellProofsPerBlob = 128
|
||||||
|
|
||||||
// Blob represents a 4844 data blob.
|
// Blob represents a 4844 data blob.
|
||||||
type Blob [131072]byte
|
type Blob [131072]byte
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue