Skip to content

Commit

Permalink
merge short-prefix and testing features
Browse files Browse the repository at this point in the history
  • Loading branch information
eyusufatik committed Dec 19, 2024
1 parent d240484 commit ba5b7c2
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Build Project
run: |
cargo build --features short-prefix
cargo build --features testing
- name: Copy binary to build-push/nightly
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ EF_TESTS_URL := https://github.com/chainwayxyz/ef-tests/archive/develop.tar.gz
EF_TESTS_DIR := crates/evm/ethereum-tests
CITREA_E2E_TEST_BINARY := $(CURDIR)/target/debug/citrea
PARALLEL_PROOF_LIMIT := 1
TEST_FEATURES := --features short-prefix
TEST_FEATURES := --features testing
BATCH_OUT_PATH := resources/guests/risc0/
LIGHT_OUT_PATH := resources/guests/risc0/

Expand Down
2 changes: 1 addition & 1 deletion bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ sp1-helper = { version = "3.0.0", default-features = false }

[features]
default = [] # Deviate from convention by making the "native" feature active by default. This aligns with how this package is meant to be used (as a binary first, library second).
bench = ["hex"]
testing = ["citrea-primitives/testing", "citrea-risc0/testing", "sov-rollup-interface/testing"]

[[bin]]
name = "citrea"
Expand Down
3 changes: 1 addition & 2 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ brotli = { workspace = true }
sov-rollup-interface = { path = "../sovereign-sdk/rollup-interface", features = ["testing"] }

[features]
testing = ["short-prefix"]
short-prefix = []
testing = ["sov-rollup-interface/testing"]
8 changes: 4 additions & 4 deletions crates/primitives/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/// Prefix for the reveal transaction ids - batch proof namespace.
#[cfg(feature = "short-prefix")]
#[cfg(feature = "testing")]
pub const TO_BATCH_PROOF_PREFIX: &[u8] = &[1];
#[cfg(not(feature = "short-prefix"))]
#[cfg(not(feature = "testing"))]
pub const TO_BATCH_PROOF_PREFIX: &[u8] = &[1, 1];

/// Prefix for the reveal transaction ids - light client namespace.
#[cfg(feature = "short-prefix")]
#[cfg(feature = "testing")]
pub const TO_LIGHT_CLIENT_PREFIX: &[u8] = &[2];
#[cfg(not(feature = "short-prefix"))]
#[cfg(not(feature = "testing"))]
pub const TO_LIGHT_CLIENT_PREFIX: &[u8] = &[2, 2];

pub const TEST_PRIVATE_KEY: &str =
Expand Down
2 changes: 1 addition & 1 deletion crates/sovereign-sdk/rollup-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ serde_json = { workspace = true }
[features]
default = ["std"]
native = ["std", "tokio", "futures", "tracing"]
testing = ["native"]
testing = []
std = [
"anyhow/default",
"borsh/default",
Expand Down
2 changes: 1 addition & 1 deletion guests/risc0/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ methods = [

[features]
bench = []
short-prefix = []
testing = []
2 changes: 1 addition & 1 deletion guests/risc0/batch-proof-bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sov-rollup-interface = { path = "../../../crates/sovereign-sdk/rollup-interface"
sov-state = { path = "../../../crates/sovereign-sdk/module-system/sov-state" }

[features]
short-prefix = ["citrea-primitives/short-prefix"]
testing = ["citrea-primitives/testing"]

[patch.crates-io]
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
Expand Down
2 changes: 1 addition & 1 deletion guests/risc0/batch-proof-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sov-modules-stf-blueprint = { path = "../../../crates/sovereign-sdk/module-syste
sov-state = { path = "../../../crates/sovereign-sdk/module-system/sov-state" }

[features]
short-prefix = ["citrea-primitives/short-prefix"]
testing = ["citrea-primitives/testing"]

[patch.crates-io]
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
Expand Down
4 changes: 2 additions & 2 deletions guests/risc0/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ fn get_guest_options() -> HashMap<&'static str, risc0_build::GuestOptions> {

let mut features = Vec::new();

if std::env::var("CARGO_FEATURE_SHORT_PREFIX").is_ok() {
features.push("short-prefix".to_string());
if std::env::var("CARGO_FEATURE_TESTING").is_ok() {
features.push("testing".to_string());
}

let use_docker = if std::env::var("REPR_GUEST_BUILD").is_ok() {
Expand Down
2 changes: 1 addition & 1 deletion guests/risc0/light-client-proof-bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sov-rollup-interface = { path = "../../../crates/sovereign-sdk/rollup-interface"
sov-state = { path = "../../../crates/sovereign-sdk/module-system/sov-state" }

[features]
short-prefix = ["citrea-primitives/short-prefix"]
testing = ["citrea-primitives/testing"]

[patch.crates-io]
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
Expand Down
2 changes: 1 addition & 1 deletion guests/risc0/light-client-proof-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sov-rollup-interface = { path = "../../../crates/sovereign-sdk/rollup-interface"
sov-state = { path = "../../../crates/sovereign-sdk/module-system/sov-state" }

[features]
short-prefix = ["citrea-primitives/short-prefix"]
testing = ["citrea-primitives/testing"]

[patch.crates-io]
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
Expand Down

0 comments on commit ba5b7c2

Please sign in to comment.