Skip to content

Conversation

@ibalajiarun
Copy link
Contributor

@ibalajiarun ibalajiarun commented Jan 15, 2026

Description

This PR adds support for OptQuorumStorePayload V2 by introducing configuration flags to control its transmission and reception. The changes include:

  1. Added two new configuration flags to QuorumStoreConfig:

    • enable_opt_qs_v2_tx: Controls whether to send V2 payloads
    • enable_opt_qs_v2_rx: Controls whether to accept V2 payloads
  2. Modified the payload verification logic to check the opt_qs_v2_rx_enabled flag before accepting V2 payloads, replacing the previous hard-coded rejection.

  3. Updated the ProofManager to create V2 payloads when requested by adding a use_batch_v2 flag to OptQSPayloadPullParams.

  4. Enhanced the payload creation process to preserve BatchInfoExt for V2 payloads while converting to BatchInfo for V1 payloads.

  5. Propagated the new configuration flags through the verification chain in consensus components.

These changes enable a gradual rollout of the V2 payload format with separate controls for sending and receiving.

Copy link
Contributor Author

ibalajiarun commented Jan 15, 2026

Some(OptQSPayloadPullParams {
exclude_authors,
minimum_batch_age_usecs: self.minimum_batch_age_usecs,
use_batch_v2: false,
Copy link

Choose a reason for hiding this comment

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

TX config flag enable_opt_qs_v2_tx is not wired up

Medium Severity

The enable_opt_qs_v2_tx configuration flag is added to control sending V2 payloads, but use_batch_v2 is hardcoded to false in OptQSPullParamsProvider::get_params(). The OptQSPullParamsProvider struct doesn't receive or store the enable_opt_qs_v2_tx config, so V2 payloads will never be created regardless of the config setting. The ProofManager checks params.use_batch_v2 to decide payload format, but this will always be false.

Additional Locations (1)

Fix in Cursor Fix in Web

pub enable_payload_v2: bool,
pub enable_batch_v2: bool,
pub enable_opt_qs_v2_tx: bool,
pub enable_opt_qs_v2_rx: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the differences between these flags and enable_payload_v2 / enable_batch_v2? What is the plan for roll out for the QS components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are a quite a bit of flags here to avoid bug bounty issues, because we are seeing bounties for validator networks these days. The plan is to enable enable_payload_v2, enable_opt_qs_v2_rx, enable_opt_qs_v2_tx, enable_batch_v2 in that order.

Some(OptQSPayloadPullParams {
exclude_authors,
minimum_batch_age_usecs: self.minimum_batch_age_usecs,
use_batch_v2: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this going to be set by config later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

counters::NUM_INLINE_BATCHES.observe(inline_block.len() as f64);
counters::NUM_INLINE_TXNS.observe(inline_block_size.count() as f64);

// TODO(ibalajiarun): Avoid clones
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: clones are still there

Base automatically changed from balaji/batch-kind to main January 20, 2026 17:52
@ibalajiarun ibalajiarun force-pushed the balaji/opt-qs-batch-v2 branch 2 times, most recently from b4b2113 to c35aa2d Compare January 20, 2026 20:38
@ibalajiarun ibalajiarun enabled auto-merge (squash) January 20, 2026 20:44
cursor[bot]

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ibalajiarun ibalajiarun force-pushed the balaji/opt-qs-batch-v2 branch from c35aa2d to 4460b7a Compare January 20, 2026 21:30
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

✅ Forge suite compat success on c06e1b8824e5d9db7535c9eed058e24aa7c19bf1 ==> 4460b7aebdeda395907e0b3cabd5f0fad37fc869

Compatibility test results for c06e1b8824e5d9db7535c9eed058e24aa7c19bf1 ==> 4460b7aebdeda395907e0b3cabd5f0fad37fc869 (PR)
1. Check liveness of validators at old version: c06e1b8824e5d9db7535c9eed058e24aa7c19bf1
compatibility::simple-validator-upgrade::liveness-check : committed: 13421.72 txn/s, latency: 2597.88 ms, (p50: 2700 ms, p70: 2900, p90: 3300 ms, p99: 3500 ms), latency samples: 439420
2. Upgrading first Validator to new version: 4460b7aebdeda395907e0b3cabd5f0fad37fc869
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 5737.13 txn/s, latency: 5923.04 ms, (p50: 6600 ms, p70: 6700, p90: 6900 ms, p99: 6900 ms), latency samples: 197500
3. Upgrading rest of first batch to new version: 4460b7aebdeda395907e0b3cabd5f0fad37fc869
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 5839.17 txn/s, latency: 5826.11 ms, (p50: 6300 ms, p70: 6500, p90: 6600 ms, p99: 6700 ms), latency samples: 200520
4. upgrading second batch to new version: 4460b7aebdeda395907e0b3cabd5f0fad37fc869
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9939.27 txn/s, latency: 3300.59 ms, (p50: 3200 ms, p70: 3800, p90: 4300 ms, p99: 5100 ms), latency samples: 327300
5. check swarm health
Compatibility test for c06e1b8824e5d9db7535c9eed058e24aa7c19bf1 ==> 4460b7aebdeda395907e0b3cabd5f0fad37fc869 passed
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite realistic_env_max_load success on 4460b7aebdeda395907e0b3cabd5f0fad37fc869

two traffics test: inner traffic : committed: 13568.68 txn/s, submitted: 13568.84 txn/s, expired: 0.16 txn/s, latency: 2776.84 ms, (p50: 2700 ms, p70: 2900, p90: 3000 ms, p99: 3600 ms), latency samples: 5046760
two traffics test : committed: 100.01 txn/s, latency: 770.14 ms, (p50: 700 ms, p70: 800, p90: 800 ms, p99: 2400 ms), latency samples: 1740
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.278, avg: 2.197", "ConsensusProposalToOrdered: max: 0.170, avg: 0.165", "ConsensusOrderedToCommit: max: 0.047, avg: 0.043", "ConsensusProposalToCommit: max: 0.216, avg: 0.208"]
Max non-epoch-change gap was: 1 rounds at version 48414 (avg 0.00) [limit 4], 1.16s no progress at version 48414 (avg 0.07s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.35s no progress at version 2292693 (avg 0.35s) [limit 16].
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite framework_upgrade success on c06e1b8824e5d9db7535c9eed058e24aa7c19bf1 ==> 4460b7aebdeda395907e0b3cabd5f0fad37fc869

Compatibility test results for c06e1b8824e5d9db7535c9eed058e24aa7c19bf1 ==> 4460b7aebdeda395907e0b3cabd5f0fad37fc869 (PR)
Upgrade the nodes to version: 4460b7aebdeda395907e0b3cabd5f0fad37fc869
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2338.97 txn/s, submitted: 2348.41 txn/s, failed submission: 9.45 txn/s, expired: 9.45 txn/s, latency: 1231.27 ms, (p50: 1200 ms, p70: 1200, p90: 1700 ms, p99: 2700 ms), latency samples: 212900
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2342.54 txn/s, submitted: 2350.45 txn/s, failed submission: 7.92 txn/s, expired: 7.92 txn/s, latency: 1229.52 ms, (p50: 1200 ms, p70: 1200, p90: 1800 ms, p99: 2200 ms), latency samples: 213040
5. check swarm health
Compatibility test for c06e1b8824e5d9db7535c9eed058e24aa7c19bf1 ==> 4460b7aebdeda395907e0b3cabd5f0fad37fc869 passed
Upgrade the remaining nodes to version: 4460b7aebdeda395907e0b3cabd5f0fad37fc869
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1550.72 txn/s, submitted: 1557.75 txn/s, failed submission: 7.03 txn/s, expired: 7.03 txn/s, latency: 1864.18 ms, (p50: 1200 ms, p70: 1300, p90: 1700 ms, p99: 11800 ms), latency samples: 141263
Test Ok

@ibalajiarun ibalajiarun merged commit ab91501 into main Jan 20, 2026
48 checks passed
@ibalajiarun ibalajiarun deleted the balaji/opt-qs-batch-v2 branch January 20, 2026 22:21
@ibalajiarun ibalajiarun mentioned this pull request Jan 20, 2026
22 tasks
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.

4 participants