Repository navigation
Add FFI roundtrip fuzz target - #2059
Open
caarloshenriq wants to merge 1 commit into
Open
caarloshenriq wants to merge 1 commit into
caarloshenriq wants to merge 1 commit into
Conversation
Drive a full v2 payjoin end to end through the payjoin-ffi bindings: a real sender and receiver, both exercised only through the FFI types, talk over an in-process mock OHTTP directory. The fuzzer controls the wallet choices, the receiver's answers, directory statuses, polling order and whether either party resumes from its event log, while both parties stay honest so the crypto layers are never fed fuzzer bytes.
Collaborator
Coverage Report for CI Build 43947383697Coverage remained the same at 87.657%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This branch has not been deployed
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.
Adds
ffi-roundtrip-v2, a full v2 payjoin end to end through thepayjoin-ffibindings. A real sender and receiver, both driven only through the FFI types, talk over an in-process mock OHTTP directory (the same crypto plumbing asroundtrip/v2.rs).Both parties stay honest, so every message passes both crypto layers on its own and the fuzzer never touches ciphertext. What it controls is the wallet choices, the receiver's answers, directory statuses, polling order, and whether either party resumes from its event log. The input is
[len:2][psbt][scenario]; an empty scenario is the happy path.What it covers
This reaches surface the per-state FFI targets and the core roundtrip cannot:
process_response. This is the sender's defense against a malicious receiver, and it is only reachable through a full roundtrip, since it needs the receiver's genuine OHTTP/HPKE context.replay_receiver_event_log/replay_sender_event_logmid-flow (sender restart, receiver resume).HasReplyableErrorand posts the error back to the sender.Testing
Unit tests cover the happy path completing, sender restart, early polls, a receiver rejection reaching the sender, and a directory fault stopping the post.
Fuzzed locally with 8 parallel workers: ~72k executions, no crash, no slow units, peak RSS ~505 MB, and the corpus kept growing throughout (942 new units), so coverage had not saturated.
Reviewer: @benalleng
Disclosure: co-authored by Claude
Pull Request Checklist
Please confirm the following before requesting review: