privacy-scaling-explorations / zkevm-circuits

Home Page:https://privacy-scaling-explorations.github.io/zkevm-circuits/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EVM Circuit: block.table_assignment introduces non fixed entries in fixed columns

AronisAt79 opened this issue · comments

What command(s) is the bug in?

No response

Describe the bug

Some fixed columns within the evm circuit are not actually fixed. It has been identified that when function

pub fn table_assignments<F: Field>(&self) -> Vec<[Value<F>; 4]> {

iterates over the history_hashes vector
let len_history = self.history_hashes.len();
self.history_hashes
.iter()
.enumerate()
.map(|(idx, hash)| {
[
Value::known(F::from(BlockContextFieldTag::BlockHash as u64)),
Value::known((self.number - len_history + idx).to_scalar().unwrap()),
Value::known(WordLoHi::from(*hash).lo()),
Value::known(WordLoHi::from(*hash).hi()),
]
})
.collect()

it results in non fixed pointer sequences.

Concrete steps to reproduce the bug. If it's able reproduce via testool, please share test_id from jenkins report

  1. Reproduce and display the mismatched columns with history < 256:
    Checkout this branch
    and execute:
    ./run.sh --sudo --steps "setup gendata"; cargo test --profile release --test circuits sub_mock_prover --all-features -- --nocapture
  2. Reproduce and display the mismatched columns with len_history = 256:
    Checkout this branch
    and execute:
    ./run.sh --sudo --steps "cleanup"; sudo docker system prune -af --volumes; ./run.sh --sudo --steps "setup gendata"; cargo test --profile release --test circuits sub_mock_prover --all-features -- --nocapture

Sample outputs for both tests in attached zip file
test_outputs.zip