-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[consensus] Introduce OptQS::V2 Payload #18087
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
Conversation
0669083 to
85e6a2e
Compare
0680427 to
77720f1
Compare
85e6a2e to
f1c025b
Compare
77720f1 to
392b63e
Compare
f1c025b to
81de0e4
Compare
0006bf4 to
68e12f2
Compare
81de0e4 to
1ff1ce5
Compare
68e12f2 to
8a0a608
Compare
1ff1ce5 to
16f977f
Compare
88d173e to
1d108f7
Compare
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.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bug: Missing V2 handler causes unreachable panic
The get_transactions method handles OptQuorumStorePayload::V1 but not V2, causing V2 payloads to hit the unreachable!() macro and panic. This prevents processing of V2 payloads even though they're introduced in this PR and handled elsewhere in the codebase.
consensus/src/payload_manager/quorum_store_payload_manager.rs#L541-L548
aptos-core/consensus/src/payload_manager/quorum_store_payload_manager.rs
Lines 541 to 548 in 1d108f7
| }, | |
| _ => unreachable!( | |
| "Wrong payload {} epoch {}, round {}, id {}", | |
| payload, | |
| block.block_data().epoch(), | |
| block.block_data().round(), | |
| block.id() | |
| ), |
danielxiangzl
left a comment
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. cursor bot is good at reviewing pr like this..
JoshLind
left a comment
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!
| self.opt_batches.num_bytes() + self.proofs.num_bytes() + self.inline_batches.num_bytes() | ||
| pub(crate) fn extend(self, other: Self) -> Self { | ||
| match (self, other) { | ||
| (Self::V1(p1), Self::V1(p2)) => Self::V1(p1.extend(p2)), |
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.
Silly question, but do we imagine cases where we're extending V1 and V2 batches together, e.g., during a rollout? Or would they only be exclusive (i.e., only V1 extending other V1s, and V2 extending other V2s?)
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.
This extend fn is just for the DAG implementation, where it is possible to have V1 extending V2, etc (we don't use that code path anymore, maybe time for a cleanup?). For our leader based consensus, we only propose one "Payload" and execute it.
8a0a608 to
ad4e2c2
Compare
1d108f7 to
d500622
Compare
8a0a608 to
ca448ec
Compare
| .await? | ||
| }, | ||
| Payload::OptQuorumStore(opt_qs_payload) => { | ||
| Payload::OptQuorumStore(OptQuorumStorePayload::V1(opt_qs_payload)) => { |
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.
Bug: Missing V2 handler causes panic instead of graceful error
The get_transactions function only handles OptQuorumStorePayload::V1 and falls through to unreachable!() for V2. This is inconsistent with other functions in the same file (prefetch_payload_data, check_payload_availability, notify_commit, get_inline_transactions) which explicitly handle both V1 and V2 variants. The get_inline_transactions function demonstrates the expected pattern: handle V2 with error!("OptQSPayload V2 is not expected") and return gracefully. If V2 were to reach get_transactions, it would panic instead of returning an error.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
* [consensus] Introduce OptQS::V2 Payload

Description
Introduce OptQuorumStoreV2 Payload that can include BatchV2 in the payload. It uses the same generic trick as the prior PRs to have multiple implementation over BatchInfo and BatchInfoExt. Processing OptQuorumStoreV2 is disabled during proposal handling phase and will be enabled in a future PR.