Skip to content
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

fix(sync-v2): Fix n-ary search to handle reorgs during its execution #842

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

msbrogli
Copy link
Member

Motivation

The n-ary search executed by sync-v2 was not taking into consideration that a reorg might occur during the search as it runs multiple async queries on the connected peer.

Acceptance Criteria

  1. Detect when a reorg occurs on the peer and stop the search. Notice that a new search will be executed on the next sync loop.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@msbrogli msbrogli requested a review from glevco October 27, 2023 19:13
@msbrogli msbrogli self-assigned this Oct 27, 2023
@msbrogli msbrogli requested a review from jansegre as a code owner October 27, 2023 19:13
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (bf0d0bc) 84.61% compared to head (c47f06e) 85.01%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #842      +/-   ##
==========================================
+ Coverage   84.61%   85.01%   +0.40%     
==========================================
  Files         271      271              
  Lines       22311    22368      +57     
  Branches     3406     3420      +14     
==========================================
+ Hits        18878    19017     +139     
+ Misses       2764     2675      -89     
- Partials      669      676       +7     
Files Coverage Δ
hathor/builder/builder.py 91.10% <100.00%> (-0.21%) ⬇️
hathor/builder/cli_builder.py 74.48% <100.00%> (ø)
hathor/feature_activation/feature_service.py 98.09% <100.00%> (+0.56%) ⬆️
hathor/simulator/simulator.py 94.61% <100.00%> (+0.09%) ⬆️
hathor/transaction/base_transaction.py 94.02% <ø> (-0.13%) ⬇️
hathor/transaction/block.py 94.52% <100.00%> (+0.13%) ⬆️
hathor/transaction/exceptions.py 100.00% <100.00%> (ø)
hathor/transaction/transaction_metadata.py 92.26% <ø> (ø)
hathor/verification/verification_service.py 90.32% <100.00%> (+0.10%) ⬆️
hathor/verification/block_verifier.py 97.14% <88.88%> (-2.86%) ⬇️
... and 1 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

hathor/p2p/sync_v2/agent.py Outdated Show resolved Hide resolved
hathor/p2p/sync_v2/agent.py Outdated Show resolved Hide resolved
hathor/p2p/sync_v2/agent.py Outdated Show resolved Hide resolved
hathor/p2p/sync_v2/agent.py Show resolved Hide resolved
jansegre
jansegre previously approved these changes Oct 30, 2023
hathor/p2p/sync_v2/agent.py Outdated Show resolved Hide resolved
@msbrogli msbrogli force-pushed the fix/sync-v2-n-ary-search branch 2 times, most recently from e907099 to f345346 Compare October 30, 2023 18:27
jansegre
jansegre previously approved these changes Oct 30, 2023
@msbrogli msbrogli force-pushed the fix/sync-v2-n-ary-search branch 3 times, most recently from f5d6e6b to dcb0e77 Compare November 3, 2023 00:56
@msbrogli msbrogli force-pushed the fix/sync-v2-n-ary-search branch from dcb0e77 to c47f06e Compare November 3, 2023 03:20
@msbrogli msbrogli merged commit c47f06e into master Nov 3, 2023
9 checks passed
@msbrogli msbrogli deleted the fix/sync-v2-n-ary-search branch November 3, 2023 15:46
@jansegre jansegre mentioned this pull request Nov 13, 2023
2 tasks
This was referenced Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants