Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

security fix 2 - Only send a getheaders for one block in an INV #313

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

Naviabheeman
Copy link
Contributor

Port fixes from bitcoin: 18962 - Only send a getheaders for one block in an INV

Functional test for this is ported from bitcoin. But the expected results are different from the same test in bitcoin. This is because of the protocol changes made in bitcoin regarding the number of peers to get headers from during IBD. In papyrus there is no restriction. so all peers get and send the headers message.

… in an INV

functional for this is a variant of the same test in bitcoin.

# Wait for peer1 to receive a getheaders
# If no block hash is provided, checks whether any getheaders message has been received by the node."""
def test_function():
Copy link
Contributor

Choose a reason for hiding this comment

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

Bitcoin uses the wait_for_getheaders method, but why did you create this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method is from the implementation of wait_for_getheaders copied from bitcoin test framework as it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that the same method exists in mininode.py in Tapyrus Core. Can we use that to write it in the same way?

@azuchi azuchi merged commit 5912e34 into chaintope:master Sep 16, 2024
10 checks passed
@Naviabheeman Naviabheeman deleted the securityFix2_inv_getheaders branch February 20, 2025 05:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants