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

fix: Fix circuit implementation of EVM memory stipend #91

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1136,18 +1136,18 @@ where
zkevm_opcode_defs::system_params::NEW_EVM_FRAME_MEMORY_STIPEND,
);

let memory_stipend = UInt32::conditionally_select(
let memory_size_stipend_for_userspace = UInt32::conditionally_select(
cs,
new_callstack_entry.is_kernel_mode,
&memory_size_stipend_for_kernel,
versioned_byte_is_evm_bytecode,
&memory_size_stipend_for_evm,
&memory_size_stipend_for_userspace,
);

let memory_stipend = UInt32::conditionally_select(
cs,
versioned_byte_is_evm_bytecode,
&memory_size_stipend_for_evm,
&memory_stipend,
new_callstack_entry.is_kernel_mode,
&memory_size_stipend_for_kernel,
&memory_size_stipend_for_userspace,
);

new_callstack_entry.heap_upper_bound = memory_stipend;
Expand Down
Loading