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 block tree queries #1341

Merged
merged 8 commits into from
Sep 20, 2022
Merged

Fix block tree queries #1341

merged 8 commits into from
Sep 20, 2022

Conversation

turuslan
Copy link
Contributor

Referenced issues

Description of the Change

  • Remove unused babe lottery and block tree code.
  • Fix descending blocks query and test.
  • Check forks earlier in hasDirectChain.
  • Simplify and fix ascending blocks queries, because they are just descending blocks queries with reversed result.

Benefits

  • Fixes wrong block requests near fork (kagome responded with wrong block).

Possible Drawbacks

Usage Examples or Tests

Alternate Designs

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@codecov
Copy link

codecov bot commented Sep 16, 2022

Codecov Report

Merging #1341 (42919c2) into master (31dd93a) will decrease coverage by 0.02%.
The diff coverage is 20.00%.

❗ Current head 42919c2 differs from pull request most recent head f791771. Consider uploading reports for the commit f791771 to get more accurate results

@@            Coverage Diff             @@
##           master    #1341      +/-   ##
==========================================
- Coverage   24.41%   24.38%   -0.03%     
==========================================
  Files         619      619              
  Lines       23079    23021      -58     
  Branches    12044    12011      -33     
==========================================
- Hits         5635     5614      -21     
+ Misses      12241    12225      -16     
+ Partials     5203     5182      -21     
Impacted Files Coverage Δ
core/blockchain/block_tree.hpp 100.00% <ø> (ø)
core/blockchain/impl/block_tree_impl.hpp 33.33% <ø> (ø)
core/consensus/babe/babe_lottery.hpp 100.00% <ø> (ø)
core/consensus/babe/impl/babe_lottery_impl.cpp 28.57% <ø> (-5.33%) ⬇️
core/blockchain/impl/block_tree_impl.cpp 21.46% <20.00%> (-0.16%) ⬇️
core/blockchain/impl/cached_tree.cpp 54.00% <0.00%> (-2.00%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@turuslan turuslan requested review from Harrm and GaroRobe September 19, 2022 03:48
@turuslan turuslan enabled auto-merge (squash) September 20, 2022 10:39
@turuslan turuslan merged commit c48739c into master Sep 20, 2022
@turuslan turuslan deleted the fix/block-tree-ascend branch September 20, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants