-
Notifications
You must be signed in to change notification settings - Fork 190
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
Update blockifier #2397
base: main
Are you sure you want to change the base?
Update blockifier #2397
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2397 +/- ##
==========================================
- Coverage 74.41% 74.40% -0.02%
==========================================
Files 113 113
Lines 13016 13030 +14
==========================================
+ Hits 9686 9695 +9
- Misses 2592 2597 +5
Partials 738 738 ☔ View full report in Codecov by Sentry. |
// TODO: initial gas should be different based on the execution method used: vm or native! | ||
// There should be some check. | ||
let initial_gas = get_versioned_constants(block_info.version).infinite_gas_for_vm_mode(); | ||
|
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.
Note for myself to come back to this
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.
I think the todo text can be misleading. We shouldn't speak in terms of vm
or native
, but in terms of vm
and sierra gas
. The latter is independent of the execution engine (native
or vm
) while the former gas functionality is bounded to the vm
functionality
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.
It seems that the initial gas will depend on the transaction fields in the future, but this looks correct for now
// An estimation of the initial gas for a transaction to run with. This solution is
// temporary and this value will be deduced from the transaction's fields.
pub default_initial_gas_cost: u64,
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.
I think this initial_gas is assuming that we are going by default to execute using the previous gas scheme. There should be a check here that asks which contract class we are executing:
Are we charging "vm gas" or are we charging "sierra gas"?
Sierra gas only applies for >2.9.0 Sierra version in the contracts. VM gas for everything else.
I think there are other exceptions such as that if a contract begins executing itself with VM gas, then all the other calls to external contracts should stick to this gas mechanism (even if it fits to use Sierra gas). I need to read the release notes more thoroughly, because I don't know if it is exactly these or something slightly different.
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.
First round of review. Will do another pass later. Overall, everything looks good to me.
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.
I've seen that the constants version files 0_13_0
, 0_13_1
and 0_13_1_1
have changed. Are these changes consistent with the sequencer repo?
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.
Also, there are new additions such as 0_13_2
, 0_13_2_1
, 0_13_3
and 0_13_4
. We didn't have any files before and Juno was working.
Does the addition of these new files change anything? The answer should be yes, but I wonder why Juno was working correctly when it didn't have this files. Maybe we are missing checks/tests?
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.
Yes, we are. We only cover empty data cases.
// TODO: initial gas should be different based on the execution method used: vm or native! | ||
// There should be some check. | ||
let initial_gas = get_versioned_constants(block_info.version).infinite_gas_for_vm_mode(); | ||
|
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.
I think this initial_gas is assuming that we are going by default to execute using the previous gas scheme. There should be a check here that asks which contract class we are executing:
Are we charging "vm gas" or are we charging "sierra gas"?
Sierra gas only applies for >2.9.0 Sierra version in the contracts. VM gas for everything else.
I think there are other exceptions such as that if a contract begins executing itself with VM gas, then all the other calls to external contracts should stick to this gas mechanism (even if it fits to use Sierra gas). I need to read the release notes more thoroughly, because I don't know if it is exactly these or something slightly different.
1b31ef8
to
bcbc529
Compare
bcbc529
to
ee0a9a3
Compare
let da_gas_l1_gas = t.receipt.da_gas.l1_gas.into(); | ||
let da_gas_l1_data_gas = t.receipt.da_gas.l1_data_gas.into(); | ||
let execution_steps = t |
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.
Do we also need to return l2_gas in JunoAppendGasConsumed?
Up to the above comments the PR ltgm |
This pull request includes several changes to the
vm
module, primarily focusing on extending the class information invm/class.go
, updating dependencies inCargo.toml
.Class Information Extension:
marshalClassInfo
function invm/class.go
to includeClassVersion
andSierraVersion
fields for bothCairo0Class
andCompiledClass
. [1] [2]Dependency Updates:
vm/rust/Cargo.toml
to newer versions, includingblockifier
,cairo-lang-starknet-classes
,cairo-lang-runner
,starknet_api
, andstarknet-types-core
.