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

Fix a few bugs in revalidate #16400

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Fix a few bugs in revalidate #16400

wants to merge 7 commits into from

Conversation

georgeee
Copy link
Member

@georgeee georgeee commented Dec 5, 2024

  1. Refactor revalidate and drop_until_sufficient_balance
  2. Fix two similar issues originating from confusion between previous variable names t and t' (Account no longer has permission to send and Current account nonce precedes first nonce in queue)
  3. Fix the issue multiple nodes crashed #16397 by ensuring removal from applicable_by_fee is
    done only for the previous head of queue.

Explain how you tested your changes:

  • TODO

Checklist:

  • Dependency versions are unchanged
    • Notify Velocity team if dependencies must change in CI
  • Modified the current draft of release notes with details on what is completed or incomplete within this project
  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them

This makes code a bit more readable by decreasing the nestedness.
Dropped sequence was returned in reverse order, then concatenated to a
sequence in straight order. This is not causing any immediate issues,
but is better for clarity.
1. Rewrite revalidate to enhance readability
2. Fix two similar issues originating from confusion between previous
   variable names `t` and `t'` ("Account no longer has permission to
   send" and "Current account nonce precedes first nonce in queue")
3. Fix the issue #16397 by ensuring removal from `applicable_by_fee` is
   done only for the previous head of queue.
This commit only moves part of revalidate function utside of its body.
@georgeee georgeee requested a review from a team as a code owner December 5, 2024 15:20
@georgeee
Copy link
Member Author

georgeee commented Dec 5, 2024

This PR is recommended to be rebased against compatible after merging its mini version #16401 and its predecessor #16399

Copy link
Member

@deepthiskumar deepthiskumar left a comment

Choose a reason for hiding this comment

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

looks great!

@@ -678,132 +678,128 @@ let revalidate :
-> [ `Entire_pool | `Subset of Account_id.Set.t ]
-> (Account_id.t -> Account.t)
-> t * Transaction_hash.User_command_with_valid_signature.t Sequence.t =
fun t ~logger scope f ->
fun t ~logger scope get_account_by_id ->
let requires_revalidation =
Copy link
Member

Choose a reason for hiding this comment

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

rename to senders_to_validate or some such?

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.

2 participants