-
Notifications
You must be signed in to change notification settings - Fork 37
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
refactor: frontend of trace_decoder
#309
Conversation
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.
Fairly light review for now but two points:
- a lot of noise is coming from just removing the imports and calling
trace_decoder::Foo::bar()
instead. This adds needless overhead and makes code harder to parse IMO. (As far as I saw, 90% of zero-bin changes are just this) - testing: the previous decoder was testing some specific test payloads, which this PR completely removes (including doctest). Current coverage is even lower than before (37.8% -> 29.8% for
trace_decoder
only) so may deserve more work
@temaniarpit27 As you are in charge of testing, could we have (in addition to whole, regular blocks), tests for these "edge-cases":
|
@Nashtare could you help me understand your objection here? $ git rev-parse --short HEAD
baecefcb
$ cargo test --package trace_decoder --doc
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.11s
Doc-tests trace_decoder
running 3 tests
test trace_decoder/src/lib.rs - (line 24) ... ignored
test trace_decoder/src/lib.rs - (line 6) ... ignored
test trace_decoder/src/lib.rs - (line 76) ... ignored It contained 6 MPT payloads: zk_evm/trace_decoder/src/compact/complex_test_payloads.rs Lines 17 to 30 in baecefc
All of which I have migrated: There is only one test case that has been removed:
Which I don't trust because of this: zk_evm/trace_decoder/src/wire.rs Lines 241 to 244 in 76669ee
The other point you mentioned is coverage - code coverage of the backend should be the same, because that's not changed, |
My bad for doctest, I thought these were running and not ignored.
|
@Nashtare
But I hope I've shown that, since the test cases are the same the drop in %coverage is an apples to oranges comparison, so shouldn't block this review. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
8e2febd
to
daf294a
Compare
@Nashtare, I think this PR has the following main risks:
(2) is partially addressed by the existing unit tests, which we've already discussed. I welcome additional test cases, but they shouldn't block this Do you agree? |
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.
Overall I'm ok with merging as is but:
- with additions of some TODOs left for the future (cf some comments)
- with clarifications on the different
BUG
mentions for other contributors, which aren't really clear when just looking at the surrounding code.
yikes @ CI, fixed in #357 |
I think I'm broadly good with this |
I looked at an earlier version and had no major concerns. If Robin has looked and is happy then I'd say you're free to merge. |
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.
Yeah I'm broadly ok to merge (based on previous version I reviewed) + latest review by Marko.
The previous code was extremely difficult to reason about, and was blocking prior attempts at the above issue.
The best thing was a rewrite, followed by SMT (backend) support (to be completed in a later PR).
For an explanation of the terminology, see this:
zk_evm/trace_decoder/src/lib.rs
Lines 68 to 78 in 76669ee
Change summary
trace_decoder
to be a singlefn entrypoint
, and a bunch of structs at the root.I'd prefer this PR didn't bikeshed names - we can't finalize an API until we see what the SMT backend requires.
wire
.zero_jerigon
hermez_cdk_erigon