Skip to content

Conversation

dapplion
Copy link
Collaborator

Issue Addressed

Currently we have very poor coverage of range sync with unit tests. With the event driven test framework we could cover much more ground and be confident when modifying the code.

Proposed Changes

Add two basic cases:

  • Happy path, complete a finalized sync for 2 epochs
  • Post-PeerDAS case where we start without enough custody peers and later we find enough

⚠️ If you have ideas for more test cases, please let me know! I'll write them

@dapplion dapplion requested a review from jxs as a code owner January 28, 2025 00:56
@jimmygchen jimmygchen added the ready-for-review The code is ready for review label Jan 30, 2025
Copy link

mergify bot commented Jan 30, 2025

This pull request has merge conflicts. Could you please resolve them @dapplion? 🙏

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jan 31, 2025
@dapplion dapplion added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jan 31, 2025
@jimmygchen jimmygchen self-requested a review February 6, 2025 23:18

// Unikely that the single peer we added has enough columns for us. Find a way to make this test
// deterministic.
r.add_random_peer_not_supernode(remote_info.clone());
Copy link
Member

@jimmygchen jimmygchen Feb 7, 2025

Choose a reason for hiding this comment

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

We could just thread a fixed seed rng to these functions when generating peers?

StdRng::seed_from_u64(0xDEADBEEF0BAD5EEDu64)

For all peerdas tests we should probably make them deterministric, otherwise we could end up with flaky tests.

Copy link
Collaborator Author

@dapplion dapplion Feb 7, 2025

Choose a reason for hiding this comment

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

Made tests deterministic 2021abc

Switched to ChaCha20 rng as Xor does not implement CryptoRng, required by the enr crate

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

Nice, just a small suggestion to make the test deterministic.

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Feb 7, 2025
Copy link

mergify bot commented Feb 7, 2025

This pull request has merge conflicts. Could you please resolve them @dapplion? 🙏

@dapplion dapplion requested a review from jimmygchen February 7, 2025 22:23
@jimmygchen jimmygchen removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Feb 10, 2025
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@jimmygchen
Copy link
Member

Ready for merge once release process is done.

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed blocked labels Feb 10, 2025
mergify bot added a commit that referenced this pull request Feb 10, 2025
@mergify mergify bot merged commit d5a03c9 into sigp:unstable Feb 10, 2025
31 checks passed
@dapplion dapplion deleted the range-sync-tests branch February 10, 2025 19:12
pawanjay176 pushed a commit to pawanjay176/lighthouse that referenced this pull request Feb 21, 2025
Currently we have very poor coverage of range sync with unit tests. With the event driven test framework we could cover much more ground and be confident when modifying the code.


  Add two basic cases:
- Happy path, complete a finalized sync for 2 epochs
- Post-PeerDAS case where we start without enough custody peers and later we find enough

⚠️  If you have ideas for more test cases, please let me know! I'll write them
eserilev pushed a commit to eserilev/lighthouse that referenced this pull request Mar 5, 2025
Currently we have very poor coverage of range sync with unit tests. With the event driven test framework we could cover much more ground and be confident when modifying the code.


  Add two basic cases:
- Happy path, complete a finalized sync for 2 epochs
- Post-PeerDAS case where we start without enough custody peers and later we find enough

⚠️  If you have ideas for more test cases, please let me know! I'll write them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge. syncing test improvement Improve tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants