Skip to content

Commit 4ac5ff8

Browse files
authored
Revert "core, eth/downloader, params: validate blob tx bodies (ethereum#27392)"
This reverts commit b606e38.
1 parent 0e3b9a8 commit 4ac5ff8

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

core/block_validator.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,7 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
8484
// Blob transactions may be present after the Cancun fork.
8585
var blobs int
8686
for _, tx := range block.Transactions() {
87-
// Count the number of blobs to validate against the header's dataGasUsed
8887
blobs += len(tx.BlobHashes())
89-
90-
// Validate the data blobs individually too
91-
if tx.Type() == types.BlobTxType {
92-
if tx.To() == nil {
93-
return errors.New("contract creation attempt by blob transaction") // TODO(karalabe): Why not make the field non-nil-able
94-
}
95-
if len(tx.BlobHashes()) == 0 {
96-
return errors.New("no-blob blob transaction present in block body")
97-
}
98-
for _, hash := range tx.BlobHashes() {
99-
if hash[0] != params.BlobTxHashVersion {
100-
return fmt.Errorf("blob hash version mismatch (have %d, supported %d)", hash[0], params.BlobTxHashVersion)
101-
}
102-
}
103-
}
10488
}
10589
if header.DataGasUsed != nil {
10690
if want := *header.DataGasUsed / params.BlobTxDataGasPerBlob; uint64(blobs) != want { // div because the header is surely good vs the body might be bloated

eth/downloader/queue.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -801,23 +801,7 @@ func (q *queue) DeliverBodies(id string, txLists [][]*types.Transaction, txListH
801801
// and zero before the Cancun hardfork
802802
var blobs int
803803
for _, tx := range txLists[index] {
804-
// Count the number of blobs to validate against the header's dataGasUsed
805804
blobs += len(tx.BlobHashes())
806-
807-
// Validate the data blobs individually too
808-
if tx.Type() == types.BlobTxType {
809-
if tx.To() == nil {
810-
return errInvalidBody // TODO(karalabe): Why not make the field non-nil-able
811-
}
812-
if len(tx.BlobHashes()) == 0 {
813-
return errInvalidBody
814-
}
815-
for _, hash := range tx.BlobHashes() {
816-
if hash[0] != params.BlobTxHashVersion {
817-
return errInvalidBody
818-
}
819-
}
820-
}
821805
}
822806
if header.DataGasUsed != nil {
823807
if want := *header.DataGasUsed / params.BlobTxDataGasPerBlob; uint64(blobs) != want { // div because the header is surely good vs the body might be bloated

params/protocol_params.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ const (
160160
RefundQuotient uint64 = 2
161161
RefundQuotientEIP3529 uint64 = 5
162162

163-
BlobTxHashVersion = 0x01 // Version byte of the commitment hash
164163
BlobTxMaxDataGasPerBlock = 1 << 19 // Maximum consumable data gas for data blobs per block
165164
BlobTxTargetDataGasPerBlock = 1 << 18 // Target consumable data gas for data blobs per block (for 1559-like pricing)
166165
BlobTxDataGasPerBlob = 1 << 17 // Gas consumption of a single data blob (== blob byte size)

0 commit comments

Comments
 (0)