-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor(sync-v2): Refactor sync_v2 agent to hold (block_height, block_id) information in an internal namedtuple #829
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msbrogli
force-pushed
the
refactor/sync-v2-agent
branch
from
October 27, 2023 03:48
57bf117
to
78373d2
Compare
msbrogli
force-pushed
the
refactor/sync-v2-agent
branch
8 times, most recently
from
October 27, 2023 06:35
d178550
to
c0cdfa3
Compare
msbrogli
commented
Oct 27, 2023
glevco
previously approved these changes
Oct 27, 2023
1 task
jansegre
previously approved these changes
Oct 27, 2023
msbrogli
force-pushed
the
refactor/sync-v2-agent
branch
from
October 27, 2023 16:09
c0cdfa3
to
b095c96
Compare
msbrogli
force-pushed
the
refactor/sync-v2-agent
branch
from
October 27, 2023 16:15
b095c96
to
cbba621
Compare
msbrogli
changed the title
refactor(sync-v2): Use BlockInfo in sync_v2 agent to hold (block_height, block_id) information
refactor(sync-v2): Refactor sync_v2 agent to hold (block_height, block_id) information in an internal namedtuple
Oct 27, 2023
msbrogli
force-pushed
the
refactor/sync-v2-agent
branch
from
October 27, 2023 16:25
5a4c198
to
f880a62
Compare
glevco
previously approved these changes
Oct 27, 2023
jansegre
previously approved these changes
Oct 27, 2023
jansegre
approved these changes
Oct 27, 2023
glevco
approved these changes
Oct 27, 2023
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #829 +/- ##
==========================================
+ Coverage 84.56% 84.63% +0.07%
==========================================
Files 270 270
Lines 22291 22290 -1
Branches 3406 3404 -2
==========================================
+ Hits 18850 18865 +15
+ Misses 2769 2757 -12
+ Partials 672 668 -4
☔ View full report in Codecov by Sentry. |
…k_id) information in an internal namedtuple
msbrogli
force-pushed
the
refactor/sync-v2-agent
branch
from
October 27, 2023 18:46
59d5104
to
89d347e
Compare
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Sync-v2 agent code uses the pair
(block_height, block_hash)
multiple times. So this PR refactors it to use a namedtupleBlockInfo
(instead of handling with both information separately).Acceptance Criteria
hathor.p2p.sync_v2.agent.BlockInfo
.hathor.p2p.sync_v2.agent.NodeBlockSync.get_my_best_block()
method.find_best_common_block()
andrun_sync_blocks()
methds to useBlockInfo
.(synced, not_synced)
to(lo, hi)
in the n-ary search.get_status()
, and (ii) usinglo=0
instead oflo=self.synced_block.height
.Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged