miner: compute cell proofs on demand

This commit is contained in:
Marius van der Wijden 2025-04-08 15:40:02 +02:00 committed by MariusVanDerWijden
parent f98287a0ba
commit f2030acb52

View file

@ -394,10 +394,18 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
// Make sure all transactions after osaka have cell proofs
if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) {
if sidecar := tx.BlobTxSidecar(); sidecar != nil {
if len(sidecar.Blobs) != len(sidecar.Proofs)*kzg4844.CellProofsPerBlob {
log.Warn("Ignoring V1 blob transaction post-Osaka", "hash", ltx.Hash)
txs.Pop()
continue
if sidecar.Version == 0 {
log.Warn("Encountered Version 0 transaction post-Osaka, recompute proofs", "hash", ltx.Hash)
sidecar.Proofs = make([]kzg4844.Proof, 0)
for _, blob := range sidecar.Blobs {
cellProofs, err := kzg4844.ComputeCells(&blob)
if err != nil {
panic(err)
}
sidecar.Proofs = append(sidecar.Proofs, cellProofs...)
}
//txs.Pop()
//continue
}
}
}