Skip to content
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): cairo1 revert stack now part of ErrorStack #1490

Conversation

dorimedini-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 91.42857% with 6 lines in your changes missing coverage. Please review.

Project coverage is 69.32%. Comparing base (e3165c4) to head (736d0dc).
Report is 417 commits behind head on main.

Files with missing lines Patch % Lines
crates/blockifier/src/execution/stack_trace.rs 89.09% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1490       +/-   ##
===========================================
+ Coverage   40.10%   69.32%   +29.22%     
===========================================
  Files          26      105       +79     
  Lines        1895    13804    +11909     
  Branches     1895    13804    +11909     
===========================================
+ Hits          760     9570     +8810     
- Misses       1100     3831     +2731     
- Partials       35      403      +368     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from 8d4dd2e to 8f4fea9 Compare October 21, 2024 08:49
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 7c53e8f to ff1d548 Compare October 21, 2024 08:49
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from 8f4fea9 to 66a1db9 Compare October 21, 2024 09:44
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch 2 times, most recently from 9631fe8 to 29566cc Compare October 21, 2024 09:46
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from 66a1db9 to 622c07d Compare October 21, 2024 10:44
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 29566cc to 9a188fb Compare October 21, 2024 10:44
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from 622c07d to dba1f3c Compare October 21, 2024 12:04
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 9a188fb to d49b575 Compare October 21, 2024 12:04
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from dba1f3c to aeeb55b Compare October 21, 2024 15:44
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from d49b575 to 00aeed8 Compare October 21, 2024 15:44
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from aeeb55b to d784023 Compare October 21, 2024 16:12
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 00aeed8 to 2f5561a Compare October 21, 2024 16:12
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from d784023 to 8baccd9 Compare October 21, 2024 18:49
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 2f5561a to 602acee Compare October 21, 2024 18:49
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from 8baccd9 to 1fa2da4 Compare October 21, 2024 19:20
@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 602acee to 4aeb197 Compare October 21, 2024 19:20
@dorimedini-starkware dorimedini-starkware force-pushed the 10-20-test_blockifier_test_negative_flows_of_cairo1_revert_trace branch from 1fa2da4 to 8c257ac Compare October 22, 2024 08:41
@ilyalesokhin-starkware
Copy link
Contributor

crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, dorimedini-starkware wrote…

because this cairo1 revert stack cannot contain entry point frames or vm frames in it; once we hit a Cairo1 revert stack, it must be by definition the tail of the stack.
since this is a variant of Frame, and the cairo1 revert stack contains it's own concept of frames, I thought it wise to be explicit in the variant name

What is a frame?

@ilyalesokhin-starkware
Copy link
Contributor

crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, dorimedini-starkware wrote…

why not? it is part of the data; the cairo1 revert stack always starts comes from one of two sources (validate/execute)

the stack is the same regardless of if the source is validate or execute

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a 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 9 files reviewed, 3 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

What is a frame?

up until now, two frames basically: entry point frame (one per syscall) and VM frame (one per inner call in a contract, one PC location per frame).
I am open to renaming this type if you think it's confusing


crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

the stack is the same regardless of if the source is validate or execute

not it's string formatting. we provide a header indicating whether this is from validate or execute.

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a 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 9 files reviewed, 3 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, dorimedini-starkware wrote…

not it's string formatting. we provide a header indicating whether this is from validate or execute.

the TransactionExecutionInfo needs this info, because it will store a non-stringified error stack object.
when converted to a string we need to print the respective header

@ilyalesokhin-starkware
Copy link
Contributor

crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, dorimedini-starkware wrote…

the TransactionExecutionInfo needs this info, because it will store a non-stringified error stack object.
when converted to a string we need to print the respective header

can you store it in the TansactionExecutionInfo?

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a 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 9 files reviewed, 3 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

can you store it in the TansactionExecutionInfo?

why?
this means that ErrorStack cannot implement Display, because part of the data needed to format the string is not in the struct

@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 4477620 to d8e3ca5 Compare November 3, 2024 10:59
Copy link

github-actions bot commented Nov 3, 2024

Artifacts upload triggered. View details here

@ilyalesokhin-starkware
Copy link
Contributor

crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, dorimedini-starkware wrote…

up until now, two frames basically: entry point frame (one per syscall) and VM frame (one per inner call in a contract, one PC location per frame).
I am open to renaming this type if you think it's confusing

Putting a stack and a frame in stack in the same enum is strange.

@ilyalesokhin-starkware
Copy link
Contributor

crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, dorimedini-starkware wrote…

why?
this means that ErrorStack cannot implement Display, because part of the data needed to format the string is not in the struct

If you add it it is no longer a just a revert stack.

Maybe we should rename it to
Cairo1RevertSummery?

@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from d8e3ca5 to afd8e6c Compare November 7, 2024 10:11
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a 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 9 files reviewed, 3 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

Putting a stack and a frame in stack in the same enum is strange.

renamed


crates/blockifier/src/execution/stack_trace.rs line 234 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

If you add it it is no longer a just a revert stack.

Maybe we should rename it to
Cairo1RevertSummery?

Done.

Copy link

github-actions bot commented Nov 7, 2024

Artifacts upload triggered. View details here

@ilyalesokhin-starkware
Copy link
Contributor

crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, dorimedini-starkware wrote…

renamed

What about the variant name?

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 8 files at r2, 3 of 6 files at r4.
Reviewable status: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @ilyalesokhin-starkware)


crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, ilyalesokhin-starkware wrote…

What about the variant name?

what do you suggest?

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/blockifier/src/execution/stack_trace.rs line 101 at r2 (raw file):

Previously, dorimedini-starkware wrote…

what do you suggest?

Cairo1RevertSummery
or just
RevertSummery

@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from afd8e6c to 439c529 Compare November 14, 2024 08:03
Copy link

Artifacts upload triggered. View details here

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 7 of 7 files at r5, all commit messages.
Reviewable status: 8 of 9 files reviewed, all discussions resolved (waiting on @dorimedini-starkware)

@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from 439c529 to c1be537 Compare November 17, 2024 09:03
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a 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 r6, all commit messages.
Reviewable status: 8 of 9 files reviewed, all discussions resolved

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 8 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)

Copy link

Artifacts upload triggered. View details here

@dorimedini-starkware dorimedini-starkware force-pushed the 10-21-feat_blockifier_cairo1_revert_stack_now_part_of_errorstack branch from c1be537 to 736d0dc Compare November 17, 2024 09:20
Copy link

Artifacts upload triggered. View details here

Copy link
Collaborator Author

dorimedini-starkware commented Nov 17, 2024

Merge activity

  • Nov 17, 5:09 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Nov 17, 5:09 AM EST: A user merged this pull request with Graphite.

@dorimedini-starkware dorimedini-starkware merged commit 641ba41 into main Nov 17, 2024
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants