Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit ce1f594

Browse files
committed
v0.5.8: fix codehash phase
1 parent aa2d252 commit ce1f594

File tree

1 file changed

+8
-8
lines changed
  • zkevm-circuits/src/evm_circuit

1 file changed

+8
-8
lines changed

zkevm-circuits/src/evm_circuit/util.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ impl<'r, 'b, F: FieldExt> CachedRegion<'r, 'b, F> {
199199
}
200200

201201
pub fn code_hash(&self, n: U256) -> Value<F> {
202-
self.challenges.evm_word().map(|r| {
203-
if cfg!(feature = "poseidon-codehash") {
204-
// only FieldExt is not enough for ToScalar trait so we have to make workaround
205-
rlc::value(&n.to_le_bytes(), F::from(256u64))
206-
} else {
207-
rlc::value(&n.to_le_bytes(), r)
208-
}
209-
})
202+
if cfg!(feature = "poseidon-codehash") {
203+
// only FieldExt is not enough for ToScalar trait so we have to make workaround
204+
Value::known(rlc::value(&n.to_le_bytes(), F::from(256u64)))
205+
} else {
206+
self.challenges
207+
.evm_word()
208+
.map(|r| rlc::value(&n.to_le_bytes(), r))
209+
}
210210
}
211211

212212
pub fn keccak_rlc(&self, le_bytes: &[u8]) -> Value<F> {

0 commit comments

Comments
 (0)