Fill in missing BlobSidecar gossip check (#4863)

This commit is contained in:
henridf 2023-04-26 19:33:33 +02:00 committed by GitHub
parent 6c3b9fdf36
commit ea8ef5799e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -292,7 +292,7 @@ proc processSignedBlobSidecar*(
debug "Blob received", delay debug "Blob received", delay
let v = let v =
self.dag.validateBlobSidecar(self.quarantine, self.dag.validateBlobSidecar(self.quarantine, self.blob_quarantine,
signedBlobSidecar, wallTime, idx) signedBlobSidecar, wallTime, idx)
if v.isErr(): if v.isErr():

View File

@ -16,8 +16,8 @@ import
../spec/[ ../spec/[
beaconstate, state_transition_block, forks, helpers, network, signatures], beaconstate, state_transition_block, forks, helpers, network, signatures],
../consensus_object_pools/[ ../consensus_object_pools/[
attestation_pool, blockchain_dag, block_quarantine, exit_pool, spec_cache, attestation_pool, blockchain_dag, blob_quarantine, block_quarantine,
light_client_pool, sync_committee_msg_pool], exit_pool, spec_cache, light_client_pool, sync_committee_msg_pool],
".."/[beacon_clock], ".."/[beacon_clock],
./batch_validation ./batch_validation
@ -223,7 +223,7 @@ template validateBeaconBlockBellatrix(
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/p2p-interface.md#blob_sidecar_index # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.5/specs/deneb/p2p-interface.md#blob_sidecar_index
proc validateBlobSidecar*( proc validateBlobSidecar*(
dag: ChainDAGRef, quarantine: ref Quarantine, dag: ChainDAGRef, quarantine: ref Quarantine,
sbs: SignedBlobSidecar, blobQuarantine: ref BlobQuarantine,sbs: SignedBlobSidecar,
wallTime: BeaconTime, idx: BlobIndex): Result[void, ValidationError] = wallTime: BeaconTime, idx: BlobIndex): Result[void, ValidationError] =
# [REJECT] The sidecar is for the correct topic -- # [REJECT] The sidecar is for the correct topic --
@ -286,9 +286,10 @@ proc validateBlobSidecar*(
sbs.signature): sbs.signature):
return errReject("SignedBlobSidecar: invalid blob signature") return errReject("SignedBlobSidecar: invalid blob signature")
# [IGNORE] The sidecar is the only sidecar with valid signature received for the tuple (sidecar.block_root, sidecar.index). # [IGNORE] The sidecar is the only sidecar with valid signature
# TODO # received for the tuple (sidecar.block_root, sidecar.index).
# check that there isn't a conflicting sidecar in blob_quarantine if blobQuarantine[].hasBlob(sbs.message):
return errReject("SignedBlobSidecar: already have blob with valid signature")
ok() ok()