-
Notifications
You must be signed in to change notification settings - Fork 1
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 execution functions with proper error handling #107
Open
JulianGCalderon
wants to merge
15
commits into
main
Choose a base branch
from
remove-unwraps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JulianGCalderon
force-pushed
the
remove-unwraps
branch
2 times, most recently
from
December 17, 2024 21:58
684bf06
to
da146b6
Compare
JulianGCalderon
force-pushed
the
remove-unwraps
branch
from
December 18, 2024 13:39
709b9a6
to
9b1b15c
Compare
JulianGCalderon
force-pushed
the
remove-unwraps
branch
from
December 18, 2024 14:00
9b1b15c
to
9809bd6
Compare
JulianGCalderon
force-pushed
the
remove-unwraps
branch
from
December 18, 2024 17:30
ac6f3a7
to
65b6a7d
Compare
JulianGCalderon
requested review from
edg-l,
igaray,
azteca1998,
fmoletta,
pefontana and
gabrielbosio
as code owners
December 19, 2024 15:51
This was
linked to
issues
Dec 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #99, #84, #18
Supersedes #19
This PR refactors the execution functions to make them easier to user, and adds proper error handling. I replaced the old functions with 2 new functions:
execute_transaction
: Executes a single transaction with a clean state, fetching all needed information.fetch_transaction
: Fetches all information needed to execute a transaction. Useful when you need to use a previous state, instead of a clean one. After callingfetch_transaction
, you could just calltransaction.execute()
.The remaining changes on this PR are a side effect of the changes mentioned above.
The Github diff is not useful for reviewing the changes in
execution.rs
as they have a lot of overlap. I'd suggest reviewing it with an external editor, as the whole file has been changed.Other Improvements
Given a transaction in block N, we used block N-1 for fetching the transaction contextual information, this would fail when trying to execute a Declare, as block N-1 didn't have the declared class. This PR changes this, so that block N is used to fetch the transaction information, while block N-1 is used as the starting execution state.
This changed the behaviour of some transactions, as the block context contains fields such as gas price. I had to adjust the tests to the new values, which I obtained by comparing with Cairo VM. Some transactions are now emitting more events than before, which I think that indicates that it's now working better.
The replay flag
--charge-fee
was not being used. This PR fixes it.