-
Notifications
You must be signed in to change notification settings - Fork 698
feat: use longest common prefix for determining tx replay set #6353
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
base: develop
Are you sure you want to change the base?
Conversation
/// Find the longest common prefix of replay sets that has majority support. | ||
/// This implements the longest common prefix (LCP) strategy where if one signer's replay set | ||
/// is [A,B,C] and another is [A,B], we should use [A,B] as the replay set. | ||
/// Order matters for transaction replay - [A,B] and [B,A] have no common prefix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaha this looks like a leetcode question XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha I know, and it makes me feel fancy, but it's really much simpler than it sounds 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: only some minor nits.
This PR adds the ability for the global state machine evaluator to use a longest common prefix algorithm to determine the global transaction replay set after a fork.
For example, if one replay set is [A,B,C] with 50% weight, and another is [A,B] with 30% weight, then we will use [A,B] as the global replay set.
There is code for ensuring we end up with a deterministic global replay set by doing a comparison of signer weight, and then length, and then via txid comparisons.