mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-19 19:09:08 +00:00
attempt to recover columns while backfilling
This commit is contained in:
parent
6ae1418e91
commit
18fe511cc2
@ -212,7 +212,8 @@ proc storeBackfillBlock(
|
||||
|
||||
# if not blobsOk:
|
||||
# return err(VerifierError.Invalid)
|
||||
|
||||
|
||||
var malformed_cols: seq[int]
|
||||
when typeof(signedBlock).kind >= ConsensusFork.Deneb:
|
||||
if dataColumnsOpt.isSome:
|
||||
let data_columns = dataColumnsOpt.get()
|
||||
@ -221,6 +222,7 @@ proc storeBackfillBlock(
|
||||
for i in 0..<data_columns.len:
|
||||
let r = verify_data_column_sidecar_kzg_proofs(data_columns[i][])
|
||||
if r.isErr():
|
||||
malformed_cols.add(i)
|
||||
debug "backfill data column validation failed",
|
||||
blockRoot = shortLog(signedBlock.root),
|
||||
column_sidecar = shortLog(data_columns[i][]),
|
||||
@ -229,8 +231,20 @@ proc storeBackfillBlock(
|
||||
msg = r.error()
|
||||
columnsOk = r.isOk()
|
||||
|
||||
if not columnsOk:
|
||||
if dataColumnsOpt.isSome:
|
||||
let
|
||||
data_columns = dataColumnsOpt.get
|
||||
recovered_cps =
|
||||
recover_cells_and_proofs(data_columns.mapIt(it[]), signedBlock)
|
||||
recovered_cols = signedBlock.get_data_column_sidecars(recovered_cps.get)
|
||||
|
||||
for mc in malformed_cols:
|
||||
data_columns[mc][] = recovered_cols[mc]
|
||||
columnsOk = true
|
||||
|
||||
if not columnsOk:
|
||||
return err(VerifierError.Invalid)
|
||||
return err(VerifierError.Invalid)
|
||||
|
||||
let res = self.consensusManager.dag.addBackfillBlock(signedBlock)
|
||||
|
||||
|
@ -407,7 +407,8 @@ proc processDataColumnSidecar*(
|
||||
reconstructed_columns =
|
||||
self.processReconstructionFromGossip(forkyBlck, columns)
|
||||
for rc in reconstructed_columns.get:
|
||||
self.dataColumnQuarantine[].put(newClone(rc))
|
||||
if rc notin self.dataColumnQuarantine[].gatherDataColumns(forkyBlck):
|
||||
self.dataColumnQuarantine[].put(newClone(rc))
|
||||
self.blockProcessor[].enqueueBlock(
|
||||
MsgSource.gossip, columnless,
|
||||
Opt.none(BlobSidecars),
|
||||
|
@ -360,6 +360,8 @@ proc get_data_column_sidecars*(signed_beacon_block: deneb.SignedBeaconBlock |
|
||||
column_cells.add(flattened_cells[row_index][column_index])
|
||||
column_proofs.add(flattened_proofs[row_index][column_index])
|
||||
|
||||
column_proofs.setLen(blck.body.blob_kzg_commitments.len)
|
||||
|
||||
var sidecar = DataColumnSidecar(
|
||||
index: ColumnIndex(column_index),
|
||||
column: DataColumn.init(column_cells),
|
||||
|
Loading…
x
Reference in New Issue
Block a user