Skip to content

Commit eea629b

Browse files
authored
core/txpool: drop support for v0 blob sidecar (#35191)
This PR drops support for v0 blob sidecar in blobpool. Since the osaka fork activation time has passed, these code paths are now unused. It is assumed that only v1 transactions exist in the blobpool.
1 parent af7bf37 commit eea629b

11 files changed

Lines changed: 69 additions & 304 deletions

File tree

cmd/devp2p/internal/ethtest/suite.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,11 +1013,11 @@ func makeSidecar(data ...byte) *types.BlobTxSidecar {
10131013
for i := range blobs {
10141014
blobs[i][0] = data[i]
10151015
c, _ := kzg4844.BlobToCommitment(&blobs[i])
1016-
p, _ := kzg4844.ComputeBlobProof(&blobs[i], c)
1016+
cellProofs, _ := kzg4844.ComputeCellProofs(&blobs[i])
10171017
commitments = append(commitments, c)
1018-
proofs = append(proofs, p)
1018+
proofs = append(proofs, cellProofs...)
10191019
}
1020-
return types.NewBlobTxSidecar(types.BlobSidecarVersion0, blobs, commitments, proofs)
1020+
return types.NewBlobTxSidecar(types.BlobSidecarVersion1, blobs, commitments, proofs)
10211021
}
10221022

10231023
func (s *Suite) makeBlobTxs(count, blobs int, discriminator byte) (txs types.Transactions) {

core/txpool/blobpool/blobpool.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,17 @@ func encodeForNetwork(storedRLP []byte) ([]byte, error) {
228228

229229
// 2. Find the version of sidecar.
230230
version, _, err := rlp.SplitUint64(elems[1])
231-
if err != nil || version > 255 {
231+
if err != nil || version > 255 || version == 0 {
232232
return nil, fmt.Errorf("invalid version: %w", err)
233233
}
234-
versionByte := byte(version)
235234
// 3. Extract sidecar elements.
236235
commitmentsRLP := elems[2]
237236
proofsRLP := elems[3]
238237
blobsRLP := elems[4]
239238

240239
// 4. Reconstruct into the network format.
241-
var outer [][]byte
242-
if versionByte == types.BlobSidecarVersion0 {
243-
outer = [][]byte{txRLP, blobsRLP, commitmentsRLP, proofsRLP}
244-
} else {
245-
outer = [][]byte{txRLP, elems[1], blobsRLP, commitmentsRLP, proofsRLP}
246-
}
240+
outer := [][]byte{txRLP, elems[1], blobsRLP, commitmentsRLP, proofsRLP}
241+
247242
body, err := rlp.MergeListValues(outer)
248243
if err != nil {
249244
return nil, err
@@ -555,7 +550,7 @@ func (p *BlobPool) Init(gasTip uint64, head *types.Header, reserver txpool.Reser
555550
p.state = state
556551

557552
// Create new slotter for pre-Osaka blob configuration.
558-
slotter := newSlotter(params.BlobTxMaxBlobs)
553+
slotter := newSlotterEIP7594(params.BlobTxMaxBlobs)
559554

560555
// See if we need to migrate the queue blob store after fusaka
561556
slotter, err = tryMigrate(p.chain.Config(), slotter, queuedir)

0 commit comments

Comments
 (0)