Skip to content

Commit

Permalink
Require 100% disputed transaction agreement if round takes too long
Browse files Browse the repository at this point in the history
  • Loading branch information
ximinez committed Feb 5, 2025
1 parent 9716f86 commit 76c27a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/xrpld/consensus/ConsensusParms.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ struct ConsensusParms
//! Percentage of nodes that must vote yes after we are stuck
std::size_t avSTUCK_CONSENSUS_PCT = 95;

//! Percentage of previous round duration before we are frozen
std::size_t avFROZEN_CONSENSUS_TIME = 400;

//! Percentage of nodes required to reach agreement on ledger close time
std::size_t avCT_CONSENSUS_PCT = 75;
};
Expand Down
6 changes: 5 additions & 1 deletion src/xrpld/consensus/DisputedTx.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@ DisputedTx<Tx_t, NodeID_t>::updateVote(
newPosition = weight > p.avMID_CONSENSUS_PCT;
else if (percentTime < p.avSTUCK_CONSENSUS_TIME)
newPosition = weight > p.avLATE_CONSENSUS_PCT;
else
else if (percentTime < p.avFROZEN_CONSENSUS_TIME)
newPosition = weight > p.avSTUCK_CONSENSUS_PCT;
else
// Only keep this tx if every node agrees on it
// Alternately, just vote no
newPosition = weight >= 100;

Check warning on line 234 in src/xrpld/consensus/DisputedTx.h

View check run for this annotation

Codecov / codecov/patch

src/xrpld/consensus/DisputedTx.h#L234

Added line #L234 was not covered by tests
}
else
{
Expand Down

0 comments on commit 76c27a0

Please sign in to comment.