This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-11
lines changed
zkevm-circuits/src/evm_circuit/execution Expand file tree Collapse file tree 5 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,14 @@ impl TransactionContext {
93
93
reversion_groups : Vec :: new ( ) ,
94
94
l1_fee : geth_trace. l1_fee ,
95
95
} ;
96
- tx_ctx. push_call_ctx ( 0 , eth_tx. input . to_vec ( ) ) ;
96
+ tx_ctx. push_call_ctx (
97
+ 0 ,
98
+ if eth_tx. to . is_none ( ) {
99
+ Vec :: new ( )
100
+ } else {
101
+ eth_tx. input . to_vec ( )
102
+ } ,
103
+ ) ;
97
104
98
105
Ok ( tx_ctx)
99
106
}
@@ -344,7 +351,7 @@ impl Transaction {
344
351
code_hash,
345
352
depth : 1 ,
346
353
value : eth_tx. value ,
347
- call_data_length : eth_tx . input . len ( ) . try_into ( ) . unwrap ( ) ,
354
+ call_data_length : 0 ,
348
355
..Default :: default ( )
349
356
}
350
357
} ;
Original file line number Diff line number Diff line change @@ -754,10 +754,7 @@ pub fn gen_begin_tx_ops(
754
754
CallContextField :: CallDataOffset ,
755
755
call. call_data_offset . into ( ) ,
756
756
) ,
757
- (
758
- CallContextField :: CallDataLength ,
759
- state. tx . input . len ( ) . into ( ) ,
760
- ) ,
757
+ ( CallContextField :: CallDataLength , 0 . into ( ) ) ,
761
758
( CallContextField :: Value , call. value ) ,
762
759
( CallContextField :: IsStatic , ( call. is_static as usize ) . into ( ) ) ,
763
760
( CallContextField :: LastCalleeId , 0 . into ( ) ) ,
Original file line number Diff line number Diff line change @@ -412,10 +412,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
412
412
call_callee_address. expr ( ) ,
413
413
) ,
414
414
( CallContextFieldTag :: CallDataOffset , 0 . expr ( ) ) ,
415
- (
416
- CallContextFieldTag :: CallDataLength ,
417
- tx_call_data_length. expr ( ) ,
418
- ) ,
415
+ ( CallContextFieldTag :: CallDataLength , 0 . expr ( ) ) ,
419
416
( CallContextFieldTag :: Value , tx_value. expr ( ) ) ,
420
417
( CallContextFieldTag :: IsStatic , 0 . expr ( ) ) ,
421
418
( CallContextFieldTag :: LastCalleeId , 0 . expr ( ) ) ,
@@ -1236,6 +1233,7 @@ mod test {
1236
1233
PUSH1 ( 0 )
1237
1234
MSTORE
1238
1235
1236
+ CALLDATASIZE
1239
1237
PUSH1 ( 2 )
1240
1238
PUSH1 ( 0 )
1241
1239
RETURN
Original file line number Diff line number Diff line change @@ -194,7 +194,14 @@ impl<F: Field> ExecutionGadget<F> for CallDataCopyGadget<F> {
194
194
195
195
// Call data length and call data offset
196
196
let ( call_data_length, call_data_offset) = if call. is_root {
197
- ( tx. call_data_length as u64 , 0_u64 )
197
+ (
198
+ if tx. is_create {
199
+ 0
200
+ } else {
201
+ tx. call_data_length as u64
202
+ } ,
203
+ 0_u64 ,
204
+ )
198
205
} else {
199
206
( call. call_data_length , call. call_data_offset )
200
207
} ;
Original file line number Diff line number Diff line change @@ -835,6 +835,7 @@ mod test {
835
835
PUSH10 ( memory_value)
836
836
PUSH1 ( memory_address)
837
837
MSTORE
838
+ CALLDATASIZE
838
839
PUSH2 ( 5 )
839
840
PUSH2 ( 32u64 - u64 :: try_from( memory_bytes. len( ) ) . unwrap( ) )
840
841
} ;
You can’t perform that action at this time.
0 commit comments