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

amendment: assign the serial number to the amendment list object #4602

Closed
wants to merge 1 commit into from

Conversation

a-noni-mousse
Copy link
Contributor

Tracking the serial number allows for check if amendments have changed since last check without checking of the list one by one

High Level Overview of Change

Context of Change

Type of Change

  • New feature (non-breaking change which adds functionality)
  • amendment

Before / After

When amendment activates the new field Sequence in the amendments object will be increased 1. Before the field does not exist.

Tracking the serial number allows for check if amendments have
changed since last check without checking of the list one by one
@@ -329,6 +329,15 @@ Change::applyAmendment()
<< " activated: server blocked.";
ctx_.app.getOPs().setAmendmentBlocked();
}

if (view().rules().enabled(featureAmendmentTableSequence) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to increment the serial number when amendments gain or loose majority too since those change the amendment ledger entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes the serial nomber not very useful to check if amendments have made a changed which is a big use case for the rules of transaction process.

@a-noni-mousse
Copy link
Contributor Author

Do maintaineurs check+merge changes requests from people not working in Ripple company? I try to make changes but nothing happens. But the Ripple changes will merge very rapidly.

Please waiting for your response @JoelKatz, @manojsdoshi, @N3TC4T, @nbougalis, @nixer89, @RichardAH, @seelabs, @Silkjaer, @WietseWind, @ximinez.

@intelliot
Copy link
Collaborator

Time and resources are limited, but in general, yes - RippleX engineers make an effort to review contributions from external developers in the community. We have other priorities, so it may take some time for us to get to your PR, but we will.

Can you share the motivations for this PR? How is this change beneficial? How do you weigh that against the downsides (more code/complexity, more memory/compute use, etc)?

@a-noni-mousse
Copy link
Contributor Author

The serial number allows for easy check of if new amendments have activated and with it server does not need to load and process the amendment object that has not been changed. It has very low complexité and no downsides for computer memory or more complex.

@ximinez
Copy link
Collaborator

ximinez commented Aug 8, 2023

The serial number allows for easy check of if new amendments have activated and with it server does not need to load and process the amendment object that has not been changed.

At least for now, once an amendment is enabled - that is, added to the Amendments list - there is no mechanism for it to be removed1. That means that the size of the Amendments list will change whenever a new amendment is enabled (strictly increasing, currently). Would the size of the list not be a perfectly good substitute or proxy for a serial number?

Footnotes

  1. I would be remiss if I did not mention that there have been discussions and efforts to remove amendments from the list after they've been active for several years, and removed / retired from the code. So far, none of those designs have come to fruition. I think it's safe to say that even if such a mechanism were to be introduced, any implementation would remove several old amendments with one new amendment. (It would be absurd to add an entry that only removes one other entry if the goal is to save space.) Thus, if that were to occur, the size of the list would not strictly increase, but it would change any time an amendment was enabled.

@@ -141,6 +141,7 @@ LedgerFormats::LedgerFormats()
{
{sfAmendments, soeOPTIONAL}, // Enabled
{sfMajorities, soeOPTIONAL},
{sfSequence, soeOPTIONAL},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have a separate Sequence field instead of just using the existing logic for sfPreviousTxnID/sfPreviousTxnLgrSeq?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer those fields too. It would allow walking the activation change txs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4751 - IMO this is a better solution since it aligns with the existing ledger structure

@intelliot
Copy link
Collaborator

Hi @a-noni-mousse - do you have any thoughts on the comments above?

It should be straightforward to compare the amendment object itself to see if there have been changes; and if the format of the data is a problem, you could compare a hash of the object in order to detect changes.

@intelliot
Copy link
Collaborator

If there's no reply for a while, this PR will be closed due to inactivity. You'll always be welcome to open a new PR (or reopen this one) if you still feel the change is worth making.

@intelliot
Copy link
Collaborator

Closing due to inactivity. Suggested alternatives are detailed above, e.g. compare the amendment object itself, or a hash of that object. However, if that is insufficient for your use case, please feel free to re-open, or open a new PR.

@intelliot intelliot closed this Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants