Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Panic on invalid unsigned election solution. #6485

Merged
4 commits merged into from
Jun 25, 2020
Merged
Changes from 2 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
13 changes: 8 additions & 5 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2201,11 +2201,14 @@ decl_module! {
score,
era,
size,
)
// TODO: instead of returning an error, panic. This makes the entire produced block
// invalid.
// This ensures that block authors will not ever try and submit a solution which is not
// an improvement, since they will lose their authoring points/rewards.
).expect(
"An unsigned solution can only be submitted by validators; A validator should \
always produce correct solutions, else this block should not be imported, thus \
effectively depriving the validators from their authoring reward. Hence, this panic
is expected."
);

Ok(None.into())
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down