Skip to content

Commit

Permalink
General repository cleanup (#1384)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Proskuryakoff <[email protected]>
  • Loading branch information
yaziciahmet and kpp authored Oct 29, 2024
1 parent 1ccd065 commit 9bf432d
Show file tree
Hide file tree
Showing 202 changed files with 11 additions and 12,768 deletions.
268 changes: 1 addition & 267 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ members = [
"crates/sovereign-sdk/adapters/risc0",
"crates/sovereign-sdk/adapters/mock-da",
"crates/sovereign-sdk/adapters/mock-zkvm",
# Examples
"crates/sovereign-sdk/examples/const-rollup-config",
"crates/sovereign-sdk/examples/demo-simple-stf",
"crates/sovereign-sdk/examples/demo-stf",
# Full Node
"crates/sovereign-sdk/full-node/db/sov-db",
"crates/sovereign-sdk/full-node/sov-ledger-rpc",
Expand All @@ -35,25 +31,15 @@ members = [
# Utils
"crates/sovereign-sdk/utils/zk-cycle-macros",
"crates/sovereign-sdk/utils/zk-cycle-utils",
"crates/sovereign-sdk/utils/bashtestmd",
# Module System
"crates/sovereign-sdk/module-system/sov-cli",
"crates/sovereign-sdk/module-system/sov-modules-stf-blueprint",
"crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint",
"crates/sovereign-sdk/module-system/sov-modules-macros",
"crates/sovereign-sdk/module-system/sov-modules-core",
"crates/sovereign-sdk/module-system/sov-state",
"crates/sovereign-sdk/module-system/sov-modules-api",
"crates/sovereign-sdk/module-system/module-schemas",
"crates/sovereign-sdk/module-system/utils/sov-data-generators",
"crates/sovereign-sdk/module-system/module-implementations/sov-accounts",
"crates/sovereign-sdk/module-system/module-implementations/sov-bank",
"crates/sovereign-sdk/module-system/module-implementations/sov-prover-incentives",
"crates/sovereign-sdk/module-system/module-implementations/sov-sequencer-registry",
"crates/sovereign-sdk/module-system/module-implementations/module-template",
"crates/sovereign-sdk/module-system/module-implementations/examples/sov-value-setter",
"crates/sovereign-sdk/module-system/module-implementations/examples/sov-vec-setter",
"crates/sovereign-sdk/module-system/module-implementations/examples/sov-accessory-state",
"crates/sovereign-sdk/module-system/module-implementations/integration-tests",
]

Expand Down Expand Up @@ -169,17 +155,6 @@ tower-http = { version = "0.5.0", features = ["full"] }
tower = { version = "0.4.13", features = ["full"] }
hyper = { version = "1.4.0" }

[patch.'https://github.com/eigerco/celestia-node-rs.git']
# Uncomment to apply local changes
# celestia-proto = { path = "../celestia-node-rs/proto" }
# celestia-rpc = { path = "../celestia-node-rs/rpc" }
# celestia-types = { path = "../celestia-node-rs/types" }

[patch.'https://github.com/eigerco/celestia-tendermint-rs.git']
# Uncomment to apply local changes
# tendermint = { path = "../celestia-tendermint-rs/tendermint" }
# tendermint-proto = { path = "../celestia-tendermint-rs/proto" }

# putting risc0 patches here as well
#  surprisignly decreased cycle counts
[patch.crates-io]
Expand Down
19 changes: 0 additions & 19 deletions bin/citrea/provers/risc0/batch-prover-bitcoin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions bin/citrea/provers/risc0/batch-prover-bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,3 @@ debug = 0
lto = true
opt-level = 3
codegen-units = 1

[features]
bench = [
"sov-modules-api/bench",
"sov-state/bench",
"sov-modules-stf-blueprint/bench",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,17 @@ use bitcoin_da::verifier::BitcoinVerifier;
use citrea_primitives::{REVEAL_BATCH_PROOF_PREFIX, REVEAL_LIGHT_CLIENT_PREFIX};
use citrea_stf::runtime::Runtime;
use citrea_stf::StfVerifier;
#[cfg(feature = "bench")]
use risc0_zkvm::guest::env;
use sov_modules_api::default_context::ZkDefaultContext;
use sov_modules_stf_blueprint::StfBlueprint;
use sov_risc0_adapter::guest::Risc0Guest;
use sov_rollup_interface::da::DaVerifier;
use sov_state::ZkStorage;

#[cfg(feature = "bench")]
fn report_bench_metrics(start_cycles: u64, end_cycles: u64) {
let cycles_per_block = end_cycles - start_cycles;
let tuple = ("Cycles per block".to_string(), cycles_per_block);
let mut serialized = Vec::new();
serialized.extend(tuple.0.as_bytes());
serialized.push(0);
let size_bytes = tuple.1.to_ne_bytes();
serialized.extend(&size_bytes);

// calculate the syscall name.
let name = c"cycle_metrics";
let metrics_syscall_name = risc0_zkvm_platform::syscall::SyscallName::from_c_str(name).unwrap();

risc0_zkvm::guest::env::send_recv_slice::<u8, u8>(metrics_syscall_name, &serialized);
}

risc0_zkvm::guest::entry!(main);

pub fn main() {
let guest = Risc0Guest::new();
let storage = ZkStorage::new();
#[cfg(feature = "bench")]
let start_cycles = env::cycle_count();

let stf: StfBlueprint<ZkDefaultContext, _, _, Runtime<_, _>> = StfBlueprint::new();

Expand All @@ -50,10 +29,4 @@ pub fn main() {
stf_verifier
.run_sequencer_commitments_in_da_slot(guest, storage)
.expect("Prover must be honest");

#[cfg(feature = "bench")]
{
let end_cycles = env::cycle_count();
report_bench_metrics(start_cycles, end_cycles);
}
}
19 changes: 0 additions & 19 deletions bin/citrea/provers/risc0/batch-prover-mock/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions bin/citrea/provers/risc0/batch-prover-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,3 @@ debug = 0
lto = true
opt-level = 3
codegen-units = 1

[features]
bench = [
"sov-modules-api/bench",
"sov-state/bench",
"sov-modules-stf-blueprint/bench",
]
Original file line number Diff line number Diff line change
@@ -1,38 +1,17 @@
#![no_main]
use citrea_stf::runtime::Runtime;
use citrea_stf::StfVerifier;
#[cfg(feature = "bench")]
use risc0_zkvm::guest::env;
use sov_mock_da::MockDaVerifier;
use sov_modules_api::default_context::ZkDefaultContext;
use sov_modules_stf_blueprint::StfBlueprint;
use sov_risc0_adapter::guest::Risc0Guest;
use sov_state::ZkStorage;

#[cfg(feature = "bench")]
fn report_bench_metrics(start_cycles: u64, end_cycles: u64) {
let cycles_per_block = end_cycles - start_cycles;
let tuple = ("Cycles per block".to_string(), cycles_per_block);
let mut serialized = Vec::new();
serialized.extend(tuple.0.as_bytes());
serialized.push(0);
let size_bytes = tuple.1.to_ne_bytes();
serialized.extend(&size_bytes);

// calculate the syscall name.
let name = c"cycle_metrics";
let metrics_syscall_name = risc0_zkvm_platform::syscall::SyscallName::from_c_str(name).unwrap();

risc0_zkvm::guest::env::send_recv_slice::<u8, u8>(metrics_syscall_name, &serialized);
}

risc0_zkvm::guest::entry!(main);

pub fn main() {
let guest = Risc0Guest::new();
let storage = ZkStorage::new();
#[cfg(feature = "bench")]
let start_cycles = env::cycle_count();

let stf: StfBlueprint<ZkDefaultContext, _, _, Runtime<_, _>> = StfBlueprint::new();

Expand All @@ -41,10 +20,4 @@ pub fn main() {
stf_verifier
.run_sequencer_commitments_in_da_slot(guest, storage)
.expect("Prover must be honest");

#[cfg(feature = "bench")]
{
let end_cycles = env::cycle_count();
report_bench_metrics(start_cycles, end_cycles);
}
}
5 changes: 1 addition & 4 deletions bin/citrea/provers/risc0/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ fn main() {

fn get_guest_options() -> HashMap<&'static str, risc0_build::GuestOptions> {
let mut guest_pkg_to_options = HashMap::new();
let mut features = vec![];
let features = vec![];

if cfg!(feature = "bench") {
features.push("bench".to_string());
}
let use_docker = if std::env::var("REPR_GUEST_BUILD").is_ok() {
let this_package_dir = std::env!("CARGO_MANIFEST_DIR");
let root_dir = format!("{this_package_dir}/../../../../");
Expand Down
19 changes: 0 additions & 19 deletions bin/citrea/provers/risc0/light-client-prover-bitcoin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,3 @@ debug = 0
lto = true
opt-level = 3
codegen-units = 1

[features]
bench = [
"sov-modules-api/bench",
"sov-state/bench",
"sov-modules-stf-blueprint/bench",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,14 @@ use bitcoin_da::verifier::BitcoinVerifier;
use citrea_light_client_prover::circuit::run_circuit;
use citrea_light_client_prover::input::LightClientCircuitInput;
use citrea_primitives::{REVEAL_BATCH_PROOF_PREFIX, REVEAL_LIGHT_CLIENT_PREFIX};
#[cfg(feature = "bench")]
use risc0_zkvm::guest::env;
use sov_risc0_adapter::guest::Risc0Guest;
use sov_rollup_interface::da::DaVerifier;
use sov_rollup_interface::zk::ZkvmGuest;

#[cfg(feature = "bench")]
fn report_bench_metrics(start_cycles: u64, end_cycles: u64) {
let cycles_per_block = end_cycles - start_cycles;
let tuple = ("Cycles per block".to_string(), cycles_per_block);
let mut serialized = Vec::new();
serialized.extend(tuple.0.as_bytes());
serialized.push(0);
let size_bytes = tuple.1.to_ne_bytes();
serialized.extend(&size_bytes);

// calculate the syscall name.
let name = c"cycle_metrics";
let metrics_syscall_name = risc0_zkvm_platform::syscall::SyscallName::from_c_str(name).unwrap();

risc0_zkvm::guest::env::send_recv_slice::<u8, u8>(metrics_syscall_name, &serialized);
}

risc0_zkvm::guest::entry!(main);

pub fn main() {
let guest = Risc0Guest::new();
#[cfg(feature = "bench")]
let start_cycles = env::cycle_count();

let input: LightClientCircuitInput<BitcoinSpec> = guest.read_from_host();

Expand All @@ -44,10 +23,4 @@ pub fn main() {
let output = run_circuit::<BitcoinVerifier>(input, da_verifier).unwrap();

guest.commit(&output);

#[cfg(feature = "bench")]
{
let end_cycles = env::cycle_count();
report_bench_metrics(start_cycles, end_cycles);
}
}
Loading

0 comments on commit 9bf432d

Please sign in to comment.