diff --git a/rust/cardano-blockchain-types/Cargo.toml b/rust/cardano-blockchain-types/Cargo.toml index 277aea3385..8bf663ed4d 100644 --- a/rust/cardano-blockchain-types/Cargo.toml +++ b/rust/cardano-blockchain-types/Cargo.toml @@ -18,10 +18,11 @@ crate-type = ["cdylib", "rlib"] workspace = true [dependencies] -pallas = { version = "0.33.0" } -# pallas-hardano = { version = "0.33.0" } -catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types-v0.0.5" } -cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cbork-utils-v0.0.2" } +pallas = { version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values", package = "pallas" } +# pallas-hardano = { version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values" } +catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } +cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } + ouroboros = "0.18.4" tracing = "0.1.41" diff --git a/rust/cardano-blockchain-types/src/data/devnet-genesis.vkey b/rust/cardano-blockchain-types/src/data/devnet-genesis.vkey new file mode 100644 index 0000000000..a7530de44e --- /dev/null +++ b/rust/cardano-blockchain-types/src/data/devnet-genesis.vkey @@ -0,0 +1 @@ +5b33322c3235332c3138362c3230312c3137372c31312c3131372c3133352c3138372c3136372c3138312c3138382c32322c35392c3230362c3130352c3233312c3135302c3231352c33302c37382c3231322c37362c31362c3235322c3138302c37322c3133342c3133372c3234372c3136312c36385d \ No newline at end of file diff --git a/rust/cardano-blockchain-types/src/metadata/cip36/validation.rs b/rust/cardano-blockchain-types/src/metadata/cip36/validation.rs index ea80474435..0f8cecac24 100644 --- a/rust/cardano-blockchain-types/src/metadata/cip36/validation.rs +++ b/rust/cardano-blockchain-types/src/metadata/cip36/validation.rs @@ -89,7 +89,7 @@ impl Cip36 { let valid = match self.network { Network::Mainnet => network_tag.value() == 1, - Network::Preprod | Network::Preview => network_tag.value() == 0, + Network::Preprod | Network::Preview | Network::Devnet => network_tag.value() == 0, }; // Report invalid network tag if necessary diff --git a/rust/cardano-blockchain-types/src/network.rs b/rust/cardano-blockchain-types/src/network.rs index 1a64f03acc..7312795ebf 100644 --- a/rust/cardano-blockchain-types/src/network.rs +++ b/rust/cardano-blockchain-types/src/network.rs @@ -7,7 +7,7 @@ use catalyst_types::conversion::from_saturating; use chrono::{DateTime, Utc}; use pallas::{ ledger::{addresses::Network as PallasNetwork, traverse::wellknown::GenesisValues}, - network::miniprotocols::{MAINNET_MAGIC, PREVIEW_MAGIC, PRE_PRODUCTION_MAGIC}, + network::miniprotocols::{MAINNET_MAGIC, PREVIEW_MAGIC, PRE_PRODUCTION_MAGIC, TESTNET_MAGIC}, }; use tracing::debug; @@ -45,6 +45,8 @@ pub enum Network { Preprod = 1, /// Cardano preview network. Preview = 2, + /// Cardano testnet network. + Devnet = 3 } // Mainnet Defaults. @@ -74,6 +76,15 @@ const DEFAULT_PREVIEW_MITHRIL_GENESIS_KEY: &str = include_str!("data/preview-gen const DEFAULT_PREVIEW_MITHRIL_AGGREGATOR: &str = "https://aggregator.pre-release-preview.api.mithril.network/aggregator"; +// Devnet Defaults +/// Devnet Default Public Cardano Relay. +const DEFAULT_DEVNET_RELAY: &str = "127.0.0.1:3001"; +/// Preprod network Mithril Signature genesis vkey. +const DEFAULT_DEVNET_MITHRIL_GENESIS_KEY: &str = include_str!("data/devnet-genesis.vkey"); +/// Default Mithril Aggregator to use. +const DEFAULT_DEVNET_MITHRIL_AGGREGATOR: &str = + "http://localhost:8080/aggregator"; + impl Network { /// Get the default Relay for a blockchain network. #[must_use] @@ -82,6 +93,7 @@ impl Network { Network::Mainnet => DEFAULT_MAINNET_RELAY.to_string(), Network::Preprod => DEFAULT_PREPROD_RELAY.to_string(), Network::Preview => DEFAULT_PREVIEW_RELAY.to_string(), + Network::Devnet => DEFAULT_DEVNET_RELAY.to_string(), } } @@ -92,6 +104,7 @@ impl Network { Network::Mainnet => DEFAULT_MAINNET_MITHRIL_AGGREGATOR.to_string(), Network::Preprod => DEFAULT_PREPROD_MITHRIL_AGGREGATOR.to_string(), Network::Preview => DEFAULT_PREVIEW_MITHRIL_AGGREGATOR.to_string(), + Network::Devnet => DEFAULT_DEVNET_MITHRIL_AGGREGATOR.to_string(), } } @@ -102,6 +115,7 @@ impl Network { Network::Mainnet => DEFAULT_MAINNET_MITHRIL_GENESIS_KEY.to_string(), Network::Preprod => DEFAULT_PREPROD_MITHRIL_GENESIS_KEY.to_string(), Network::Preview => DEFAULT_PREVIEW_MITHRIL_GENESIS_KEY.to_string(), + Network::Devnet => DEFAULT_DEVNET_MITHRIL_GENESIS_KEY.to_string(), } } @@ -155,6 +169,7 @@ impl Network { Network::Mainnet => GenesisValues::mainnet(), Network::Preprod => GenesisValues::preprod(), Network::Preview => GenesisValues::preview(), + Network::Devnet => GenesisValues::testnet(), } } @@ -221,6 +236,7 @@ impl From for u64 { Network::Mainnet => MAINNET_MAGIC, Network::Preprod => PRE_PRODUCTION_MAGIC, Network::Preview => PREVIEW_MAGIC, + Network::Devnet => TESTNET_MAGIC, } } } @@ -229,7 +245,7 @@ impl From for PallasNetwork { fn from(value: Network) -> Self { match value { Network::Mainnet => PallasNetwork::Mainnet, - Network::Preprod | Network::Preview => PallasNetwork::Testnet, + Network::Preprod | Network::Preview | Network::Devnet => PallasNetwork::Testnet, } } } diff --git a/rust/cardano-chain-follower/Cargo.toml b/rust/cardano-chain-follower/Cargo.toml index d12aca07ae..5d64289e50 100644 --- a/rust/cardano-chain-follower/Cargo.toml +++ b/rust/cardano-chain-follower/Cargo.toml @@ -11,17 +11,17 @@ license.workspace = true workspace = true [dependencies] -pallas = { version = "0.33.0" } -pallas-hardano = { version = "0.33.0" } -pallas-crypto = { version = "0.33.0" } +pallas = {version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values" } +pallas-hardano = {version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values" } +pallas-crypto = {version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values" } mithril-client = { version = "0.12.2", default-features = false, features = [ "full", "num-integer-backend", ] } -cardano-blockchain-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-blockchain-types-v0.0.5" } -catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types-v0.0.5" } +cardano-blockchain-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } +catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network"} thiserror = "1.0.69" @@ -65,7 +65,7 @@ test-log = { version = "0.2.16", default-features = false, features = [ "trace", ] } clap = "4.5.23" -rbac-registration = { version = "0.0.6", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "rbac-registration-v0.0.6" } +rbac-registration = { version = "0.0.6", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } minicbor = { version = "2.0.0", features = ["alloc","half"]} # Note, these features are for support of features exposed by dependencies. diff --git a/rust/cardano-chain-follower/src/turbo_downloader/mod.rs b/rust/cardano-chain-follower/src/turbo_downloader/mod.rs index 7ab5b64e4f..446bf01355 100644 --- a/rust/cardano-chain-follower/src/turbo_downloader/mod.rs +++ b/rust/cardano-chain-follower/src/turbo_downloader/mod.rs @@ -216,7 +216,7 @@ impl DlConfig { resolver.resolve(url, worker) } - /// Builds a `UReq` Agent. + /// Builds a `UReq` Agent. /// /// Because we need multiple clients to prevent all traffic being forced onto a single /// connection when HTTP2 is used, the client can NOT be supplied by the user. @@ -359,8 +359,8 @@ impl ParallelDownloadProcessorInner { .set(RANGE.as_str(), &range_header) .call() .context("GET ranged request failed")?; - // let addr = get_range_response.remote_addr(); - // debug!("Chunk {chunk} from {addr:?}"); + let addr = get_range_response.remote_addr(); + debug!("Chunk {chunk} from {addr:?}"); if get_range_response.status() != StatusCode::PARTIAL_CONTENT { bail!( "Response to range request has an unexpected status code (expected {}, found {})", diff --git a/rust/catalyst-types/Cargo.toml b/rust/catalyst-types/Cargo.toml index f89c1b6c38..1d262cff92 100644 --- a/rust/catalyst-types/Cargo.toml +++ b/rust/catalyst-types/Cargo.toml @@ -24,7 +24,7 @@ hex = "0.4.3" minicbor = { version = "0.25.1", features = ["std"] } num-traits = "0.2.19" orx-concurrent-vec = { version = "3.6.0", features = ["serde"] } -pallas-crypto = { version = "0.33.0" } +pallas-crypto = { version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values" } serde = { version = "1.0.217", features = ["derive", "rc"] } thiserror = "2.0.11" base64-url = "3.0.0" diff --git a/rust/rbac-registration/Cargo.toml b/rust/rbac-registration/Cargo.toml index 997abf66fd..2e1c69e116 100644 --- a/rust/rbac-registration/Cargo.toml +++ b/rust/rbac-registration/Cargo.toml @@ -32,8 +32,8 @@ uuid = "1.11.0" oid-registry = "0.7.1" thiserror = "2.0.11" -c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "c509-certificate-v0.0.3" } -pallas = { version = "0.33.0" } -cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cbork-utils-v0.0.2" } -cardano-blockchain-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-blockchain-types-v0.0.5" } -catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types-v0.0.5" } +c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } +pallas = { version = "0.33.0", git = "https://github.com/input-output-hk/catalyst-pallas.git", branch = "test/testnet-genesis-values" } +cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } +cardano-blockchain-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } +catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } diff --git a/rust/signed_doc/Cargo.toml b/rust/signed_doc/Cargo.toml index 25fb35586c..ac930eeeb2 100644 --- a/rust/signed_doc/Cargo.toml +++ b/rust/signed_doc/Cargo.toml @@ -11,8 +11,8 @@ license.workspace = true workspace = true [dependencies] -catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types-v0.0.5" } -cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cbork-utils-v0.0.2" } +catalyst-types = { version = "0.0.5", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network"} +cbork-utils = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", branch = "test/adds-custom-network" } anyhow = "1.0.95" serde = { version = "1.0.217", features = ["derive"] }