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

Test Zebra reject message handling #4633

Closed
teor2345 opened this issue Jun 16, 2022 · 1 comment
Closed

Test Zebra reject message handling #4633

teor2345 opened this issue Jun 16, 2022 · 1 comment
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug C-security Category: Security issues C-testing Category: These are tests I-heavy Problems with excessive memory, disk, or CPU usage I-remote-node-overload Zebra can overload other nodes on the network

Comments

@teor2345
Copy link
Contributor

teor2345 commented Jun 16, 2022

Scheduling

Zebra doesn't send reject messages, and it ignores reject messages that are sent to it, so these tests are optional.

Motivation

We want to test for two things:

Reject Message Loops

We want to avoid reject message loops, where two peers reject each others' reject messages.
(We also want to avoid these kind of useless message loops in general, but that's trickier to solve.)

zcashd does this here:
https://github.com/zcash/zcash/blob/1b5ab4a06e52c23aca48afb1ebb72a25ef5dd3ca/src/main.cpp#L7347-L7350

Zebra currently ignores reject messages in handle_message_as_request, but we want to test that it stays that way.

Reject Command and Reason Length Limits

Check the limits added in PR #4687 are enforced correctly.
Check they return valid UTF-8 (or ascii?)

Specifications

Bitcoin doesn't say much about this:
https://en.bitcoin.it/wiki/Protocol_documentation#reject

Designs

Start a zebra-network stack, and send it random reject messages.

@teor2345 teor2345 added C-bug Category: This is a bug S-needs-triage Status: A bug report needs triage P-Low ❄️ C-security Category: Security issues I-heavy Problems with excessive memory, disk, or CPU usage I-remote-node-overload Zebra can overload other nodes on the network A-network Area: Network protocol updates or fixes and removed P-Low ❄️ labels Jun 16, 2022
@ftm1000 ftm1000 removed the S-needs-triage Status: A bug report needs triage label Jun 23, 2022
@teor2345 teor2345 added the C-testing Category: These are tests label Jun 27, 2022
@teor2345 teor2345 changed the title Don't send reject messages in response to other reject messages Test that Zebra doesn't send reject messages in response to other reject messages Jun 27, 2022
@teor2345 teor2345 changed the title Test that Zebra doesn't send reject messages in response to other reject messages Test Zebra reject message handling Jun 27, 2022
@teor2345
Copy link
Contributor Author

This seems to be fine for now.

@teor2345 teor2345 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2022
mpguerra added a commit that referenced this issue May 19, 2023
mergify bot pushed a commit that referenced this issue May 23, 2023
* ZIPs were updated to remove ambiguity, this was tracked in #1267.

* #2105 was fixed by #3039 and #2379 was closed by #3069

* #2230 was a duplicate of #2231 which was closed by #2511

* #3235 was obsoleted by #2156 which was fixed by #3505

* #1850 was fixed by #2944, #1851 was fixed by #2961 and #2902 was fixed by #2969

* We migrated to Rust 2021 edition in Jan 2022 with #3332

* #1631 was closed as not needed

* #338 was fixed by #3040 and #1162 was fixed by #3067

* #2079 was fixed by #2445

* #4794 was fixed by #6122

* #1678 stopped being an issue

* #3151 was fixed by #3934

* #3204 was closed as not needed

* #1213 was fixed by #4586

* #1774 was closed as not needed

* #4633 was closed as not needed

* Clarify behaviour of difficulty spacing

Co-authored-by: teor <[email protected]>

* Update comment to reflect implemented behaviour

Co-authored-by: teor <[email protected]>

* Update comment to reflect implemented behaviour when retrying block downloads

Co-authored-by: teor <[email protected]>

* Update `TODO` to remove closed issue and clarify when we might want to fix

Co-authored-by: teor <[email protected]>

* Update `TODO` to remove closed issue and clarify what we might want to change in future

Co-authored-by: teor <[email protected]>

* Clarify benefits of how we do block verification

Co-authored-by: teor <[email protected]>

* Fix rustfmt errors

---------

Co-authored-by: teor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug C-security Category: Security issues C-testing Category: These are tests I-heavy Problems with excessive memory, disk, or CPU usage I-remote-node-overload Zebra can overload other nodes on the network
Projects
None yet
Development

No branches or pull requests

2 participants