Skip to content

Commit 1de750f

Browse files
committed
core: check absence of blob sidecar in InsertReceiptChain
1 parent 67fec27 commit 1de750f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/blockchain.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,14 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
10451045
} else {
10461046
liveBlocks, liveReceipts = append(liveBlocks, block), append(liveReceipts, receiptChain[i])
10471047
}
1048+
1049+
// Here we also validate that blob transactions in the block do not contain a sidecar.
1050+
// While the sidecar does not affect the block hash / tx hash, sending blobs within a block is not allowed.
1051+
for txIndex, tx := range block.Transactions() {
1052+
if tx.Type() == types.BlobTxType && tx.BlobSidecar() != nil {
1053+
return 0, fmt.Errorf("block #%d contains unexpected blob sidecar in tx at index %d", block.NumberU64(), txIndex)
1054+
}
1055+
}
10481056
}
10491057

10501058
var (

0 commit comments

Comments
 (0)