@@ -113,7 +113,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
113
113
tx_id. expr ( ) ,
114
114
WordLoHi :: new ( [ addr. expr ( ) , 0 . expr ( ) ] ) ,
115
115
1 . expr ( ) ,
116
- 0 . expr ( ) ,
116
+ 0 . expr ( ) , // Here value_prev is 0
117
117
None ,
118
118
) ;
119
119
} // rwc_delta += PRECOMPILE_COUNT
@@ -123,17 +123,17 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
123
123
tx_id. expr ( ) ,
124
124
tx. caller_address . to_word ( ) ,
125
125
1 . expr ( ) ,
126
- 0 . expr ( ) ,
126
+ 0 . expr ( ) , // Here too
127
127
None ,
128
128
) ; // rwc_delta += 1
129
- let is_caller_callee_equal = cb. query_bool ( ) ;
129
+ let is_caller_callee_equal = cb. query_bool ( ) ; // What does this variable mean?
130
130
cb. account_access_list_write_unchecked (
131
131
tx_id. expr ( ) ,
132
132
tx. callee_address . to_word ( ) ,
133
133
1 . expr ( ) ,
134
134
// No extra constraint being used here.
135
135
// Correctness will be enforced in build_tx_access_list_account_constraints
136
- is_caller_callee_equal. expr ( ) ,
136
+ is_caller_callee_equal. expr ( ) , // And value_prev = is_caller_callee_equal
137
137
None ,
138
138
) ; // rwc_delta += 1
139
139
@@ -149,7 +149,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
149
149
tx_id. expr ( ) ,
150
150
coinbase. to_word ( ) ,
151
151
1 . expr ( ) ,
152
- is_coinbase_warm. expr ( ) ,
152
+ is_coinbase_warm. expr ( ) , // Why value_prev is = is_coinbase_warm?
153
153
None ,
154
154
) ; // rwc_delta += 1
155
155
@@ -160,6 +160,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
160
160
// no_callee_code is true when the account exists and has empty
161
161
// code hash, or when the account doesn't exist (which we encode with
162
162
// code_hash = 0).
163
+ // Why do we have summation here if any of the terms is enough?
163
164
let no_callee_code = is_empty_code_hash. expr ( ) + callee_not_exists. expr ( ) ;
164
165
165
166
// TODO: And not precompile
@@ -183,7 +184,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
183
184
& mut reversion_info,
184
185
) ;
185
186
186
- let caller_nonce_hash_bytes = cb. query_word32 ( ) ;
187
+ let caller_nonce_hash_bytes = cb. query_word32 ( ) ; // What's this variable for?
187
188
let create = ContractCreateGadget :: construct ( cb) ;
188
189
cb. require_equal_word (
189
190
"tx caller address equivalence" ,
@@ -209,8 +210,6 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
209
210
create. caller_nonce ( ) ,
210
211
) ;
211
212
212
- // TODO: add missing constraints:
213
-
214
213
// 1. Handle contract creation transaction.
215
214
cb. condition ( tx. is_create . expr ( ) , |cb| {
216
215
cb. keccak_table_lookup (
0 commit comments