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

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

Open
AronisAt79 opened this issue Mar 7, 2024 · 0 comments
Labels
T-bug Type: bug

Comments

@AronisAt79
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-bug Type: bug
Projects
Status: Milestone Tasks
Development

No branches or pull requests

1 participant