Skip to content

Commit

Permalink
Reorganize repo (#779)
Browse files Browse the repository at this point in the history
* Move to resources

* Move hive

* Update config paths

* Move genesis files

* Update Hive build

* Rename constants crate to primitives

* Update storage & DA db path

* Update integration tests genesis path

* Fix tests

* Fix clean-node

* Expect instead of unwrap for start_rollup

* Move genesis files

* Fix genesis paths

* Fix path of integration test files

* Fix constant import

* Create an empty resources/dbs directory
  • Loading branch information
rakanalh authored Jun 26, 2024
1 parent a4cccfd commit a0d8263
Show file tree
Hide file tree
Showing 79 changed files with 147 additions and 129 deletions.
5 changes: 2 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

# include source files
!/bin
!/configs
!/resources/configs
!/crates
!/hive
!/test-da-dbs
!/resources/hive
!Cargo.lock
!Cargo.toml
!deny.toml
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ jobs:
run: npm install
- name: Run uniswap tests
run: |
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path configs/mock/sequencer_rollup_config.toml --sequencer-config-path configs/mock/sequencer_config.toml --genesis-paths configs/mock/genesis-files &
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path resources/configs/mock/sequencer_rollup_config.toml --sequencer-config-path resources/configs/mock/sequencer_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
RUST_LOG=off ./target/debug/citrea --rollup-config-path configs/mock/rollup_config.toml --genesis-paths configs/mock/genesis-files &
RUST_LOG=off ./target/debug/citrea --rollup-config-path resources/configs/mock/rollup_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
./configs/mock-dockerized/publish_da_block.sh &
./resources/configs/mock-dockerized/publish_da_block.sh &
cd ./bin/citrea/tests/evm/uniswap
npx hardhat run --network citrea scripts/01_deploy.js
npx hardhat run --network citrea scripts/02_swap.js
Expand Down Expand Up @@ -270,11 +270,11 @@ jobs:
run: pip install -r requirements.txt
- name: Run web3.py tests
run: |
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path configs/mock/sequencer_rollup_config.toml --sequencer-config-path configs/mock/sequencer_config.toml --genesis-paths configs/mock/genesis-files &
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path resources/configs/mock/sequencer_rollup_config.toml --sequencer-config-path resources/configs/mock/sequencer_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
RUST_LOG=off ./target/debug/citrea --rollup-config-path configs/mock/rollup_config.toml --genesis-paths configs/mock/genesis-files &
RUST_LOG=off ./target/debug/citrea --rollup-config-path resources/configs/mock/rollup_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
./configs/mock-dockerized/publish_da_block.sh &
./resources/configs/mock-dockerized/publish_da_block.sh &
cd ./bin/citrea/tests/evm/web3_py
python test.py
Expand Down Expand Up @@ -305,11 +305,11 @@ jobs:
run: npm install
- name: Run ethers_js tests
run: |
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path configs/mock/sequencer_rollup_config.toml --sequencer-config-path configs/mock/sequencer_config.toml --genesis-paths configs/mock/genesis-files &
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path resources/configs/mock/sequencer_rollup_config.toml --sequencer-config-path resources/configs/mock/sequencer_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
RUST_LOG=off ./target/debug/citrea --rollup-config-path configs/mock/rollup_config.toml --genesis-paths configs/mock/genesis-files &
RUST_LOG=off ./target/debug/citrea --rollup-config-path resources/configs/mock/rollup_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
./configs/mock-dockerized/publish_da_block.sh &
./resources/configs/mock-dockerized/publish_da_block.sh &
cd ./bin/citrea/tests/evm/ethers_js
npx mocha test.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
uses: docker/[email protected]
with:
context: .
file: ./hive/Dockerfile
file: ./resources/hive/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/citrea:latest
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ fuzz/Cargo.lock
.DS_Store

demo_data/
sequencer-db/
full-node-db/
prover-db/
resources/dbs/sequencer-db/
resources/dbs/full-node-db/
resources/dbs/prover-db/
/.vscode/*

/docker/credentials/*
Expand All @@ -22,5 +22,3 @@ prover-db/
adapters/solana/libyellowstone_grpc_geyser.dylib

adapters/bitcoin/reveal_*.tx

data
10 changes: 5 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = [
# Citrea
"bin/citrea",
"bin/rollup-constants",
"crates/primitives",
"crates/bitcoin-da",
"crates/evm",
"crates/ethereum-rpc",
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ clean: ## Cleans compiled
@cargo clean

clean-node: ## Cleans local dbs needed for sequencer and nodes
sudo rm -rf data/postgres
rm -rf sequencer-db
rm -rf prover-db
rm -rf full-node-db
rm test-da-dbs/*.db
sudo rm -rf resources/dbs/postgres
rm -rf resources/dbs/sequencer-db
rm -rf resources/dbs/prover-db
rm -rf resources/dbs/full-node-db

test-legacy: ## Runs test suite with output from tests printed
@cargo test -- --nocapture -Zunstable-options --report-time
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**The first rollup that enhances the capabilities of Bitcoin blockspace with zero-knowledge technology, now [live on Devnet](https://www.blog.citrea.xyz/citrea-public-devnet-live/)! 🎉🍊🍋**

![](assets/banner.png)
![](resources/assets/banner.png)

> [!WARNING]
> Citrea is still work-in-progress as a public devnet. While it's launched as a public devnet (on top of a custom Bitcoin Signet), it has not been audited and many features are under heavy development. Citrea's proper integration with [Bitcoin](https://github.com/bitcoin/bitcoin) and [Clementine](https://github.com/chainwayxyz/clementine) is still ongoing. \
Expand Down Expand Up @@ -40,4 +40,4 @@ Citrea's vision is to build scalable infrastructure that advances Bitcoin into i
## Acknowledgments

- [Sovereign SDK](https://github.com/Sovereign-Labs/sovereign-sdk): Citrea is built on a forked version of the Sovereign SDK. We're deeply thankful to the development & support of Sovereign Labs through our journey.
- [Reth](https://github.com/paradigmxyz/reth): We use Reth crates in various components in Citrea. We're grateful for their rapid development & contribution to the Rust-Ethereum ecosystem.
- [Reth](https://github.com/paradigmxyz/reth): We use Reth crates in various components in Citrea. We're grateful for their rapid development & contribution to the Rust-Ethereum ecosystem.
2 changes: 1 addition & 1 deletion bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ resolver = "2"
# Citrea deps
bitcoin-da = { path = "../../crates/bitcoin-da", features = ["native"] }
citrea-fullnode = { path = "../../crates/fullnode" }
citrea-primitives = { path = "../../crates/primitives" }
citrea-prover = { path = "../../crates/prover" }
citrea-sequencer = { path = "../../crates/sequencer" }
citrea-stf = { path = "../../crates/citrea-stf", features = ["native"] }
ethereum-rpc = { path = "../../crates/ethereum-rpc" }
rollup-constants = { path = "../rollup-constants" }
sequencer-client = { path = "../../crates/sequencer-client" }

# Sovereign-SDK deps
Expand Down
10 changes: 5 additions & 5 deletions bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock

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

2 changes: 1 addition & 1 deletion bin/citrea/provers/risc0/guest-bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ risc0-zkvm-platform = { version = "0.21" }

anyhow = "1.0.68"
bitcoin-da = { path = "../../../../../crates/bitcoin-da", default-features = false }
citrea-primitives = { path = "../../../../../crates/primitives" }
citrea-stf = { path = "../../../../../crates/citrea-stf" }
rollup-constants = { path = "../../../../rollup-constants" }
sov-modules-api = { path = "../../../../../crates/sovereign-sdk/module-system/sov-modules-api", default-features = false }
sov-modules-stf-blueprint = { path = "../../../../../crates/sovereign-sdk/module-system/sov-modules-stf-blueprint" }
sov-risc0-adapter = { path = "../../../../../crates/sovereign-sdk/adapters/risc0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
use bitcoin_da::spec::RollupParams;
use bitcoin_da::verifier::BitcoinVerifier;

use citrea_primitives::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
use citrea_stf::runtime::Runtime;
use citrea_stf::StfVerifier;
#[cfg(feature = "bench")]
use risc0_zkvm::guest::env;
use rollup_constants::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
use sov_modules_api::default_context::ZkDefaultContext;
use sov_modules_stf_blueprint::StfBlueprint;
use sov_risc0_adapter::guest::Risc0Guest;
Expand Down
8 changes: 4 additions & 4 deletions bin/citrea/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct Args {
da_layer: SupportedDaLayer,

/// The path to the rollup config.
#[arg(long, default_value = "configs/mock/rollup_config.toml")]
#[arg(long, default_value = "resources/configs/mock/rollup_config.toml")]
rollup_config_path: String,

/// The path to the sequencer config. If set, runs the node in sequencer mode, otherwise in full node mode.
Expand Down Expand Up @@ -144,7 +144,7 @@ where
let sequencer_rollup = rollup_blueprint
.create_new_sequencer(rt_genesis_paths, rollup_config.clone(), sequencer_config)
.await
.unwrap();
.expect("Could not start sequencer");
if let Err(e) = sequencer_rollup.run().await {
error!("Error: {}", e);
}
Expand All @@ -156,7 +156,7 @@ where
prover_config,
)
.await
.unwrap();
.expect("Coult not start prover");
if let Err(e) = prover.run().await {
error!("Error: {}", e);
}
Expand All @@ -167,7 +167,7 @@ where
rollup_config,
)
.await
.unwrap();
.expect("Could not start full-node");
if let Err(e) = rollup.run().await {
error!("Error: {}", e);
}
Expand Down
2 changes: 1 addition & 1 deletion bin/citrea/src/rollup/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use async_trait::async_trait;
use bitcoin_da::service::{BitcoinService, DaServiceConfig};
use bitcoin_da::spec::{BitcoinSpec, RollupParams};
use bitcoin_da::verifier::BitcoinVerifier;
use citrea_primitives::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
use citrea_risc0_bonsai_adapter::host::Risc0BonsaiHost;
use citrea_risc0_bonsai_adapter::Digest;
use citrea_stf::genesis_config::StorageConfig;
use citrea_stf::runtime::Runtime;
use rollup_constants::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
use sov_db::ledger_db::LedgerDB;
use sov_modules_api::default_context::{DefaultContext, ZkDefaultContext};
use sov_modules_api::{Address, Spec};
Expand Down
1 change: 1 addition & 0 deletions bin/citrea/tests/all_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ mod test_helpers;
const DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT: u64 = 1000;
const DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT: usize = 10;
const DEFAULT_PROOF_WAIT_DURATION: u64 = 300; // 5 minutes
const TEST_DATA_GENESIS_PATH: &str = "../../resources/test-data/integration-tests";
Loading

0 comments on commit a0d8263

Please sign in to comment.