Skip to content

fix(sync-v2): Fix unhandled case caused by reorg during sync of blocks #827

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

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

msbrogli
Copy link
Member

@msbrogli msbrogli commented Oct 24, 2023

Motivation

This unhandled case was causing some tests to flaky with and IndexError.

As an example, run pytest tests/simulation/test_simulator_itself.py::SyncBridgeSimulatorSelfTestCase::test_determinism_interleaved -v -n0 with seed_config = 2519514082398162723.

Acceptance Criteria

  1. Handle the case where it was expected information about one block but an empty response was sent.

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 self-assigned this Oct 24, 2023
@msbrogli msbrogli requested a review from jansegre as a code owner October 24, 2023 19:33
@msbrogli msbrogli force-pushed the fix/sync-v2-unhandled-case branch from 95254bd to 4c42b2a Compare October 24, 2023 19:34
@msbrogli msbrogli requested a review from glevco October 24, 2023 19:35
@msbrogli msbrogli force-pushed the fix/sync-v2-unhandled-case branch from 4c42b2a to deaaaf6 Compare October 25, 2023 15:49
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

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

Comparison is base (05f7228) 84.59% compared to head (deaaaf6) 84.60%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #827   +/-   ##
=======================================
  Coverage   84.59%   84.60%           
=======================================
  Files         269      269           
  Lines       22296    22278   -18     
  Branches     3401     3402    +1     
=======================================
- Hits        18861    18848   -13     
+ Misses       2765     2761    -4     
+ Partials      670      669    -1     
Files Coverage Δ
hathor/transaction/token_creation_tx.py 99.15% <100.00%> (-0.13%) ⬇️
hathor/transaction/transaction.py 94.92% <100.00%> (+1.25%) ⬆️
...erification/token_creation_transaction_verifier.py 100.00% <100.00%> (ø)
hathor/p2p/sync_v2/agent.py 74.41% <50.00%> (-0.99%) ⬇️
hathor/verification/transaction_verifier.py 91.89% <91.07%> (-1.99%) ⬇️

... and 3 files with indirect coverage changes

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

@msbrogli msbrogli merged commit deaaaf6 into master Oct 25, 2023
@msbrogli msbrogli deleted the fix/sync-v2-unhandled-case branch October 25, 2023 17:03
@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