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

Prevent amendment majority "flapping" (Version: 1.9.4) #4350

Closed
intelliot opened this issue Nov 21, 2022 · 3 comments · Fixed by #4410
Closed

Prevent amendment majority "flapping" (Version: 1.9.4) #4350

intelliot opened this issue Nov 21, 2022 · 3 comments · Fixed by #4410
Labels
Feature Request Used to indicate requests to add new features Food for Thought Ideas, moonshots, etc. Stuff to think about broadly. Not necessarily directly actionable. Request for Comments

Comments

@intelliot
Copy link
Collaborator

intelliot commented Nov 21, 2022

Summary

Improve the way amendment majorities are calculated in order to reduce the amount of "flapping" (an amendment repeatedly gaining and losing majority in a short period of time).

Motivation

An amendment can repeatedly gain and lose majority many times in a short period of time. Often, this occurs when an amendment is on the verge of gaining majority, and a validator not in favor of the amendment goes offline. The majority-calculating logic This creates noise and uncertainty about whether the amendment is on track to become activated.

Solution

A few different potential solutions have been proposed.

Currently, an amendment majority is calculated by dividing the number of Yeas (numerator) by the # of trusted validations received in that round (denominator). With 35 validators, an amendment that has 28 Yeas will not have "majority". But when one of the validators saying "Nay" misses a validation, then the calculation becomes 28/34, and the amendment gains majority. When the "Nay" validator resumes issuing validations, the amendment then loses majority. For example, at the time of writing, this is occurring to "CheckCashMakesTrustLine" (98DECF327BF79997AEC178323AD51A830E457BFC6D454DAF3E46E5EC42DC619F).

Instead of using "the # of trusted validations received in that round" as the denominator, the logic could instead use "the # of validators on my UNL".

Paths Not Taken

There could be a different threshold that must be met before an amendment loses majority (vs gaining majority). For example, amendments could gain majority with "Yeas" from > 80% of validators, and not lose majority until <= 65% of validators are saying "Yea".

@intelliot intelliot added the Feature Request Used to indicate requests to add new features label Nov 21, 2022
@RichardAH
Copy link
Collaborator

Crosspost from XRPLF mattermost:

What if we mapped validator keys to on-ledger accounts and made votes first class objects. Then flag ledgers are just used to tally them

This provides the same persistence mechanism everything else on the ledger has (by making it part of the ledger) and we also open the door for further changes for the price of a transactor amendment (rather than a consensus amendment.)

There’s a tool to turn validator pubkey into account ids here https:/RichardAH/xrpl-tools/tree/master/validator-address-tool

Other benefits include: validators could manage their votes inside a wallet by sending a txn to change their vote. The voting history is preserved in full history servers.

Tallying of the votes at flag ledger should ignore nUNL and only use actual UNL. Votes should be accompanied by some sort of UNL hash and the validator's current rippled version number so that other validators have a better idea of which votes might cause a fork.

@intelliot intelliot added Request for Comments Food for Thought Ideas, moonshots, etc. Stuff to think about broadly. Not necessarily directly actionable. High Priority labels Dec 4, 2022
a-noni-mousse added a commit to a-noni-mousse/rippled that referenced this issue Dec 5, 2022
This commit implements a new amendment that follows one of the
recommendations in XRPLF#4350 to reduce the flapping of
amendments when there is validator outage and support drops below
80% required majority.

The new threshold for deactivation of the countdown timer of an
an amendment is to go below 65% support.
@nbougalis nbougalis removed their assignment Dec 6, 2022
@nbougalis nbougalis linked a pull request Dec 6, 2022 that will close this issue
7 tasks
@nbougalis
Copy link
Contributor

I tried to assign this issue to @a-noni-mousse, who opened #4364 to address this, but I was unable to. Perhaps @intelliot can do it?

@intelliot
Copy link
Collaborator Author

I can't assign to @a-noni-mousse because they are not a collaborator for this repo. I invited them for read-only access; if they accept, then I think we may be able to assign them.

a-noni-mousse added a commit to a-noni-mousse/rippled that referenced this issue Jan 15, 2023
This commit implements a new amendment that follows one of the
recommendations in XRPLF#4350 to reduce the flapping of
amendments when there is validator outage and support drops below
80% required majority.

A new FlappingAmendment vector is used to track amendments that
lose majority and add delay of one flag ledger.
a-noni-mousse added a commit to a-noni-mousse/rippled that referenced this issue Jan 15, 2023
This commit implements a new amendment that follows one of the
recommendations in XRPLF#4350 to reduce the flapping of
amendments when there is validator outage and support drops below
80% required majority.

A new FlappingAmendment vector is used to track amendments that
lose majority and add delay of one flag ledger.
scottschurr added a commit to scottschurr/rippled that referenced this issue Feb 3, 2023
Amendment flapping usually occurs when an amendment is on
the verge of gaining majority, and a validator not in favor
of the amendment goes offline.

If fixAmendmentFlapping activates then two changes occur:

1. The number of validators in the UNL determines the required
threshold for an amendment to gain majority.

2. The AmendmentTable keeps a record of the most recent
Amendment vote received from each trusted validator in the
UNL.  If no validation arrives from a given validator, then
the AmendmentTable assumes that the previously received vote
has not changed.

Fixes XRPLF#4350
scottschurr added a commit to scottschurr/rippled that referenced this issue Jun 2, 2023
Amendment flapping usually occurs when an amendment is on
the verge of gaining majority, and a validator not in favor
of the amendment goes offline.

If fixAmendmentFlapping activates then two changes occur:

1. The number of validators in the UNL determines the required
threshold for an amendment to gain majority.

2. The AmendmentTable keeps a record of the most recent
Amendment vote received from each trusted validator in the
UNL.  If no validation arrives from a given validator, then
the AmendmentTable assumes that the previously received vote
has not changed.

Fixes XRPLF#4350
intelliot pushed a commit that referenced this issue Sep 28, 2023
Amendment "flapping" (an amendment repeatedly gaining and losing
majority) usually occurs when an amendment is on the verge of gaining
majority, and a validator not in favor of the amendment goes offline or
loses sync. This fix makes two changes:

1. The number of validators in the UNL determines the threshold required
   for an amendment to gain majority.
2. The AmendmentTable keeps a record of the most recent Amendment vote
   received from each trusted validator (and, with `trustChanged`, stays
   up-to-date when the set of trusted validators changes). If no
   validation arrives from a given validator, then the AmendmentTable
   assumes that the previously-received vote has not changed.

In other words, when missing an `STValidation` from a remote validator,
each server now uses the last vote seen. There is a 24 hour timeout for
recorded validator votes.

These changes do not require an amendment because they do not impact
transaction processing, but only the threshold at which each individual
validator decides to propose an EnableAmendment pseudo-transaction.

Fix #4350
sophiax851 pushed a commit to sophiax851/rippled that referenced this issue Jun 12, 2024
…LF#4410)

Amendment "flapping" (an amendment repeatedly gaining and losing
majority) usually occurs when an amendment is on the verge of gaining
majority, and a validator not in favor of the amendment goes offline or
loses sync. This fix makes two changes:

1. The number of validators in the UNL determines the threshold required
   for an amendment to gain majority.
2. The AmendmentTable keeps a record of the most recent Amendment vote
   received from each trusted validator (and, with `trustChanged`, stays
   up-to-date when the set of trusted validators changes). If no
   validation arrives from a given validator, then the AmendmentTable
   assumes that the previously-received vote has not changed.

In other words, when missing an `STValidation` from a remote validator,
each server now uses the last vote seen. There is a 24 hour timeout for
recorded validator votes.

These changes do not require an amendment because they do not impact
transaction processing, but only the threshold at which each individual
validator decides to propose an EnableAmendment pseudo-transaction.

Fix XRPLF#4350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Used to indicate requests to add new features Food for Thought Ideas, moonshots, etc. Stuff to think about broadly. Not necessarily directly actionable. Request for Comments
Projects
Archived in project
3 participants