Skip to content

Commit

Permalink
Start using rollup constants under bin/rollup-constants (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyusufatik authored May 14, 2024
1 parent 2ed3840 commit 822a5b3
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "2"
members = [
# Citrea
"bin/citrea",
"bin/rollup-constants",
"crates/bitcoin-da",
"crates/evm",
"crates/sequencer",
Expand Down
2 changes: 1 addition & 1 deletion bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bitcoin-da = { path = "../../crates/bitcoin-da", features = ["native"] }
sov-mock-da = { path = "../../crates/sovereign-sdk/adapters/mock-da", features = [
"native",
] }
const-rollup-config = { path = "../../crates/sovereign-sdk/examples/const-rollup-config" }
rollup-constants = { path = "../rollup-constants" }
sov-stf-runner = { path = "../../crates/sovereign-sdk/full-node/sov-stf-runner", features = [
"native",
] }
Expand Down
2 changes: 1 addition & 1 deletion bin/citrea/src/bitcoin_rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bitcoin_da::spec::{BitcoinSpec, RollupParams};
use bitcoin_da::verifier::BitcoinVerifier;
use citrea_stf::genesis_config::StorageConfig;
use citrea_stf::runtime::Runtime;
use const_rollup_config::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
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
2 changes: 1 addition & 1 deletion bin/citrea/tests/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use citrea_evm::smart_contracts::SimpleStorageContract;
use citrea_evm::system_contracts::BitcoinLightClient;
use citrea_sequencer::{SequencerConfig, SequencerMempoolConfig};
use citrea_stf::genesis_config::GenesisPaths;
use const_rollup_config::TEST_PRIVATE_KEY;
use ethereum_types::{H256, U256};
use ethers::abi::Address;
use ethers_signers::{LocalWallet, Signer};
use reth_primitives::{BlockNumberOrTag, TxHash};
use rollup_constants::TEST_PRIVATE_KEY;
use secp256k1::rand::thread_rng;
use shared_backup_db::{PostgresConnector, SharedBackupDbConfig};
use sov_mock_da::{MockAddress, MockDaService, MockDaSpec, MockHash};
Expand Down
2 changes: 1 addition & 1 deletion bin/citrea/tests/test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::Path;
use citrea::MockDemoRollup;
use citrea_sequencer::SequencerConfig;
use citrea_stf::genesis_config::GenesisPaths;
use const_rollup_config::TEST_PRIVATE_KEY;
use rollup_constants::TEST_PRIVATE_KEY;
use sov_mock_da::{MockAddress, MockDaConfig};
use sov_modules_api::default_signature::private_key::DefaultPrivateKey;
use sov_modules_api::PrivateKey;
Expand Down
7 changes: 7 additions & 0 deletions bin/rollup-constants/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "rollup-constants"
version = { workspace = true }
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
publish = false
7 changes: 7 additions & 0 deletions bin/rollup-constants/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rollup Constants for Citrea

Bakes in ROLLUP_NAME and DA_TX_ID_LEADING_ZEROS configurations into the binary.

In future releases sequencer public key, sequencer DA public key and prover DA public key must be defined in this crate.

See Sovereign [SDK's explanation](../../crates/sovereign-sdk/examples/const-rollup-config/README.md) on why such a crate is needed.
7 changes: 7 additions & 0 deletions bin/rollup-constants/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pub const ROLLUP_NAME: &str = "citrea-devnet";

/// Leading zeros prefix for the reveal transaction id.
pub const DA_TX_ID_LEADING_ZEROS: &[u8] = [0, 0].as_slice();

pub const TEST_PRIVATE_KEY: &str =
"1212121212121212121212121212121212121212121212121212121212121212";

0 comments on commit 822a5b3

Please sign in to comment.