test(outbox): expand outbox tests with invalid cases#940
Conversation
|
Benchmark results for revision 726318b:
Full results
Compare the results above with those for the default branch. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #940 +/- ##
==========================================
+ Coverage 89.71% 89.74% +0.03%
==========================================
Files 110 110
Lines 22136 22136
Branches 22136 22136
==========================================
+ Hits 19859 19866 +7
- Misses 1882 1888 +6
+ Partials 395 382 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
victor-dumitrescu
left a comment
There was a problem hiding this comment.
I think there are a few more scenarios worth testing to do with manipulating the proof itself:
- proof where the size of the message has been tampered with (both too small and too large), resulting in a deserialisation error
- proof which contains a message larger than the maximum message size, resulting in deserialisation error
There are a few more interesting scenarios but which we can't easily test with the current dummy kernel in which we fill every outbox level with the same message. We'd probably need to bring in the echo kernel and control the inbox for each test. These could be:
- valid proof with correct level but wrong index
- valid proof with correct index but wrong level
- try to produce proof for index which doesn't contain a message
The latter can be left as future work for now.
0c0e181 to
a766f9a
Compare
thomasathorne
left a comment
There was a problem hiding this comment.
LGTM, modulo the comments from Victor.
df0f024 to
f1a1cdf
Compare
Closes RV-910
What
Expand outbox proof tests with invalid and adversarial cases.
Why
The existing outbox proof tests only covered the happy path - producing, verifying valid proofs and serialization round trip. There was no coverage for invalid inputs (stale/future levels) or malicious proof manipulation (crafting custom Merkle proofs). These negative tests ensure the proof system rejects invalid proofs with the correct errors.
How
Added negative/adversarial tests for outbox proofs.
produce_outbox_proofreturnsLevelNotFoundfor stale (before outbox window) and future levels.AbsentDataAccess.Manually Testing
Tasks for the Author