Skip to content

Commit

Permalink
Merge pull request #41 from kroma-network/fix/fix-rlp-circuit-bug-for…
Browse files Browse the repository at this point in the history
…-deposit-tx

fix: fix rlp circuit bug for deposit tx
  • Loading branch information
dongchangYoo authored Apr 29, 2024
2 parents 91fde64 + 2e8cf51 commit f534f0e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
21 changes: 20 additions & 1 deletion zkevm-circuits/src/rlp_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ impl<F: Field> RlpCircuitConfig<F> {
is_sig_r(meta),
is_sig_s(meta),
#[cfg(feature = "kroma")]
is_mint(meta),
#[cfg(feature = "kroma")]
is_source_hash(meta),
]);

Expand Down Expand Up @@ -1209,7 +1211,7 @@ impl<F: Field> RlpCircuitConfig<F> {
cb.condition(
and::expr(vec![
not::expr(meta.query_advice(rlp_table.data_type, Rotation::cur())),
not::expr(is_tag_next_padding),
not::expr(is_tag_next_padding.clone()),
]),
|cb| {
cb.require_equal(
Expand All @@ -1222,6 +1224,7 @@ impl<F: Field> RlpCircuitConfig<F> {
meta.query_advice(rlp_table.data_type, Rotation::next()),
RlpDataType::TxHash.expr(),
);
#[cfg(not(feature = "kroma"))]
cb.require_equal(
"TxHash rows' first row is Prefix again",
meta.query_advice(rlp_table.tag, Rotation::next()),
Expand All @@ -1235,6 +1238,22 @@ impl<F: Field> RlpCircuitConfig<F> {
},
);

#[cfg(feature = "kroma")]
cb.condition(
and::expr(vec![
not::expr(meta.query_advice(rlp_table.data_type, Rotation::cur())),
not::expr(is_tag_next_padding),
not::expr(meta.query_advice(is_deposit_tx, Rotation::cur())),
]),
|cb| {
cb.require_equal(
"TxHash rows' first row is Prefix again",
meta.query_advice(rlp_table.tag, Rotation::next()),
RlpTxTag::Prefix.expr(),
);
},
);

cb.gate(and::expr(vec![
meta.query_fixed(q_usable, Rotation::cur()),
meta.query_advice(is_last, Rotation::cur()),
Expand Down
6 changes: 3 additions & 3 deletions zkevm-circuits/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// Major version
pub const MAJOR: u32 = 0;
/// Minor version
pub const MINOR: u32 = 1;
pub const MINOR: u32 = 2;
/// Patch version
pub const PATCH: u32 = 0;

Expand All @@ -18,10 +18,10 @@ mod tests {

#[test]
fn test_version_string() {
let expected = "0.1.0";
let expected = "0.2.0";

assert_eq!(version::MAJOR, 0, "wrong version");
assert_eq!(version::MINOR, 1, "wrong version");
assert_eq!(version::MINOR, 2, "wrong version");
assert_eq!(version::PATCH, 0, "wrong version");
assert_eq!(version::as_string(), expected, "wrong version");
}
Expand Down

0 comments on commit f534f0e

Please sign in to comment.