unit-e icon indicating copy to clipboard operation
unit-e copied to clipboard

Creating a vote for non-finalized deposite crashes the node

Open kostyantyn opened this issue 6 years ago • 0 comments

Describe the bug If the deposit is not finalized and the vote for this deposit received, it crashes the node.

To Reproduce

  1. create a deposit
  2. 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);
    }

kostyantyn avatar Feb 19 '19 13:02 kostyantyn