From 75d880dd59e6e4c1440f43e2034ba9bdc1346a30 Mon Sep 17 00:00:00 2001 From: evalir Date: Thu, 17 Jul 2025 15:28:58 -0400 Subject: [PATCH 1/5] chore(constants): re-introduce pecorino WIP --- crates/constants/src/chains/mod.rs | 2 + crates/constants/src/chains/pecorino.rs | 109 ++++++++++++++++++++++++ crates/constants/src/lib.rs | 2 + crates/constants/src/types/tokens.rs | 1 + 4 files changed, 114 insertions(+) create mode 100644 crates/constants/src/chains/pecorino.rs diff --git a/crates/constants/src/chains/mod.rs b/crates/constants/src/chains/mod.rs index 75854d38..a6fc1a59 100644 --- a/crates/constants/src/chains/mod.rs +++ b/crates/constants/src/chains/mod.rs @@ -1,2 +1,4 @@ #[cfg(any(test, feature = "test-utils"))] pub mod test_utils; + +pub mod pecorino; \ No newline at end of file diff --git a/crates/constants/src/chains/pecorino.rs b/crates/constants/src/chains/pecorino.rs new file mode 100644 index 00000000..a8dd218c --- /dev/null +++ b/crates/constants/src/chains/pecorino.rs @@ -0,0 +1,109 @@ +//! Constants for the Pecorino testnet. + +use crate::{ + HostConstants, HostTokens, HostUsdRecord, RollupConstants, RollupTokens, SignetConstants, SignetEnvironmentConstants, SignetSystemConstants, UsdRecords +}; +use alloy::primitives::{address, Address}; +use std::borrow::Cow; + +/// Name for the host chain. +pub const HOST_NAME: &str = "Pecorino Host"; +/// Chain ID for the Pecorino testnet host chain. +pub const HOST_CHAIN_ID: u64 = 3151908; +/// Deployment height for the Pecorino testnet host chain. +pub const DEPLOY_HEIGHT: u64 = 149984; +/// `Zenith` contract address for the Pecorino testnet host chain. +pub const HOST_ZENITH: Address = address!("0xbe45611502116387211D28cE493D6Fb3d192bc4E"); +/// `Orders` contract address for the Pecorino testnet host chain. +pub const HOST_ORDERS: Address = address!("0x4E8cC181805aFC307C83298242271142b8e2f249"); +/// `Passage` contract address for the Pecorino testnet host chain. +pub const HOST_PASSAGE: Address = address!("0xd553C4CA4792Af71F4B61231409eaB321c1Dd2Ce"); +/// `Transactor` contract address for the Pecorino testnet host chain. +pub const HOST_TRANSACTOR: Address = address!("0x1af3A16857C28917Ab2C4c78Be099fF251669200"); + +/// USDC token for the Pecorino testnet host chain. +pub const HOST_USDC: Address = address!("0x885F8DB528dC8a38aA3DDad9D3F619746B4a6A81"); +/// USDT token for the Pecorino testnet host chain. +pub const HOST_USDT: Address = address!("0x7970D259D4a96764Fa9B23FF0715A35f06f52D1A"); +/// WBTC token for the Pecorino testnet host chain. +pub const HOST_WBTC: Address = address!("0x9aeDED4224f3dD31aD8A0B1FcD05E2d7829283a7"); +/// WETH token for the Pecorino testnet host chain (CURRENTLY A PLACERHOLDER). +pub const HOST_WETH: Address = Address::repeat_byte(0xff); + +/// USDC token record for the Pecorino testnet host chain. +pub const HOST_USDC_RECORD: HostUsdRecord = HostUsdRecord::new( + HOST_USDC, + Cow::Borrowed("USDC"), + 6 +); + +/// USDT token record for the Pecorino testnet host chain. +pub const HOST_USDT_RECORD: HostUsdRecord = HostUsdRecord::new( + HOST_USDT, + Cow::Borrowed("USDT"), + 6 +); + +/// Host USD records for the Pecorino testnet host chain. +pub const HOST_USD_RECORDS: UsdRecords = { + let mut records = UsdRecords::new(); + records.push(HOST_USDC_RECORD); + records.push(HOST_USDT_RECORD); + records +}; + +/// USDC token for the Pecorino testnet RU chain. +/// This is currently a placeholder. +pub const RU_WETH: Address = Address::repeat_byte(0xff); +/// WBTC token for the Pecorino testnet RU chain. +pub const RU_WBTC: Address = address!("0xE3d7066115f7d6b65F88Dff86288dB4756a7D733"); + +/// Name for the network. +pub const RU_NAME: &str = "Pecorino"; +/// Chain ID for the Pecorino testnet RU chain. +pub const RU_CHAIN_ID: u64 = 14174; +/// `Orders` contract address for the Pecorino testnet RU chain. +pub const RU_ORDERS: Address = address!("0xC2D3Dac6B115564B10329697195656459BFb2c74"); +/// `Passage` contract address for the Pecorino testnet RU chain. +/// This is currently a dummy value and will be replaced with the actual Passage contract address in the future. +pub const RU_PASSAGE: Address = address!("0xB043BdD3d91376A76078c361bb82496Fdb809aE2"); +/// Base fee recipient address for the Pecorino testnet RU chain. +pub const BASE_FEE_RECIPIENT: Address = address!("0xe0eDA3701D44511ce419344A4CeD30B52c9Ba231"); + +/// Host system tokens for Pecorino. +pub const HOST_TOKENS: HostTokens = + HostTokens::new(HOST_USD_RECORDS, HOST_WBTC, HOST_WETH); + +/// RU system tokens for Pecorino. +pub const RU_TOKENS: RollupTokens = RollupTokens::new(RU_WBTC, RU_WETH); + +/// The URL of the Transaction Cache endpoint. +pub const TX_CACHE_URL: &str = "https://transactions.pecorino.signet.sh"; + +/// Host system constants for Pecorino. +pub const HOST: HostConstants = crate::HostConstants::new( + HOST_CHAIN_ID, + DEPLOY_HEIGHT, + HOST_ZENITH, + HOST_ORDERS, + HOST_PASSAGE, + HOST_TRANSACTOR, + HOST_TOKENS, +); + +/// RU system constants for Pecorino. +pub const ROLLUP: RollupConstants = + crate::RollupConstants::new(RU_CHAIN_ID, RU_ORDERS, RU_PASSAGE, BASE_FEE_RECIPIENT, RU_TOKENS); + +/// Signet system constants for Pecorino. +pub const PECORINO_SYS: SignetSystemConstants = crate::SignetSystemConstants::new(HOST, ROLLUP); + +/// Signet environment constants for Pecorino. +pub const PECORINO_ENV: SignetEnvironmentConstants = SignetEnvironmentConstants::new( + Cow::Borrowed(HOST_NAME), + Cow::Borrowed(RU_NAME), + Cow::Borrowed(TX_CACHE_URL), +); + +/// Signet constants for Pecorino. +pub const PECORINO: SignetConstants = SignetConstants::new(PECORINO_SYS, PECORINO_ENV); \ No newline at end of file diff --git a/crates/constants/src/lib.rs b/crates/constants/src/lib.rs index eafd0e3e..4a61e5b7 100644 --- a/crates/constants/src/lib.rs +++ b/crates/constants/src/lib.rs @@ -20,6 +20,8 @@ mod chains; #[cfg(any(test, feature = "test-utils"))] pub use chains::test_utils; +pub use chains::pecorino; + mod types; pub use types::{ ConfigError, HostConstants, HostPermitted, HostTokens, HostUsdRecord, KnownChains, diff --git a/crates/constants/src/types/tokens.rs b/crates/constants/src/types/tokens.rs index 4fea97eb..514cf04e 100644 --- a/crates/constants/src/types/tokens.rs +++ b/crates/constants/src/types/tokens.rs @@ -332,6 +332,7 @@ impl UsdRecords { } } + impl serde::Serialize for UsdRecords { fn serialize(&self, serializer: S) -> Result where From 3e2c74dc2242ae4d9797f72af9b616f1a209678b Mon Sep 17 00:00:00 2001 From: evalir Date: Tue, 22 Jul 2025 10:05:44 -0400 Subject: [PATCH 2/5] chore: updated addresses --- crates/constants/src/chains/mod.rs | 2 +- crates/constants/src/chains/pecorino.rs | 71 +++++++++++-------------- crates/constants/src/types/tokens.rs | 1 - 3 files changed, 33 insertions(+), 41 deletions(-) diff --git a/crates/constants/src/chains/mod.rs b/crates/constants/src/chains/mod.rs index a6fc1a59..d73aa9a4 100644 --- a/crates/constants/src/chains/mod.rs +++ b/crates/constants/src/chains/mod.rs @@ -1,4 +1,4 @@ #[cfg(any(test, feature = "test-utils"))] pub mod test_utils; -pub mod pecorino; \ No newline at end of file +pub mod pecorino; diff --git a/crates/constants/src/chains/pecorino.rs b/crates/constants/src/chains/pecorino.rs index a8dd218c..d384eaa1 100644 --- a/crates/constants/src/chains/pecorino.rs +++ b/crates/constants/src/chains/pecorino.rs @@ -1,7 +1,8 @@ //! Constants for the Pecorino testnet. use crate::{ - HostConstants, HostTokens, HostUsdRecord, RollupConstants, RollupTokens, SignetConstants, SignetEnvironmentConstants, SignetSystemConstants, UsdRecords + HostConstants, HostTokens, HostUsdRecord, RollupConstants, RollupTokens, SignetConstants, + SignetEnvironmentConstants, SignetSystemConstants, UsdRecords, }; use alloy::primitives::{address, Address}; use std::borrow::Cow; @@ -27,22 +28,14 @@ pub const HOST_USDC: Address = address!("0x885F8DB528dC8a38aA3DDad9D3F619746B4a6 pub const HOST_USDT: Address = address!("0x7970D259D4a96764Fa9B23FF0715A35f06f52D1A"); /// WBTC token for the Pecorino testnet host chain. pub const HOST_WBTC: Address = address!("0x9aeDED4224f3dD31aD8A0B1FcD05E2d7829283a7"); -/// WETH token for the Pecorino testnet host chain (CURRENTLY A PLACERHOLDER). -pub const HOST_WETH: Address = Address::repeat_byte(0xff); +/// WETH token for the Pecorino testnet host chain. +pub const HOST_WETH: Address = address!("0x572C4d72080ed9E9997509b583a22B785B70cB3f"); /// USDC token record for the Pecorino testnet host chain. -pub const HOST_USDC_RECORD: HostUsdRecord = HostUsdRecord::new( - HOST_USDC, - Cow::Borrowed("USDC"), - 6 -); +pub const HOST_USDC_RECORD: HostUsdRecord = HostUsdRecord::new(HOST_USDC, Cow::Borrowed("USDC"), 6); /// USDT token record for the Pecorino testnet host chain. -pub const HOST_USDT_RECORD: HostUsdRecord = HostUsdRecord::new( - HOST_USDT, - Cow::Borrowed("USDT"), - 6 -); +pub const HOST_USDT_RECORD: HostUsdRecord = HostUsdRecord::new(HOST_USDT, Cow::Borrowed("USDT"), 6); /// Host USD records for the Pecorino testnet host chain. pub const HOST_USD_RECORDS: UsdRecords = { @@ -52,45 +45,42 @@ pub const HOST_USD_RECORDS: UsdRecords = { records }; -/// USDC token for the Pecorino testnet RU chain. -/// This is currently a placeholder. -pub const RU_WETH: Address = Address::repeat_byte(0xff); -/// WBTC token for the Pecorino testnet RU chain. -pub const RU_WBTC: Address = address!("0xE3d7066115f7d6b65F88Dff86288dB4756a7D733"); +/// Host system constants for Pecorino. +pub const HOST: HostConstants = crate::HostConstants::new( + HOST_CHAIN_ID, + DEPLOY_HEIGHT, + HOST_ZENITH, + HOST_ORDERS, + HOST_PASSAGE, + HOST_TRANSACTOR, + HOST_TOKENS, +); + +/// Host system tokens for Pecorino. +pub const HOST_TOKENS: HostTokens = HostTokens::new(HOST_USD_RECORDS, HOST_WBTC, HOST_WETH); /// Name for the network. pub const RU_NAME: &str = "Pecorino"; +/// WETH token for the Pecorino testnet RU chain. +pub const RU_WETH: Address = address!("0x0000000000000000007369676e65742d77657468"); +/// WBTC token for the Pecorino testnet RU chain. +pub const RU_WBTC: Address = address!("0x0000000000000000007369676e65742D77627463"); /// Chain ID for the Pecorino testnet RU chain. pub const RU_CHAIN_ID: u64 = 14174; /// `Orders` contract address for the Pecorino testnet RU chain. -pub const RU_ORDERS: Address = address!("0xC2D3Dac6B115564B10329697195656459BFb2c74"); +pub const RU_ORDERS: Address = address!("0x000000000000007369676E65742D6f7264657273"); /// `Passage` contract address for the Pecorino testnet RU chain. /// This is currently a dummy value and will be replaced with the actual Passage contract address in the future. -pub const RU_PASSAGE: Address = address!("0xB043BdD3d91376A76078c361bb82496Fdb809aE2"); +pub const RU_PASSAGE: Address = address!("0x0000000000007369676E65742D70617373616765"); +/// The WETH9-based wrapped native USD token contract. +/// This is signet's native token in wrapped form. +pub const WRAPPED: Address = address!("0x0000000000000000007369676e65742D77757364"); /// Base fee recipient address for the Pecorino testnet RU chain. pub const BASE_FEE_RECIPIENT: Address = address!("0xe0eDA3701D44511ce419344A4CeD30B52c9Ba231"); -/// Host system tokens for Pecorino. -pub const HOST_TOKENS: HostTokens = - HostTokens::new(HOST_USD_RECORDS, HOST_WBTC, HOST_WETH); - /// RU system tokens for Pecorino. pub const RU_TOKENS: RollupTokens = RollupTokens::new(RU_WBTC, RU_WETH); -/// The URL of the Transaction Cache endpoint. -pub const TX_CACHE_URL: &str = "https://transactions.pecorino.signet.sh"; - -/// Host system constants for Pecorino. -pub const HOST: HostConstants = crate::HostConstants::new( - HOST_CHAIN_ID, - DEPLOY_HEIGHT, - HOST_ZENITH, - HOST_ORDERS, - HOST_PASSAGE, - HOST_TRANSACTOR, - HOST_TOKENS, -); - /// RU system constants for Pecorino. pub const ROLLUP: RollupConstants = crate::RollupConstants::new(RU_CHAIN_ID, RU_ORDERS, RU_PASSAGE, BASE_FEE_RECIPIENT, RU_TOKENS); @@ -106,4 +96,7 @@ pub const PECORINO_ENV: SignetEnvironmentConstants = SignetEnvironmentConstants: ); /// Signet constants for Pecorino. -pub const PECORINO: SignetConstants = SignetConstants::new(PECORINO_SYS, PECORINO_ENV); \ No newline at end of file +pub const PECORINO: SignetConstants = SignetConstants::new(PECORINO_SYS, PECORINO_ENV); + +/// The URL of the Transaction Cache endpoint. +pub const TX_CACHE_URL: &str = "https://transactions.pecorino.signet.sh"; diff --git a/crates/constants/src/types/tokens.rs b/crates/constants/src/types/tokens.rs index 514cf04e..4fea97eb 100644 --- a/crates/constants/src/types/tokens.rs +++ b/crates/constants/src/types/tokens.rs @@ -332,7 +332,6 @@ impl UsdRecords { } } - impl serde::Serialize for UsdRecords { fn serialize(&self, serializer: S) -> Result where From df6439048b1ab117b7eec0825d2e331cabb8a05d Mon Sep 17 00:00:00 2001 From: evalir Date: Tue, 22 Jul 2025 10:27:28 -0400 Subject: [PATCH 3/5] chore: ordering --- crates/constants/src/chains/pecorino.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/constants/src/chains/pecorino.rs b/crates/constants/src/chains/pecorino.rs index d384eaa1..602158fc 100644 --- a/crates/constants/src/chains/pecorino.rs +++ b/crates/constants/src/chains/pecorino.rs @@ -33,10 +33,8 @@ pub const HOST_WETH: Address = address!("0x572C4d72080ed9E9997509b583a22B785B70c /// USDC token record for the Pecorino testnet host chain. pub const HOST_USDC_RECORD: HostUsdRecord = HostUsdRecord::new(HOST_USDC, Cow::Borrowed("USDC"), 6); - /// USDT token record for the Pecorino testnet host chain. pub const HOST_USDT_RECORD: HostUsdRecord = HostUsdRecord::new(HOST_USDT, Cow::Borrowed("USDT"), 6); - /// Host USD records for the Pecorino testnet host chain. pub const HOST_USD_RECORDS: UsdRecords = { let mut records = UsdRecords::new(); @@ -44,6 +42,8 @@ pub const HOST_USD_RECORDS: UsdRecords = { records.push(HOST_USDT_RECORD); records }; +/// Host system tokens for Pecorino. +pub const HOST_TOKENS: HostTokens = HostTokens::new(HOST_USD_RECORDS, HOST_WBTC, HOST_WETH); /// Host system constants for Pecorino. pub const HOST: HostConstants = crate::HostConstants::new( @@ -56,17 +56,15 @@ pub const HOST: HostConstants = crate::HostConstants::new( HOST_TOKENS, ); -/// Host system tokens for Pecorino. -pub const HOST_TOKENS: HostTokens = HostTokens::new(HOST_USD_RECORDS, HOST_WBTC, HOST_WETH); - /// Name for the network. pub const RU_NAME: &str = "Pecorino"; +/// Chain ID for the Pecorino testnet RU chain. +pub const RU_CHAIN_ID: u64 = 14174; + /// WETH token for the Pecorino testnet RU chain. pub const RU_WETH: Address = address!("0x0000000000000000007369676e65742d77657468"); /// WBTC token for the Pecorino testnet RU chain. pub const RU_WBTC: Address = address!("0x0000000000000000007369676e65742D77627463"); -/// Chain ID for the Pecorino testnet RU chain. -pub const RU_CHAIN_ID: u64 = 14174; /// `Orders` contract address for the Pecorino testnet RU chain. pub const RU_ORDERS: Address = address!("0x000000000000007369676E65742D6f7264657273"); /// `Passage` contract address for the Pecorino testnet RU chain. @@ -75,12 +73,12 @@ pub const RU_PASSAGE: Address = address!("0x0000000000007369676E65742D7061737361 /// The WETH9-based wrapped native USD token contract. /// This is signet's native token in wrapped form. pub const WRAPPED: Address = address!("0x0000000000000000007369676e65742D77757364"); +/// RU pre-approved system tokens for Pecorino. +pub const RU_TOKENS: RollupTokens = RollupTokens::new(RU_WBTC, RU_WETH); + /// Base fee recipient address for the Pecorino testnet RU chain. pub const BASE_FEE_RECIPIENT: Address = address!("0xe0eDA3701D44511ce419344A4CeD30B52c9Ba231"); -/// RU system tokens for Pecorino. -pub const RU_TOKENS: RollupTokens = RollupTokens::new(RU_WBTC, RU_WETH); - /// RU system constants for Pecorino. pub const ROLLUP: RollupConstants = crate::RollupConstants::new(RU_CHAIN_ID, RU_ORDERS, RU_PASSAGE, BASE_FEE_RECIPIENT, RU_TOKENS); From f1b16aa9ebe5e9bb34964c3cd17c86b63e76626b Mon Sep 17 00:00:00 2001 From: evalir Date: Tue, 22 Jul 2025 11:50:56 -0400 Subject: [PATCH 4/5] chore: add back shortcuts --- crates/constants/src/types/chains.rs | 3 +++ crates/constants/src/types/environment.rs | 6 ++++++ crates/constants/src/types/host.rs | 6 ++++++ crates/constants/src/types/mod.rs | 12 ++++++++++++ crates/constants/src/types/rollup.rs | 6 ++++++ crates/test-utils/src/specs/host_spec.rs | 6 ++++++ crates/test-utils/src/specs/ru_spec.rs | 6 ++++++ crates/tx-cache/Cargo.toml | 1 + crates/tx-cache/src/client.rs | 14 ++++++++++++++ 9 files changed, 60 insertions(+) diff --git a/crates/constants/src/types/chains.rs b/crates/constants/src/types/chains.rs index 92563d1c..9a4fb917 100644 --- a/crates/constants/src/types/chains.rs +++ b/crates/constants/src/types/chains.rs @@ -14,6 +14,8 @@ pub enum ParseChainError { /// Known chains for the Signet system. #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum KnownChains { + /// Pecorino chain. + Pecorino, /// Test chain. #[cfg(any(test, feature = "test-utils"))] Test, @@ -27,6 +29,7 @@ impl FromStr for KnownChains { match s.as_str() { #[cfg(any(test, feature = "test-utils"))] "test" => Ok(Self::Test), + "pecorino" => Ok(Self::Pecorino), _ => Err(ParseChainError::ChainNotSupported(s)), } } diff --git a/crates/constants/src/types/environment.rs b/crates/constants/src/types/environment.rs index 841bb7a3..9ee3a3f0 100644 --- a/crates/constants/src/types/environment.rs +++ b/crates/constants/src/types/environment.rs @@ -22,6 +22,11 @@ impl SignetEnvironmentConstants { Self { host_name, rollup_name, transaction_cache } } + /// Get the hard-coded Pecorino environment constants. + pub const fn pecorino() -> Self { + crate::chains::pecorino::PECORINO_ENV + } + /// Get the hard-coded local test rollup constants. #[cfg(any(test, feature = "test-utils"))] pub const fn test() -> Self { @@ -49,6 +54,7 @@ impl TryFrom for SignetEnvironmentConstants { fn try_from(chain: KnownChains) -> Result { match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), #[cfg(any(test, feature = "test-utils"))] KnownChains::Test => Ok(Self::test()), } diff --git a/crates/constants/src/types/host.rs b/crates/constants/src/types/host.rs index 1f0c488b..0fd0da0f 100644 --- a/crates/constants/src/types/host.rs +++ b/crates/constants/src/types/host.rs @@ -56,6 +56,11 @@ impl HostConstants { Self { chain_id, deploy_height, zenith, orders, passage, transactor, tokens } } + /// Get the hard-coded Pecorino host constants. + pub const fn pecorino() -> Self { + crate::chains::pecorino::HOST + } + /// Get the hard-coded local test host constants. #[cfg(any(test, feature = "test-utils"))] pub const fn test() -> Self { @@ -142,6 +147,7 @@ impl FromStr for HostConstants { fn from_str(s: &str) -> Result { let chain: KnownChains = s.parse()?; match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), #[cfg(any(test, feature = "test-utils"))] KnownChains::Test => Ok(Self::test()), } diff --git a/crates/constants/src/types/mod.rs b/crates/constants/src/types/mod.rs index 4b415a92..0a33711c 100644 --- a/crates/constants/src/types/mod.rs +++ b/crates/constants/src/types/mod.rs @@ -47,6 +47,11 @@ impl SignetSystemConstants { Self { host, rollup } } + /// Get the hard-coded Pecorino constants. + pub const fn pecorino() -> Self { + crate::chains::pecorino::PECORINO_SYS + } + /// Get the hard-coded local test constants. #[cfg(any(test, feature = "test-utils"))] pub const fn test() -> Self { @@ -221,6 +226,7 @@ impl TryFrom for SignetSystemConstants { fn try_from(chain: KnownChains) -> Result { match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), #[cfg(any(test, feature = "test-utils"))] KnownChains::Test => Ok(Self::test()), } @@ -253,6 +259,11 @@ impl SignetConstants { Self { system, environment } } + /// Get the hard-coded Pecorino rollup constants. + pub const fn pecorino() -> Self { + crate::chains::pecorino::PECORINO + } + /// Get the hard-coded local test rollup constants. #[cfg(any(test, feature = "test-utils"))] pub const fn test() -> Self { @@ -285,6 +296,7 @@ impl TryFrom for SignetConstants { fn try_from(chain: KnownChains) -> Result { match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), #[cfg(any(test, feature = "test-utils"))] KnownChains::Test => Ok(Self::test()), } diff --git a/crates/constants/src/types/rollup.rs b/crates/constants/src/types/rollup.rs index 8a5b7df6..da915b23 100644 --- a/crates/constants/src/types/rollup.rs +++ b/crates/constants/src/types/rollup.rs @@ -43,6 +43,11 @@ impl RollupConstants { Self { chain_id, orders, passage, base_fee_recipient, tokens } } + /// Get the hard-coded Pecorino rollup constants. + pub const fn pecorino() -> Self { + crate::chains::pecorino::ROLLUP + } + /// Get the hard-coded local test rollup constants. #[cfg(any(test, feature = "test-utils"))] pub const fn test() -> Self { @@ -107,6 +112,7 @@ impl TryFrom for RollupConstants { fn try_from(chain: KnownChains) -> Result { match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), #[cfg(any(test, feature = "test-utils"))] KnownChains::Test => Ok(Self::test()), } diff --git a/crates/test-utils/src/specs/host_spec.rs b/crates/test-utils/src/specs/host_spec.rs index f23fecb5..ea460dda 100644 --- a/crates/test-utils/src/specs/host_spec.rs +++ b/crates/test-utils/src/specs/host_spec.rs @@ -90,6 +90,11 @@ impl HostBlockSpec { } } + /// Make a new block spec with Pecorino constants. + pub const fn pecorino() -> Self { + Self::new(SignetSystemConstants::pecorino()) + } + /// Make a new block spec with test constants. pub const fn test() -> Self { Self::new(SignetSystemConstants::test()) @@ -411,6 +416,7 @@ impl TryFrom for HostBlockSpec { fn try_from(chain: KnownChains) -> Result { match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), KnownChains::Test => Ok(Self::test()), } } diff --git a/crates/test-utils/src/specs/ru_spec.rs b/crates/test-utils/src/specs/ru_spec.rs index 7fd72f51..77ebca61 100644 --- a/crates/test-utils/src/specs/ru_spec.rs +++ b/crates/test-utils/src/specs/ru_spec.rs @@ -43,6 +43,11 @@ impl RuBlockSpec { Self { constants, tx: vec![], gas_limit: None, reward_address: None } } + /// Create a new empty RU block spec with the Pecorino constants. + pub const fn pecorino() -> Self { + Self::new(SignetSystemConstants::pecorino()) + } + /// Create a new empty RU block spec with the test constants. pub const fn test() -> Self { Self::new(SignetSystemConstants::test()) @@ -146,6 +151,7 @@ impl TryFrom for RuBlockSpec { fn try_from(chain: KnownChains) -> Result { match chain { + KnownChains::Pecorino => Ok(Self::pecorino()), KnownChains::Test => Ok(Self::test()), } } diff --git a/crates/tx-cache/Cargo.toml b/crates/tx-cache/Cargo.toml index 15c47f58..2271e666 100644 --- a/crates/tx-cache/Cargo.toml +++ b/crates/tx-cache/Cargo.toml @@ -12,6 +12,7 @@ repository.workspace = true [dependencies] signet-bundle.workspace = true +signet-constants.workspace = true signet-types.workspace = true alloy.workspace = true diff --git a/crates/tx-cache/src/client.rs b/crates/tx-cache/src/client.rs index 91a7a61a..80c77bee 100644 --- a/crates/tx-cache/src/client.rs +++ b/crates/tx-cache/src/client.rs @@ -6,6 +6,7 @@ use alloy::consensus::TxEnvelope; use eyre::Error; use serde::{de::DeserializeOwned, Serialize}; use signet_bundle::SignetEthBundle; +use signet_constants::pecorino; use signet_types::SignedOrder; use tracing::{instrument, warn}; @@ -41,6 +42,19 @@ impl TxCache { Ok(Self::new(url)) } + /// Connect to the transaction cache with the Pecorino URL. + pub fn pecorino() -> Self { + Self::new_from_string(pecorino::TX_CACHE_URL).expect("pecorino tx cache URL is invalid") + } + + /// Connect to the transaction cache with the Pecorino URL and a specific [`reqwest::Client`]. + pub fn pecorino_with_client(client: reqwest::Client) -> Self { + Self::new_with_client( + pecorino::TX_CACHE_URL.parse().expect("pecorino tx cache URL is invalid"), + client, + ) + } + /// Get the client used to send requests pub const fn client(&self) -> &reqwest::Client { &self.client From 13fd686a7fe2f4abaaf2abf1ef12b6da553e7a17 Mon Sep 17 00:00:00 2001 From: evalir Date: Tue, 22 Jul 2025 12:00:31 -0400 Subject: [PATCH 5/5] chore: bump v --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 78361ebb..e298063a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "0.8.0" +version = "0.8.1" edition = "2021" rust-version = "1.81" authors = ["init4"]