-
Notifications
You must be signed in to change notification settings - Fork 20
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
🥅 fuzzer error handling #118
Conversation
I will wait with this branch at least till we merge #115. So I can also update the accounts_snapshots.rs errors. |
efde295
to
40d4895
Compare
c6ad0ca
to
86b0af2
Compare
0c78cf1
to
4f97679
Compare
This PR should improve error handling throughout the entire fuzzing process. Two types of errors can occur: FuzzClientError Context: Origin: These are then wrapped into FuzzClientErrorWithOrigin or FuzzingErrorWithOrigin (wrapped together with the error message). FuzzingErrorWithOrigin and FuzzClientErrorWithOrigin are propagated to the FuzzTestExecutor, where further steps can be evaluated based on the returned error. |
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.
Good job, it looks much better now.
.map_err(|e| e.with_origin(Origin::Instruction(self.to_string()))); | ||
|
||
|
||
match snapshot.capture_after(client) { |
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.
Why do you use match here (and also later on)? It should be the same as calling .unwrap()
...
.ok_or(FuzzingError::AccountNotFound)? | ||
.map_err(|_| FuzzingError::CannotDeserializeAccount)?; | ||
.ok_or(FuzzingError::AccountNotFound(#name_str.to_string()))? | ||
// TODO It would be helpful to do something like line below. |
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.
I tried to resolve it but without success. It really looks like some issue due to reexporting the type and having different anchor versions. Not sure. For now it is not critical. I will try to look at it once we update to anchor 0.29.0....
* 🥅 WIP: error handling * 🔥 update FuzzTestExecutor to the default state * 🚑️ box banksclient and minor error updates * 🎨 fmt * 🚀 update snapshot generator * ✅ update tests * ✅ update fuzz_example3 * 🎨 Cosmetic non-functional changes. --------- Co-authored-by: lukacan <andrej@DESKTOP-UME2160.localdomain> Co-authored-by: Ikrk <ikrk@centrum.cz>
Currently, marked as draft as branch is WIP:
I would like to open a discussion to get feedback on whether the error handling is implemented correctly. Feel free to also point out some ideas or suggestions.