-
Notifications
You must be signed in to change notification settings - Fork 379
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
Lack of wire format validation #4879
Comments
Discussed this on zoom/slack.
These binary payloads are better:
Once we have such a repository, we can design what would be the best way to add tests to check that we are not breaking wire format. This could possibly be things like:
In terms of implementation
|
Thanks Behzad!
Current implementation generally follows this idea, I have not yet implemented breakdown by version of the software (this is coming up). To improve the speed of capturing I am currently grabbing all packets from the raw socket (not sorting by version), but sorting is definitely going to be possible once I make gossip connection work correctly.
Storing packets in pcap has the advantage that we do not need to handle a million files. Each packet there has a number in case there are issues, so one can easily skip to the needed one. The dataset for gossip already exists, it is about 1.5 GB with roughly 500-1500 packets of each type. There is logic to get good coverage of different packets carrying Crds and Vec.
Captures are running on MNB (at least for now) as it has the widest variety of versions.
The code currently sorts packets by categories and ignores the kinds of packets it already has. I'll later extend this logic to also do selection by version number of the sending validator (so we can collect interesting packets from dinosaurs on MNB)
That code is already done for gossip in the branch linked above. In discussion with @yihau about how to put this into CI.
Unit tests could definitely run through the packets but that would require for them to have access to the datasets (which are quite bulky). I do not think it would work well unless we only trigger these tests manually, and cache the datasets on devboxes.
Already happening this way
git repo (even with LFS) is probably not the best fit for this due to sheer size. We are exploring options.
Current impl does patch some things to be pub to work at all. Not too many things though. 99% of the logic is in a separate crate called wire-format. All of this pub-patching could, in principle, be achieved with a feature flag if we want this eventually merged into master. |
Problem
Some more context
Proposed Solution
Progress:
The text was updated successfully, but these errors were encountered: