update ShufflingRef version of get_attesting_indices to Electra v1.5.0-alpha.10 (#6801)

This commit is contained in:
tersec 2024-12-30 09:36:58 +00:00 committed by GitHub
parent 177897929b
commit 0e86c0d17e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 36 additions and 24 deletions

View File

@ -99,21 +99,30 @@ iterator get_attesting_indices*(shufflingRef: ShufflingRef,
if bits[index_in_committee]:
yield validator_index
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.0/specs/electra/beacon-chain.md#modified-get_attesting_indices
iterator get_attesting_indices*(shufflingRef: ShufflingRef,
slot: Slot,
committee_bits: AttestationCommitteeBits,
aggregation_bits: ElectraCommitteeValidatorsBits, on_chain: static bool):
ValidatorIndex =
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.10/specs/electra/beacon-chain.md#modified-get_attesting_indices
iterator get_attesting_indices*(
shufflingRef: ShufflingRef, slot: Slot,
committee_bits: AttestationCommitteeBits,
aggregation_bits: ElectraCommitteeValidatorsBits, on_chain: static bool):
ValidatorIndex =
when on_chain:
var pos = 0
for committee_index in get_committee_indices(committee_bits):
for _, validator_index in get_beacon_committee(
shufflingRef, slot, committee_index):
var committee_offset = 0
for committee_index in committee_bits.oneIndices:
if not (committee_index.uint64 <
get_committee_count_per_slot(shufflingRef)):
continue # invalid attestation, but found in check_attestation()
let committee = get_beacon_committee(
shufflingRef, slot, committee_index.CommitteeIndex)
if aggregation_bits[pos]:
yield validator_index
pos += 1
if aggregation_bits.len < committee_offset + len(committee):
# Would overflow, invalid attestation caught in check_attestation()
continue
for i, attester_index in committee:
if aggregation_bits[committee_offset + i]:
yield attester_index
committee_offset += len(committee)
else:
let committee_index = get_committee_index_one(committee_bits)
for validator_index in get_attesting_indices(

View File

@ -162,7 +162,7 @@ programMain:
db.putSyncCommittee(period, syncCommittee)
db.putLatestFinalizedHeader(finalizedHeader)
var optimisticFcuFut: Future[(PayloadExecutionStatus, Opt[BlockHash])]
var optimisticFcuFut: Future[(PayloadExecutionStatus, Opt[Hash32])]
.Raising([CancelledError])
proc onOptimisticHeader(
lightClient: LightClient, optimisticHeader: ForkedLightClientHeader) =

View File

@ -7,10 +7,6 @@
{.push raises: [].}
# At the time of writing, the exact definitions of what should be used for
# cryptography in the spec is in flux, with sizes and test vectors still being
# hashed out. This layer helps isolate those chagnes.
# BLS signatures can be combined such that multiple signatures are aggregated.
# Each time a new signature is added, the corresponding public key must be
# added to the verification key as well - if a key signs twice, it must be added

View File

@ -164,7 +164,7 @@ proc checkResponse(idList: seq[DataColumnIdentifier],
block_root = hash_tree_root(columns[i].signed_block_header.message)
id = idList[i]
# Check if the column reponse is a subset
# Check if the column response is a subset
if binarySearch(idList, columns[i], cmpSidecarIdentifier) == -1:
return false

View File

@ -1,8 +1,8 @@
# Validator client
In the most simple setup, a single beacon node paired with an execution client is all that is needed to run a successful validator setup.
In the simplest setup, a single beacon node paired with an execution client is all that is needed to run a successful validator setup.
Nimbus however also provides options for running advanded setups that provide additional security and redundancy.
Nimbus however also provides options for running advanced setups that provide additional security and redundancy.
See the [validator client page](./validator-client.md) to get started!

View File

@ -5,6 +5,8 @@
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.push raises: [].}
import
std/os,
confutils,
@ -45,9 +47,14 @@ type
name: "out-dir" }: OutDir
proc main =
let conf = load Config
let conf =
try:
load Config
except ConfigurationError:
error "Configuration error"
quit 1
if conf.threshold == 0:
error "The specified treshold must be greater than zero"
error "The specified threshold must be greater than zero"
quit 1
if conf.remoteSignersUrls.len == 0:
@ -55,7 +62,7 @@ proc main =
quit 1
if conf.threshold > conf.remoteSignersUrls.len.uint32:
error "The specified treshold must be lower or equal to the number of signers"
error "The specified threshold must be lower or equal to the number of signers"
quit 1
let rng = HmacDrbgContext.new()