privacy-scaling-explorations / zkevm-circuits

https://privacy-scaling-explorations.github.io/zkevm-circuits/
Other
821 stars 841 forks source link

fix(zkevm-circuits/begin_tx): add missing constraints #1776

Closed curryrasul closed 4 months ago

curryrasul commented 5 months ago

Description

This PR aims to fix #1475 by adding missing constraints.

Issue Link

1475

Type of change

Questions / Need Help

  1. Meaning of value_prev argument in account_access_list_write_unchecked. Why is it sometimes set to 0, and sometimes to bool values such as is_coinbase_warm or is_caller_callee_equal. What is is_caller_callee_equal for?
  2. There's expression: https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/main/zkevm-circuits/src/evm_circuit/execution/begin_tx.rs#L163 Why do we have summation - if is_empty_code_hash.expr() is enough (as well as callee_not_exists is enough)?
  3. What's caller_nonce_hash_bytes? Is it Keccak(sender, nonce) and we have to constrain this exact value?