Skip to content

Commit

Permalink
Merge of #5712
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 24, 2024
2 parents 758b58c + d137881 commit 5ac6ceb
Show file tree
Hide file tree
Showing 118 changed files with 5,064 additions and 1,729 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ smallvec = "1.11.2"
snap = "1"
ssz_types = "0.6"
strum = { version = "0.24", features = ["derive"] }
superstruct = "0.7"
superstruct = "0.8"
syn = "1"
sysinfo = "0.26"
tempfile = "3"
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/attestation_simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn produce_unaggregated_attestation<T: BeaconChainTypes>(
// Store the unaggregated attestation in the validator monitor for later processing
match chain.produce_unaggregated_attestation(current_slot, beacon_committee_index) {
Ok(unaggregated_attestation) => {
let data = &unaggregated_attestation.data;
let data = unaggregated_attestation.data();

debug!(
chain.log,
Expand Down
388 changes: 262 additions & 126 deletions beacon_node/beacon_chain/src/attestation_verification.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ where
.ok_or(BeaconChainError::ValidatorPubkeyCacheLockTimeout)?;

let mut signature_sets = Vec::with_capacity(num_indexed * 3);

// Iterate, flattening to get only the `Ok` values.
for indexed in indexing_results.iter().flatten() {
let signed_aggregate = &indexed.signed_aggregate;
let indexed_attestation = &indexed.indexed_attestation;
let fork = chain
.spec
.fork_at_epoch(indexed_attestation.data.target.epoch);
.fork_at_epoch(indexed_attestation.data().target.epoch);

signature_sets.push(
signed_aggregate_selection_proof_signature_set(
Expand All @@ -98,7 +97,7 @@ where
signature_sets.push(
indexed_attestation_signature_set_from_pubkeys(
|validator_index| pubkey_cache.get(validator_index).map(Cow::Borrowed),
&indexed_attestation.signature,
indexed_attestation.signature(),
indexed_attestation,
&fork,
chain.genesis_validators_root,
Expand Down Expand Up @@ -182,11 +181,11 @@ where
let indexed_attestation = &partially_verified.indexed_attestation;
let fork = chain
.spec
.fork_at_epoch(indexed_attestation.data.target.epoch);
.fork_at_epoch(indexed_attestation.data().target.epoch);

let signature_set = indexed_attestation_signature_set_from_pubkeys(
|validator_index| pubkey_cache.get(validator_index).map(Cow::Borrowed),
&indexed_attestation.signature,
indexed_attestation.signature(),
indexed_attestation,
&fork,
chain.genesis_validators_root,
Expand Down
2 changes: 2 additions & 0 deletions beacon_node/beacon_chain/src/attester_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use state_processing::state_advance::{partial_state_advance, Error as StateAdvan
use std::collections::HashMap;
use std::ops::Range;
use types::{
attestation::Error as AttestationError,
beacon_state::{
compute_committee_index_in_epoch, compute_committee_range_in_epoch, epoch_committee_count,
},
Expand Down Expand Up @@ -59,6 +60,7 @@ pub enum Error {
InverseRange {
range: Range<usize>,
},
AttestationError(AttestationError),
}

impl From<BeaconStateError> for Error {
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_block_reward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let mut previous_epoch_participation = state.previous_epoch_participation()?.clone();

for attestation in block.body().attestations() {
let data = &attestation.data;
let data = attestation.data();
let inclusion_delay = state.slot().safe_sub(data.slot)?.as_u64();
// [Modified in Deneb:EIP7045]
let participation_flag_indices = get_attestation_participation_flag_indices(
Expand Down
Loading

0 comments on commit 5ac6ceb

Please sign in to comment.