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

Commit

Permalink
rewrite for new A5 testnest
Browse files Browse the repository at this point in the history
  • Loading branch information
CeciliaZ030 committed Aug 31, 2023
1 parent e723a84 commit 4f8d2c0
Show file tree
Hide file tree
Showing 3 changed files with 408 additions and 1 deletion.
2 changes: 2 additions & 0 deletions zkevm-circuits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub mod super_circuit;
pub mod table;
#[macro_use]
pub mod taiko_pi_circuit;
#[macro_use]
pub mod taiko_pi_circuit_;

Check failure on line 33 in zkevm-circuits/src/lib.rs

View workflow job for this annotation

GitHub Actions / Intra-doc links

missing documentation for a module

Check failure on line 33 in zkevm-circuits/src/lib.rs

View workflow job for this annotation

GitHub Actions / Build target wasm32-unknown-unknown

missing documentation for a module

Check failure on line 33 in zkevm-circuits/src/lib.rs

View workflow job for this annotation

GitHub Actions / Build target wasm32-wasi

missing documentation for a module

Check failure on line 33 in zkevm-circuits/src/lib.rs

View workflow job for this annotation

GitHub Actions / Clippy

missing documentation for a module

error: missing documentation for a module --> zkevm-circuits/src/lib.rs:33:1 | 33 | pub mod taiko_pi_circuit_; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> zkevm-circuits/src/lib.rs:16:9 | 16 | #![deny(missing_docs)] | ^^^^^^^^^^^^

Check failure on line 33 in zkevm-circuits/src/lib.rs

View workflow job for this annotation

GitHub Actions / Rustfmt

missing documentation for a module

Check failure on line 33 in zkevm-circuits/src/lib.rs

View workflow job for this annotation

GitHub Actions / Bitrot check

missing documentation for a module
pub mod taiko_super_circuit;

#[cfg(any(feature = "test", test))]
Expand Down
14 changes: 13 additions & 1 deletion zkevm-circuits/src/taiko_pi_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ pub struct PublicData {
pub l2_signal_service: Word,
/// l2 contract address
pub l2_contract: Word,


/// meta hash
pub meta_hash: Word,
/// block hash value
Expand Down Expand Up @@ -99,6 +101,7 @@ impl PublicData {
self.l2_signal_service.to_be_bytes().to_vec(),
),
("l2_contract", None, self.l2_contract.to_be_bytes().to_vec()),

("meta_hash", None, self.meta_hash.to_be_bytes().to_vec()),
(
"parent_hash",
Expand All @@ -125,6 +128,10 @@ impl PublicData {
]
}

// pub fn abi_encode(&self) -> Vec<u8> {

// }

/// get rpi bytes
pub fn rpi_bytes(&self) -> Vec<u8> {
self.assignments().iter().flat_map(|v| v.2.clone()).collect()
Expand Down Expand Up @@ -778,11 +785,16 @@ mod taiko_pi_circuit_test {
block.context.history_hashes = vec![OMMERS_HASH.to_word()];
block.context.block_hash = OMMERS_HASH.to_word();
block.context.number = 300.into();

println!("{:?}\n{:?}",
block.protocol_instance.meta_hash.hash(),
block.protocol_instance.meta_hash.hash().to_word());

let public_data = PublicData::new(&block);
println!("public_data: {:?}\n{:?}", public_data.meta_hash, public_data.meta_hash.to_be_bytes());

let k = 17;

assert_eq!(run::<Fr>(k, public_data, None), Ok(()));
// assert_eq!(run::<Fr>(k, public_data, None), Ok(()));
}
}
Loading

0 comments on commit 4f8d2c0

Please sign in to comment.