Skip to content

Commit

Permalink
Use correct block epoch param used in slashing protection block propo…
Browse files Browse the repository at this point in the history
…sal validations
  • Loading branch information
povi committed Aug 8, 2024
1 parent 85b7917 commit 4e4325c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ arc-swap = { workspace = true }
bls = { workspace = true }
builder_api = { workspace = true }
futures = { workspace = true }
helper_functions = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
prometheus_metrics = { workspace = true }
Expand Down
11 changes: 9 additions & 2 deletions signer/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use futures::{
stream::{FuturesUnordered, TryStreamExt as _},
try_join, TryFutureExt as _,
};
use helper_functions::misc;
use itertools::{izip, Itertools as _};
use log::{info, warn};
use prometheus_metrics::Metrics;
Expand Down Expand Up @@ -227,6 +228,7 @@ impl Snapshot {
Ok(signature)
}

#[allow(clippy::too_many_lines)]
pub async fn sign_triples<P: Preset>(
&self,
triples: impl IntoIterator<Item = SigningTriple<'_, P>> + Send,
Expand Down Expand Up @@ -267,14 +269,19 @@ impl Snapshot {
));
}
SigningMessage::BeaconBlock(ref signing_block) => {
let slot = signing_block.slot();
let proposal = BlockProposal {
slot: signing_block.slot(),
slot,
signing_root: Some(signing_root),
};

block_messages.push((message, signing_root, public_key));
block_proposal_indices.push(index);
block_proposals.push((proposal, public_key, fork_info.fork.epoch));
block_proposals.push((
proposal,
public_key,
misc::compute_epoch_at_slot::<P>(slot),
));
}
SigningMessage::AggregationSlot { .. }
| SigningMessage::AggregateAndProof(_)
Expand Down

0 comments on commit 4e4325c

Please sign in to comment.