enable dc in gossip and message router
This commit is contained in:
parent
318d656942
commit
fab427d65f
|
@ -530,10 +530,10 @@ proc validateDataColumnSidecar*(
|
||||||
|
|
||||||
# [REJECT] The sidecar's `kzg_commitments` inclusion proof is valid as verified by
|
# [REJECT] The sidecar's `kzg_commitments` inclusion proof is valid as verified by
|
||||||
# `verify_data_column_sidecar_inclusion_proof(sidecar)`.
|
# `verify_data_column_sidecar_inclusion_proof(sidecar)`.
|
||||||
# block:
|
block:
|
||||||
# let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar)
|
let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar)
|
||||||
# if v.isErr:
|
if v.isErr:
|
||||||
# return dag.checkedReject(v.error)
|
return dag.checkedReject(v.error)
|
||||||
|
|
||||||
# [IGNORE] The sidecar's block's parent (defined by
|
# [IGNORE] The sidecar's block's parent (defined by
|
||||||
# `block_header.parent_root`) has been seen (via both gossip and
|
# `block_header.parent_root`) has been seen (via both gossip and
|
||||||
|
|
|
@ -325,7 +325,7 @@ proc verify_data_column_sidecar_kzg_proofs*(sidecar: DataColumnSidecar): Result[
|
||||||
ok()
|
ok()
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/p2p-interface.md#verify_data_column_sidecar_inclusion_proof
|
# https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/p2p-interface.md#verify_data_column_sidecar_inclusion_proof
|
||||||
proc verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] =
|
func verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] =
|
||||||
# Verify if the given KZG commitments are included in the beacon block
|
# Verify if the given KZG commitments are included in the beacon block
|
||||||
let gindex = 11.GeneralizedIndex
|
let gindex = 11.GeneralizedIndex
|
||||||
if not is_valid_merkle_branch(
|
if not is_valid_merkle_branch(
|
||||||
|
|
|
@ -164,25 +164,25 @@ proc routeSignedBeaconBlock*(
|
||||||
blobRefs = Opt.some(blobs.mapIt(newClone(it)))
|
blobRefs = Opt.some(blobs.mapIt(newClone(it)))
|
||||||
|
|
||||||
var dataColumnRefs = Opt.none(DataColumnSidecars)
|
var dataColumnRefs = Opt.none(DataColumnSidecars)
|
||||||
# when typeof(blck).kind >= ConsensusFork.Deneb:
|
when typeof(blck).kind >= ConsensusFork.Deneb:
|
||||||
# if blobsOpt.isSome():
|
if blobsOpt.isSome():
|
||||||
# let blobs = blobsOpt.get()
|
let blobs = blobsOpt.get()
|
||||||
# let data_columns = get_data_column_sidecars(blck, blobs.mapIt(it.blob)).get()
|
let data_columns = get_data_column_sidecars(blck, blobs.mapIt(it.blob)).get()
|
||||||
# var das_workers = newSeq[Future[SendResult]](len(data_columns))
|
var das_workers = newSeq[Future[SendResult]](len(data_columns))
|
||||||
# for i in 0..<data_columns.lenu64:
|
for i in 0..<data_columns.lenu64:
|
||||||
# let subnet_id = compute_subnet_for_data_column_sidecar(i)
|
let subnet_id = compute_subnet_for_data_column_sidecar(i)
|
||||||
# das_workers[i] =
|
das_workers[i] =
|
||||||
# router[].network.broadcastDataColumnSidecar(subnet_id, data_columns[i])
|
router[].network.broadcastDataColumnSidecar(subnet_id, data_columns[i])
|
||||||
# let allres = await allFinished(das_workers)
|
let allres = await allFinished(das_workers)
|
||||||
# for i in 0..<allres.len:
|
for i in 0..<allres.len:
|
||||||
# let res = allres[i]
|
let res = allres[i]
|
||||||
# doAssert res.finished()
|
doAssert res.finished()
|
||||||
# if res.failed():
|
if res.failed():
|
||||||
# notice "Data Columns not sent",
|
notice "Data Columns not sent",
|
||||||
# data_column = shortLog(data_columns[i]), error = res.error[]
|
data_column = shortLog(data_columns[i]), error = res.error[]
|
||||||
# else:
|
else:
|
||||||
# notice "Data columns sent", data_column = shortLog(data_columns[i])
|
notice "Data columns sent", data_column = shortLog(data_columns[i])
|
||||||
# dataColumnRefs = Opt.some(data_columns.mapIt(newClone(it)))
|
dataColumnRefs = Opt.some(data_columns.mapIt(newClone(it)))
|
||||||
|
|
||||||
let added = await router[].blockProcessor[].addBlock(
|
let added = await router[].blockProcessor[].addBlock(
|
||||||
MsgSource.api, ForkedSignedBeaconBlock.init(blck), blobRefs, dataColumnRefs)
|
MsgSource.api, ForkedSignedBeaconBlock.init(blck), blobRefs, dataColumnRefs)
|
||||||
|
|
Loading…
Reference in New Issue