-
Notifications
You must be signed in to change notification settings - Fork 212
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
Bump blockifier to v0.13.5 #3130
base: master
Are you sure you want to change the base?
Conversation
Towards #3037 Note: It is not possible to use blockifier from the Starkware repository at the moment due to a conflict with the |
dce17db
to
bbb2a19
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.
all the stuff is rather nitpicky so it's a +1 from me, but please address all the comments first (one way or the other). Great job 💪
...heatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/entry_point.rs
Outdated
Show resolved
Hide resolved
...heatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/entry_point.rs
Outdated
Show resolved
Hide resolved
crates/cheatnet/src/runtime_extensions/deprecated_cheatable_starknet_extension/mod.rs
Outdated
Show resolved
Hide resolved
versioned_constants.get_syscall_gas_cost(name) * (*count as u64) | ||
.map(|(selector, usage)| { | ||
let syscall_gas_cost = versioned_constants.get_syscall_gas_cost(selector); | ||
let base_cost = syscall_gas_cost.get_syscall_cost(0); |
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.
as per comment above. idea: maybe we could make this logic common, put it in a function or something?
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.
Added get_syscalls_gas_consumed
function
// Increment the Deploy syscall's linear cost counter by the number of elements in the | ||
// constructor calldata | ||
syscall_handler.increment_linear_factor_by( | ||
&SyscallSelector::Deploy, | ||
request.constructor_calldata.0.len(), | ||
); | ||
|
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.
Does this affect the gas tests? Or is the linear factor too small to contribute to them?
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 does affect gas costs, which is reflected in the sierra gas tests below. When tracking Cairo steps it is negligible in our tests due to different fee formulat. We could potentially add a test that has it reflected for Cairo steps, but it would require calling deploy
with calldata with at least 4 or 5 elements to see any change.
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.
Maybe it'd be worth adding a test like this. If we already are trying to be quite throughout with our gas tests.
let entry_point = ExecutableCallEntryPoint { | ||
class_hash, | ||
code_address: entry_point.code_address, | ||
entry_point_type: entry_point.entry_point_type, | ||
entry_point_selector: entry_point.entry_point_selector, | ||
calldata: entry_point.calldata.clone(), | ||
storage_address: entry_point.storage_address, | ||
caller_address: entry_point.caller_address, | ||
call_type: entry_point.call_type, | ||
initial_gas: entry_point.initial_gas, | ||
}; |
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.
Why do we need to reconstruct the entire entrypoint now? Not a big problem but I just wonder.
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 was wondering as well, but it seems these are actually different structs now (ExecutableCallEntryPoint vs CallEntryPoint), and I don't think there is any way in blockifier to cast one to another
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.
We need to pass ExecutableCallEntryPoint
not CallEntryPoint
to execute_entry_point_call_cairo1
below. There is a function into_executable but it is private.
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.
Let's create a PR that makes it public and an issue so we can update this eventually.
...heatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/entry_point.rs
Outdated
Show resolved
Hide resolved
...heatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/entry_point.rs
Outdated
Show resolved
Hide resolved
crates/cheatnet/src/runtime_extensions/cheatable_starknet_runtime_extension.rs
Show resolved
Hide resolved
bbb2a19
to
9ddd29f
Compare
commit-id:1bd782e3
9ddd29f
to
74d2f3a
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.
See my outstanding comments, otherwise looks good
// We want to calculate `base_cost * call_count + linear_cost * linear_factor` | ||
// There is a field name `linear_factor` used in both `SyscallUsage` and `SyscallGasCost` | ||
// In `get_syscall_cost` function `linear_length` parameter is calldata length, hence `SyscallUsage.linear_factor` |
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.
What I meant is that the math to get these values is not 100% obvious (i.e. reason for call_count - 1).
But the extra context is also useful.
Stack:
ArchivalDataResources
from blockifier #3132cairo1_execution.rs
#3131