From 25e9c65a1c2a6b022a08d95a565f04836aa48684 Mon Sep 17 00:00:00 2001 From: Chris Tian Date: Fri, 9 Feb 2024 17:29:12 -0800 Subject: [PATCH] serial test --- Cargo.lock | 39 +++++++++++++++++++++++++++++++++++++++ core/Cargo.toml | 1 + core/src/runtime/mod.rs | 9 ++++++++- core/src/stark/runtime.rs | 10 ++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 86ab191b71..65920ed88b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -978,6 +978,19 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -3638,6 +3651,31 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "serial_test" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" +dependencies = [ + "dashmap", + "futures", + "lazy_static", + "log", + "parking_lot", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3873,6 +3911,7 @@ dependencies = [ "rrs-lib", "serde", "serde_json", + "serial_test", "size", "succinct-k12", "tempfile", diff --git a/core/Cargo.toml b/core/Cargo.toml index 88d963b436..2cf5ba6a73 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -53,6 +53,7 @@ serde_json = { version = "1.0.113", default-features = false, features = [ ] } k256 = { version = "0.13.3", features = ["expose-field"] } elliptic-curve = "0.13.8" +serial_test = "3.0.0" [dev-dependencies] criterion = "0.5.1" diff --git a/core/src/runtime/mod.rs b/core/src/runtime/mod.rs index e18c291f4d..850f5798c7 100644 --- a/core/src/runtime/mod.rs +++ b/core/src/runtime/mod.rs @@ -873,7 +873,10 @@ impl Runtime { #[cfg(test)] pub mod tests { - use crate::{runtime::Register, utils::tests::FIBONACCI_ELF}; + use crate::{ + runtime::Register, + utils::tests::{FIBONACCI_ELF, SSZ_WITHDRAWALS_ELF}, + }; use super::{Instruction, Opcode, Program, Runtime}; @@ -890,6 +893,10 @@ pub mod tests { Program::from(FIBONACCI_ELF) } + pub fn ssz_withdrawals_program() -> Program { + Program::from(SSZ_WITHDRAWALS_ELF) + } + pub fn ecall_lwa_program() -> Program { let instructions = vec![ Instruction::new(Opcode::ADD, 5, 0, 101, false, true), diff --git a/core/src/stark/runtime.rs b/core/src/stark/runtime.rs index c937cb4c97..5cdfebfc3f 100644 --- a/core/src/stark/runtime.rs +++ b/core/src/stark/runtime.rs @@ -227,12 +227,14 @@ pub mod tests { use crate::runtime::tests::fibonacci_program; use crate::runtime::tests::simple_memory_program; use crate::runtime::tests::simple_program; + use crate::runtime::tests::ssz_withdrawals_program; use crate::runtime::Instruction; use crate::runtime::Opcode; use crate::runtime::Program; use crate::utils; use crate::utils::prove; use crate::utils::setup_logger; + use serial_test::serial; #[test] fn test_simple_prove() { @@ -375,6 +377,14 @@ pub mod tests { prove(program); } + #[test] + #[serial] + fn test_ssz_withdrawals_prove() { + setup_logger(); + let program = ssz_withdrawals_program(); + prove(program); + } + #[test] fn test_simple_memory_program_prove() { let program = simple_memory_program();