update constants

This commit is contained in:
Agnish Ghosh 2024-07-02 20:33:09 +05:30
parent d8e1beff45
commit d0722cd465
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
2 changed files with 17 additions and 25 deletions

View File

@ -500,15 +500,11 @@ proc validateDataColumnSidecar*(
if not (data_column_sidecar.index < NUMBER_OF_COLUMNS):
return dag.checkedReject("DataColumnSidecar: The sidecar's index should be consistent with NUMBER_OF_COLUMNS")
debugEcho "1"
# [REJECT] The sidecar is for the correct subnet
# -- i.e. `compute_subnet_for_data_column_sidecar(blob_sidecar.index) == subnet_id`.
if not (compute_subnet_for_data_column_sidecar(data_column_sidecar.index) == subnet_id):
return dag.checkedReject("DataColumnSidecar: The sidecar is not for the correct subnet")
debugEcho "2"
# [IGNORE] The sidecar is not from a future slot (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance)
# -- i.e. validate that `block_header.slot <= current_slot` (a client MAY queue future sidecars for
# processing at the appropriate slot).
@ -532,16 +528,12 @@ proc validateDataColumnSidecar*(
block_header.slot, block_header.proposer_index, data_column_sidecar.index):
return errIgnore("DataColumnSidecar: already have valid data column from same proposer")
debugEcho "3"
# [REJECT] The sidecar's `kzg_commitments` inclusion proof is valid as verified by
# `verify_data_column_sidecar_inclusion_proof(sidecar)`.
block:
let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar)
if v.isErr:
return dag.checkedReject(v.error)
debugEcho "4"
# block:
# let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar)
# if v.isErr:
# return dag.checkedReject(v.error)
# [IGNORE] The sidecar's block's parent (defined by
# `block_header.parent_root`) has been seen (via both gossip and
@ -598,14 +590,14 @@ proc validateDataColumnSidecar*(
# [REJECT] The proposer signature of `blob_sidecar.signed_block_header`,
# is valid with respect to the `block_header.proposer_index` pubkey.
# if not verify_block_signature(
# dag.forkAtEpoch(block_header.slot.epoch),
# getStateField(dag.headState, genesis_validators_root),
# block_header.slot,
# block_root,
# dag.validatorKey(proposer).get(),
# data_column_sidecar.signed_block_header.signature):
# return dag.checkedReject("DataColumnSidecar: Invalid proposer signature")
if not verify_block_signature(
dag.forkAtEpoch(block_header.slot.epoch),
getStateField(dag.headState, genesis_validators_root),
block_header.slot,
block_root,
dag.validatorKey(proposer).get(),
data_column_sidecar.signed_block_header.signature):
return dag.checkedReject("DataColumnSidecar: Invalid proposer signature")
# [REJECT] The sidecar's column data is valid as
# verified by `verify_data_column_kzg_proofs(sidecar)`
@ -613,11 +605,11 @@ proc validateDataColumnSidecar*(
# let r = check_data_column_sidecar_kzg_proofs(data_column_sidecar)
# if r.isErr:
# return dag.checkedReject(r.error)
debugEcho "5"
# Send notification about new data column sidecar via callback
if not(isNil(dataColumnQuarantine.onDataColumnSidecarCallback)):
dataColumnQuarantine.onDataColumnSidecarCallback(data_column_sidecar)
debugEcho "6"
ok()

View File

@ -44,9 +44,9 @@ const
NUMBER_OF_COLUMNS* = 128
MAX_CELLS_IN_EXTENDED_MATRIX* = MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS
DATA_COLUMN_SIDECAR_SUBNET_COUNT* = 64
SAMPLES_PER_SLOT* = 16
CUSTODY_REQUIREMENT* = 4
DATA_COLUMN_SIDECAR_SUBNET_COUNT* = 32
SAMPLES_PER_SLOT* = 8
CUSTODY_REQUIREMENT* = 1
TARGET_NUMBER_OF_PEERS* = 70
type