Skip to content

Commit 8dcb6a3

Browse files
miner: fix payload building
1 parent 49d560d commit 8dcb6a3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

beacon/engine/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ func BlockToExecutableData(block *types.Block, fees *big.Int, blobs []kzg4844.Bl
262262
Proofs: make([]hexutil.Bytes, 0),
263263
}
264264
for i := range blobs {
265-
blobsBundle.Commitments = append(blobsBundle.Commitments, hexutil.Bytes(commitments[i][:]))
266265
blobsBundle.Blobs = append(blobsBundle.Blobs, hexutil.Bytes(blobs[i][:]))
266+
blobsBundle.Commitments = append(blobsBundle.Commitments, hexutil.Bytes(commitments[i][:]))
267267
blobsBundle.Proofs = append(blobsBundle.Proofs, hexutil.Bytes(proofs[i][:]))
268268
}
269269
return &ExecutionPayloadEnvelope{ExecutionPayload: data, BlockValue: fees, BlobsBundle: &blobsBundle}

miner/worker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,10 @@ func (w *worker) commitTransaction(env *environment, tx *txpool.Transaction) ([]
759759
snap = env.state.Snapshot()
760760
gp = env.gasPool.Gas()
761761
)
762+
// TODO (MariusVanDerWijden): Move this check
763+
if len(env.blobs)+len(tx.BlobHashes())*params.BlobTxDataGasPerBlob > params.BlobTxMaxDataGasPerBlock {
764+
return nil, errors.New("max data blobs reached")
765+
}
762766
receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &env.coinbase, env.gasPool, env.state, env.header, tx.Tx, &env.header.GasUsed, *w.chain.GetVMConfig())
763767
if err != nil {
764768
env.state.RevertToSnapshot(snap)

0 commit comments

Comments
 (0)