-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(blockifier): add emit_event cairo native syscall #1550
Conversation
aaa5666
to
8c09e8e
Compare
8c09e8e
to
46c5b71
Compare
Artifacts upload triggered. View details here |
46c5b71
to
0ea5aff
Compare
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion
a discussion (no related file):
I'm looking for more clarification on the expected error return behavior. For errors that are not of the type SyscallExecutionError::SyscallError
, I'm currently using .expect(...)
, which causes tests to fail in some syscall PRs. This can be handled in several ways. There is currently a discussion on this topic here: https://reviewable.io/reviews/starkware-libs/sequencer/1305#-O96F70GASwm5B06IRKL
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.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @PearsonWhite)
crates/blockifier/src/execution/native/syscall_handler.rs
line 261 at r1 (raw file):
&event, ) .expect("Number of events exceeded the size limit.");
This should be returned as a runtime error, not expect
0ea5aff
to
b591644
Compare
Artifacts upload triggered. View details here |
b591644
to
e119b04
Compare
Artifacts upload triggered. View details here |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1550 +/- ##
===========================================
+ Coverage 40.10% 69.12% +29.02%
===========================================
Files 26 105 +79
Lines 1895 13701 +11806
Branches 1895 13701 +11806
===========================================
+ Hits 760 9471 +8711
- Misses 1100 3827 +2727
- Partials 35 403 +368 ☔ View full report in Codecov by Sentry. |
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.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @varex83)
a discussion (no related file):
Previously, PearsonWhite wrote…
I'm looking for more clarification on the expected error return behavior. For errors that are not of the type
SyscallExecutionError::SyscallError
, I'm currently using.expect(...)
, which causes tests to fail in some syscall PRs. This can be handled in several ways. There is currently a discussion on this topic here: https://reviewable.io/reviews/starkware-libs/sequencer/1305#-O96F70GASwm5B06IRKL
Changed this. Currently returning errors as encoded Felts in the retdata.
crates/blockifier/src/execution/native/syscall_handler.rs
line 261 at r1 (raw file):
Previously, varex83 (Bohdan Ohorodnii) wrote…
This should be returned as a runtime error, not
expect
Done.
There's a function called |
crates/blockifier/src/execution/syscalls/syscall_tests/emit_event.rs
Outdated
Show resolved
Hide resolved
a00063b
to
8ad184c
Compare
8ad184c
to
93ac2d0
Compare
e119b04
to
7e3b4f6
Compare
Artifacts upload triggered. View details here |
9327187
to
56d98f9
Compare
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.
Reviewable status: 0 of 3 files reviewed, 4 unresolved discussions (waiting on @varex83 and @xrvdg)
crates/blockifier/src/execution/native/utils.rs
line 25 at r2 (raw file):
Previously, xrvdg (Xander van der Goot) wrote…
There's a function called
format_panic_data
that has the exact same signature. Could that be used instead?
format_panic_data
is meant for a Vec of Felts that are short strings, and thus are limited to 31 characters. Longer explanation below:
I think format_panic_data
is used for an array of Felts where each Felt is an error in the format:
(<felt_as_str_as_felt> ('<str_as_felt>')
, where the Felt represents a short string. For example, it would take the felt array slice: [0x7820213d2079]
and return the String (0x7820213d2079 ('x != y')
But the Vec<Felt>
from call_info.execution.retdata.0
in this case was created with encode_str_as_felts
(String->Vec). Each Felt is not meant to independent; it's just part of the string. format_panic_data
would interpret each Felt as an error, see that it can be interpreted as a string, output the format above, and join it with the other results. You would get the following:
"(0x457863656564656420746865206d6178696d756d206b657973206c656e6774 ('Exceeded the maximum keys lengt'), 0x682c206b657973206c656e6774683a2035312c206d6178206b657973206c65 ('h, keys length: 51, max keys le'), 0x6e6774683a2035302e00000000000000000000000000000000000000000000 ('ngth: 50.'))"
Artifacts upload triggered. View details here |
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.
Reviewed 1 of 3 files at r4, 4 of 4 files at r7, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @avi-starkware and @xrvdg)
5a001b3
to
d90688f
Compare
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.
Reviewed 4 of 4 files at r7, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @avi-starkware and @Yoni-Starkware)
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.
Dismissed @xrvdg from 2 discussions.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @avi-starkware and @Yoni-Starkware)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avi-starkware and @Yoni-Starkware)
544ca4f
to
7b1714f
Compare
Artifacts upload triggered. View details here |
7b1714f
to
1c8e242
Compare
Artifacts upload triggered. View details here |
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.
Reviewed 2 of 2 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)
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.
Reviewed 2 of 2 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)
816c81b
to
b0fa3a9
Compare
5dd4c78
to
fb263f5
Compare
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
fb263f5
to
3659533
Compare
Artifacts upload triggered. View details here |
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.
Reviewed 1 of 3 files at r4, 2 of 4 files at r7, 2 of 2 files at r9, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @meship-starkware, @noaov1, @varex83, and @xrvdg)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @meship-starkware, @noaov1, @varex83, and @xrvdg)
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @PearsonWhite)
Implements the
emit_event
syscall for native cairo syscall handler.