unit-e
unit-e copied to clipboard
Creating a vote for non-finalized deposite crashes the node
Describe the bug If the deposit is not finalized and the vote for this deposit received, it crashes the node.
To Reproduce
- create a deposit
- send the vote for this deposit
Expected behavior The vote should be ignored. ~~We might want to consider it as a slashing condition.~~
Additional information
See function: void VoteRecorder::RecordVote
Specifically the issue is in this block:
if (offendingVote) {
esperanza::Result res = state->IsSlashable(vote, offendingVote.get().vote);
if (res == +esperanza::Result::SUCCESS) {
GetMainSignals().SlashingConditionDetected(VoteRecord{vote, voteSig},
offendingVote.get());
LogPrint(BCLog::FINALIZATION,
"%s: Slashable event found. Sending signal to the wallet.",
__func__);
} else {
// If this happens then it needs urgent attention and fixing
LogPrint(BCLog::FINALIZATION,
"ERROR: The offending vote found is not valid: %s, cannot "
"reliably identify slashable votes. Please fix.",
res._to_string());
assert(false);
}