Skip to content

Commit

Permalink
fix: update process_attestation for deneb (ReamLabs#113)
Browse files Browse the repository at this point in the history
* fix: update process_attestation for deneb

* chore: sort with operation_name
  • Loading branch information
syjn99 authored Feb 21, 2025
1 parent 26578a3 commit b7b4d92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions crates/common/consensus/src/deneb/beacon_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,12 @@ impl BeaconState {
}

pub fn add_flag(flags: u8, flag_index: u8) -> u8 {
let flag = 2 << flag_index;
let flag = 1 << flag_index;
flags | flag
}

pub fn has_flag(flags: u8, flag_index: u8) -> bool {
let flag = 2 << flag_index;
let flag = 1 << flag_index;
flags & flag == flag
}

Expand Down Expand Up @@ -647,7 +647,7 @@ impl BeaconState {
if is_matching_source && inclusion_delay <= (SLOTS_PER_EPOCH as f64).sqrt() as u64 {
participation_flag_indices.push(TIMELY_SOURCE_FLAG_INDEX);
}
if is_matching_target && inclusion_delay <= SLOTS_PER_EPOCH {
if is_matching_target {
participation_flag_indices.push(TIMELY_TARGET_FLAG_INDEX);
}
if is_matching_head && inclusion_delay == MIN_ATTESTATION_INCLUSION_DELAY {
Expand Down
13 changes: 7 additions & 6 deletions testing/ef-tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ test_consensus_type!(VoluntaryExit);
test_consensus_type!(Withdrawal);

// Testing operations for block processing
test_operation!(attestation, Attestation, "attestation", process_attestation);
test_operation!(
bls_to_execution_change,
SignedBLSToExecutionChange,
"address_change",
process_bls_to_execution_change
);
test_operation!(deposit, Deposit, "deposit", process_deposit);
test_operation!(
voluntary_exit,
Expand All @@ -78,12 +85,6 @@ test_operation!(
"execution_payload",
process_withdrawals
);
test_operation!(
bls_to_execution_change,
SignedBLSToExecutionChange,
"address_change",
process_bls_to_execution_change
);

// Testing shuffling
test_shuffling!();

0 comments on commit b7b4d92

Please sign in to comment.