-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fuzzing and hardening #693
Fuzzing and hardening #693
Conversation
Build failed with the latest checkpoint-y commit but that is ok as work continues. I've removed the btp "differential fuzzing" in 68260fe. The timestamp parsing was found quite lenient while fuzzing the btp, so that'll be the next thing but I'm ready to call this good to go with the ccp huge preallocations fixed. I'll probably complete this work by creating a few issues on:
|
Hardening doesn't seem to great with test-md failures. Lets see if I can decipher these. |
It would appear that the "xrp-settlement" failed. From the artifact it'd appear that everything went smooth for alice but in
The whole execution log from the log failure:
I do wonder how come the line preceding Could be that the formatting issues are because of the strange output where Need to get these running locally. I guess I have to spin up a vm. The scripts don't really look like they cleanup after themselves... So this could even be interference from previous test but probably not as these have been executing well. |
This comment has been minimized.
This comment has been minimized.
Ok I guess the test is just flaky? Good three times (2 here, 1 in first step of bisection) in row, next one will be the third. Separating the CI stuff to a new PR. |
[features] | ||
# used when fuzzing; accepts only roundtripping input | ||
strict = [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After debugging some docker builds today it occured to me that those builds are done with --all-features
. Need to check if that applies to all crates in the workspace, or does building ilp-node
with --all-features
just toggle on features of the ilp-node
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not enabled with the default binary build at least in rust 1.51, did not check others.
Enabling this would require adding strict
feature to ilp-node
, which would need to enable interledger/strict
, strict
for interledger
, which would again need to enable interledger-packet/strict
and others.
Did the hopefully the final rebasing, made sure that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM mod 2 simple comments/questions
|
with fuzzing the roundtripping of parsed packets is the only tool at the moment. for strict roundtripping we need to deny some varuint patterns with leading zeroes which might be actually needed for the protocol. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
I'll merge this today evening or tomorrow after re-running it to see if there's some time-specific issue which could reproduce. |
target, should never panic: * packet: Packet::try_from * address: Address::try_from originally tried out fuzzing between the versions when doing the bytes05 upgrade, but as that is quite troublesome to keep up to date I've removed it. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
since BtpPacket is not public, we add a new #[cfg(fuzzing)] pub mod with our required utilities. * roundtrip_btppacket: checks that input matches output also introduces a "strict" feature for roundtrip fuzzing and more test cases. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
roundtrip fuzzing as in if something is parsed correctly, expect it to produce the same bytes when converted back to bytes. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
not yet fixed, a bit more like a chrono issue. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
it only supports the lengths as in the oer rfc. reading a shorter version will output the same shorter version back, which is helpful with roundtrip testing. the type itself is only ever handled by logging so this wasn't critical for anything else than fuzzing. Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com> Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
asserting a boolean before unwrapping is wasteful, and hides the actual case. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
this is discussed more in the comments. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
turns out there still are issues. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
this is moved from a FIXME in fuzzing target, will be put up for good-first-issue once PR is merged. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
cannot see any point in storing the large files; a high churn rate is expected since they are for libraries. Signed-off-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Dropped the |
Test failure is "normal flaky", lets hope for a
This is because the tests do not use |
Now two passes after the "normal flaky." Lets try a third. |
Issue has been created, seems that we'll need to find another PR to trigger the occasional |
This builds upon #690. Some found fixes have already landed with #695. It adds on top of any fixes in earlier already:
strict
to interledger-packet for accepting only varuints which have no leading zeroesinterledger-packet/strict
in btp, stream at leastvar_octet_bytes
can now only be usize wide, which should probably be specced lower to match realityVec::new
which does have a chance of perf hitinterledger-packet/strict
is useful for roundtrip fuzzing where input is first parsed and then converted back into bytes. Wheninterledger-packet/strict
is not enabled any additional leading zeros are accepted for varuints. Accepting them but not outputting them when converting the packet back to bytes creates a lot of false panics when fuzzing.strict
shouldn't be enabled in any production usage because it did look like the java implementation for example didn't have such strict checks on parsedBigInteger
s.Most of this work came out of #680 where at updating
interledger-stream
I ran into the bad length check. Fixing the length check right away failed a lot of existing test cases, which got me to do differential fuzzing between two versions. Differential fuzzing of course runs into all of the previously found issues with roundtrip fuzzing.I will probably drop the differential fuzzing before making this ready for review.Dropped already.Per crate fuzzing targets and status:
#[ignore]
tests#[ignore]
tests85% of added lines are caused by 4 added Cargo.lock files.