diff --git a/core/types/tx_blob.go b/core/types/tx_blob.go index bbfd3c98db3..040c3ae780a 100644 --- a/core/types/tx_blob.go +++ b/core/types/tx_blob.go @@ -402,12 +402,14 @@ func (tx *BlobTx) decode(input []byte) error { return err } var payload blobTxWithBlobs + var notV0 bool if secondElemKind == rlp.List { // No version byte: blob sidecar v0. payload = new(blobTxWithBlobsV0) } else { // It has a version byte. Decode as v1, version is checked by assign() payload = new(blobTxWithBlobsV1) + notV0 = true } if err := rlp.DecodeBytes(input, payload); err != nil { return err @@ -416,6 +418,9 @@ func (tx *BlobTx) decode(input []byte) error { if err := payload.assign(sc); err != nil { return err } + if notV0 && sc.Version == BlobSidecarVersion0 { + return errors.New("invalid blob encoding structure for version 0") + } *tx = *payload.tx() tx.Sidecar = sc return nil