Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: Fix failed attestation verification #2179

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion node/src/chain/header_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,13 @@ impl<'a, DB: database::DB> Validator<'a, DB> {

anyhow::ensure!(pk == &expected_pk, "Invalid generator. Expected {expected_pk:?}, actual {pk:?}");

let mut consensus_header =
candidate_block.to_consensus_header();
consensus_header.iteration = iter as u8;

let (_, rat_quorum, _) = verify_att(
att,
candidate_block.to_consensus_header(),
consensus_header,
self.prev_header.seed,
self.provisioners.current(),
RatificationResult::Fail(Vote::default()),
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/node/rusk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ fn slash(session: &mut Session, slash: Vec<Slash>) -> Result<Vec<Event>> {
node_data::ledger::SlashType::Hard => session.call::<_, ()>(
STAKE_CONTRACT,
"hard_slash",
&(provisioner, None::<u64>, None::<u64>),
&(provisioner, None::<u64>, None::<u8>),
u64::MAX,
),
node_data::ledger::SlashType::HardWithSeverity(severity) => session
Expand Down
Loading