Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit 3a8f950

Browse files
naureAurélien Nicolas
andauthored
rename end_offset (#747)
Co-authored-by: Aurélien Nicolas <[email protected]>
1 parent d5ca004 commit 3a8f950

16 files changed

+26
-24
lines changed

zkevm-circuits/src/evm_circuit/execution/calldatacopy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<F: Field> ExecutionGadget<F> for CallDataCopyGadget<F> {
9797
// Calculate the next memory size and the gas cost for this memory
9898
// access
9999
let memory_address = MemoryAddressGadget::construct(cb, memory_offset, length);
100-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
100+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
101101
let memory_copier_gas = MemoryCopierGasGadget::construct(
102102
cb,
103103
memory_address.length(),

zkevm-circuits/src/evm_circuit/execution/codecopy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<F: Field> ExecutionGadget<F> for CodeCopyGadget<F> {
7777
// Calculate the next memory size and the gas cost for this memory
7878
// access. This also accounts for the dynamic gas required to copy bytes to
7979
// memory.
80-
let memory_expansion = MemoryExpansionGadget::construct(cb, [dst_memory_addr.address()]);
80+
let memory_expansion = MemoryExpansionGadget::construct(cb, [dst_memory_addr.end_offset()]);
8181
let memory_copier_gas = MemoryCopierGasGadget::construct(
8282
cb,
8383
dst_memory_addr.length(),

zkevm-circuits/src/evm_circuit/execution/create.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<F: Field, const IS_CREATE2: bool, const S: ExecutionState> ExecutionGadget<
160160
create.code_hash_word_rlc(),
161161
CopyDataType::Bytecode.expr(),
162162
init_code.offset(),
163-
init_code.address(),
163+
init_code.end_offset(),
164164
0.expr(),
165165
init_code.length(),
166166
init_code_rlc.expr(),
@@ -333,7 +333,7 @@ impl<F: Field, const IS_CREATE2: bool, const S: ExecutionState> ExecutionGadget<
333333
},
334334
);
335335

336-
let memory_expansion = MemoryExpansionGadget::construct(cb, [init_code.address()]);
336+
let memory_expansion = MemoryExpansionGadget::construct(cb, [init_code.end_offset()]);
337337

338338
let init_code_word_size = ConstantDivisionGadget::construct(
339339
cb,

zkevm-circuits/src/evm_circuit/execution/error_oog_create.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGCreateGadget<F> {
7272
LtGadget::construct(cb, MAX_INIT_CODE_SIZE.expr(), memory_address.length());
7373

7474
let minimum_word_size = MemoryWordSizeGadget::construct(cb, memory_address.length());
75-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
75+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
7676

7777
let keccak_gas_cost = minimum_word_size.expr()
7878
* select::expr(

zkevm-circuits/src/evm_circuit/execution/error_oog_dynamic_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGDynamicMemoryGadget<F> {
4747
cb.stack_pop(memory_address.offset_rlc());
4848
cb.stack_pop(memory_address.length_rlc());
4949

50-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
50+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
5151

5252
let insufficient_gas = LtGadget::construct(
5353
cb,

zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGLogGadget<F> {
6464

6565
// Calculate the next memory size and the gas cost for this memory
6666
// access
67-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
67+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
6868

6969
let gas_cost = GasCost::LOG.as_u64().expr()
7070
+ GasCost::LOG.as_u64().expr() * topic_count

zkevm-circuits/src/evm_circuit/execution/error_oog_memory_copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGMemoryCopyGadget<F> {
9393
cb.stack_pop(src_offset.expr());
9494
cb.stack_pop(dst_memory_addr.length_rlc());
9595

96-
let memory_expansion = MemoryExpansionGadget::construct(cb, [dst_memory_addr.address()]);
96+
let memory_expansion = MemoryExpansionGadget::construct(cb, [dst_memory_addr.end_offset()]);
9797
let memory_copier_gas = MemoryCopierGasGadget::construct(
9898
cb,
9999
dst_memory_addr.length(),

zkevm-circuits/src/evm_circuit/execution/error_oog_sha3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGSha3Gadget<F> {
5252
cb.stack_pop(memory_address.offset_rlc());
5353
cb.stack_pop(memory_address.length_rlc());
5454

55-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
55+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
5656
let memory_copier_gas = MemoryCopierGasGadget::construct(
5757
cb,
5858
memory_address.length(),

zkevm-circuits/src/evm_circuit/execution/error_oog_static_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGStaticMemoryGadget<F> {
7373
);
7474

7575
// Get the next memory size and the gas cost for this memory access
76-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
76+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
7777

7878
// Check if the amount of gas available is less than the amount of gas
7979
// required

zkevm-circuits/src/evm_circuit/execution/extcodecopy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<F: Field> ExecutionGadget<F> for ExtcodecopyGadget<F> {
8989
cb.bytecode_length(code_hash.expr(), code_size.expr());
9090

9191
let memory_address = MemoryAddressGadget::construct(cb, memory_offset, memory_length);
92-
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.address()]);
92+
let memory_expansion = MemoryExpansionGadget::construct(cb, [memory_address.end_offset()]);
9393
let memory_copier_gas = MemoryCopierGasGadget::construct(
9494
cb,
9595
memory_address.length(),

0 commit comments

Comments
 (0)