Open
Conversation
kwsantiago
suggested changes
Jan 13, 2026
Contributor
kwsantiago
left a comment
There was a problem hiding this comment.
Need to rebase onto master
11 tasks
Co-authored-by: pseudozach <3731591+pseudozach@users.noreply.github.com>
Co-authored-by: pseudozach <3731591+pseudozach@users.noreply.github.com>
Co-authored-by: pseudozach <3731591+pseudozach@users.noreply.github.com>
Co-authored-by: pseudozach <3731591+pseudozach@users.noreply.github.com>
Co-authored-by: pseudozach <3731591+pseudozach@users.noreply.github.com>
Co-authored-by: pseudozach <3731591+pseudozach@users.noreply.github.com>
ad1b08d to
eb6a9d5
Compare
kwsantiago
suggested changes
Jan 20, 2026
Comment on lines
195
to
199
| // Use same strict validation as courier (4MB limit + checksum verification) | ||
| const message = try message_utils.readMessage(stream, allocator, .{ | ||
| .max_payload_size = 4_000_000, | ||
| .verify_checksum = true, | ||
| }); |
Contributor
There was a problem hiding this comment.
Missing timeout in handshake loop. A malicious peer can hang indefinitely by sending continuous non-version/verack messages. The courier.zig performHandshake has a 30-second timeout, but scout.zig's performHandshake has none.
Author
There was a problem hiding this comment.
should be covered now. added the same check to scout.
kwsantiago
suggested changes
Jan 20, 2026
| } | ||
|
|
||
| return .{ .header = header, .payload = payload }; | ||
| } |
Contributor
There was a problem hiding this comment.
Shouldn't we have tests? I think you had in a previous commit that were useful.
Author
There was a problem hiding this comment.
I added a few basic ones. I hope that's ok? let me know anything else I should add.
This file contains hidden or 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
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.
not sure if it was intentional but I figured I would flex my copilot muscles by removing the duplicate
readMessage.I hope PR is helpful.
Extracted duplicate readMessage implementations into shared utility
Added configurable options for validation settings
Created helper method to eliminate code duplication
Removed 84+ lines of duplicate code