Skip to content

Conversation

@rtb-12
Copy link
Contributor

@rtb-12 rtb-12 commented Dec 31, 2025

[Core] Add late-join test workflow for KV store

Description

Adds a workflow that tests late-join sync: Node 1 performs 3000 inserts, then Node 2 joins and verifies all entries are synced and accessible.

The workflow (apps/kv-store/workflows/late-join-test.yml) covers:

  • 3000 inserts on Node 1 before Node 2 joins
  • Late join of Node 2 after all inserts complete
  • Verification that all 3000 entries sync to Node 2
  • Assertions that specific keys (first, middle, near-end, last) are accessible on Node 2
  • Cross-verification that Node 1 still has all entries after sync

This tests the sync protocol's ability to catch up a late-joining node with a large state history.

On local testing it took around 30 sec for the context hash to match for both nodes.

Test plan

Documentation update

No documentation changes required .


Note

Strengthens late-join sync coverage and scalability.

  • Adds apps/kv-store/workflows/late-join-test.yml to simulate 5000 pre-join inserts on Node 1, then Node 2 joins and verifies state via len, entries, and specific get checks (with a 100s wait)
  • Increases MAX_DELTA_QUERY_LIMIT in crates/dag/src/lib.rs and MAX_DELTA_FETCH_LIMIT in crates/node/src/sync/delta_request.rs from 3000 to 1_000_000 to support large history syncs

Written by Cursor Bugbot for commit d1b8022. This will update automatically on new commits. Configure here.

@rtb-12 rtb-12 requested review from chefsale and sept-en December 31, 2025 12:52
@rtb-12 rtb-12 changed the title feat(workflow): add late join test workflow with 5000 inserts and verification feat(workflow): add late join test workflow with 3000 inserts and verification Jan 5, 2026
@github-actions
Copy link

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Stale label Jan 14, 2026
/// Even if a caller requests more, the DAG will cap the result at this size.
/// The value selected as ~96 KB.
pub const MAX_DELTA_QUERY_LIMIT: usize = 3000;
pub const MAX_DELTA_QUERY_LIMIT: usize = 1_000_000;
Copy link

Choose a reason for hiding this comment

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

Excessive limit increase removes OOM protection

High Severity

MAX_DELTA_QUERY_LIMIT and MAX_DELTA_FETCH_LIMIT increased from 3000 to 1,000,000 (333x) when the test only needs ~5000. The original limits were explicitly designed to "prevent resource exhaustion" and "prevent OOM where a peer sends a delta with a deep chain." This dramatic increase removes important memory safety guardrails that protect against malicious or corrupted peers causing out-of-memory conditions during sync operations.

Additional Locations (1)

Fix in Cursor Fix in Web

@github-actions
Copy link

SDK JS Workflows Failed

The following SDK JS workflow(s) failed:

  • examples/kv-store/workflows/simple-store-js.yml
  • examples/private-data/workflows/private-data-js.yml

Please check the workflow logs for more details.

@github-actions
Copy link

Merobox Workflows Failed

The following workflow(s) failed after retries:

  • kv-store/workflows/late-join-test.yml

Please check the workflow logs for more details.

@github-actions github-actions bot removed the Stale label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants