Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions zkevm-circuits/src/evm_circuit/util/constraint_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> {
&mut self,
tx_id: Expression<F>,
log_id: Expression<F>,
tag: TxLogFieldTag,
field_tag: TxLogFieldTag,
index: Expression<F>,
value: Expression<F>,
) {
Expand All @@ -1053,8 +1053,8 @@ impl<'a, F: FieldExt> ConstraintBuilder<'a, F> {
RwTableTag::TxLog,
[
tx_id,
index + (1u64 << 8).expr() * log_id,
tag.expr(),
index + (1u64 << 16).expr() * field_tag.expr() + (1u64 << 32).expr() * log_id,
field_tag.expr(),
0.expr(),
value,
0.expr(),
Expand Down
15 changes: 13 additions & 2 deletions zkevm-circuits/src/evm_circuit/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,19 @@ impl Rw {
Self::Stack { stack_pointer, .. } => {
Some(U256::from(*stack_pointer as u64).to_address())
}
Self::TxLog { log_id, index, .. } => {
Some((U256::from(*index as u64) + (U256::from(*log_id) << 8)).to_address())
Self::TxLog {
log_id,
index,
field_tag,
..
} => {
// make field_tag fit into one limb (16 bits)
Some(
(U256::from(*index as u64)
+ (U256::from(*field_tag as u64) << 16)
+ (U256::from(*log_id) << 32))
.to_address(),
)
}
Self::Start
| Self::CallContext { .. }
Expand Down