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

Apply avoiding IBD patch10 logic to p2p v4 #1979

Merged
merged 18 commits into from
Mar 15, 2022

Conversation

michaelsutton
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #1979 (cd5f69b) into dev (2ab8065) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

❗ Current head cd5f69b differs from pull request most recent head 085c1cc. Consider uploading reports for the commit 085c1cc to get more accurate results

@@            Coverage Diff             @@
##              dev    #1979      +/-   ##
==========================================
- Coverage   57.88%   57.83%   -0.06%     
==========================================
  Files         676      676              
  Lines       32123    32137      +14     
==========================================
- Hits        18595    18585      -10     
- Misses      10892    10912      +20     
- Partials     2636     2640       +4     
Impacted Files Coverage Δ
app/protocol/flows/v4/blockrelay/ibd.go 0.00% <0.00%> (ø)
infrastructure/network/rpcclient/rpc_get_info.go 45.45% <0.00%> (-18.19%) ⬇️
app/protocol/flows/v5/blockrelay/block_locator.go 52.94% <0.00%> (-11.77%) ⬇️
infrastructure/network/rpcclient/rpcclient.go 60.67% <0.00%> (-6.75%) ⬇️
infrastructure/network/netadapter/router/route.go 82.85% <0.00%> (-5.72%) ⬇️
.../protocol/flows/v5/blockrelay/handle_relay_invs.go 53.12% <0.00%> (+0.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ab8065...085c1cc. Read the comment docs.

Comment on lines +79 to +80
if difficultyMul.Mul(virtualDifficulty, big.NewInt(180)).
Cmp(virtualSub.Sub(virtualSelectedParentHeader.BlueWork(), block.Header.BlueWork())) < 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Please write a small comment explaining this logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added comments. Re the general comment below, this is temp code by definition. As we already have p2p v5 which fixed precisely this issue, and p2p v4 will soon be obsolete.

elichai
elichai previously approved these changes Mar 15, 2022
Copy link
Member

@elichai elichai left a comment

Choose a reason for hiding this comment

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

Let's merge it as a temp fix (as it's not consensus code), and let's add details to this in the future, to make sure it's the best we can do

@michaelsutton michaelsutton merged commit 2488fbd into kaspanet:dev Mar 15, 2022
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