Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,838 changes: 3,538 additions & 300 deletions Cargo.lock

Large diffs are not rendered by default.

128 changes: 75 additions & 53 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,82 +15,104 @@ opt-level = 0
overflow-checks = true
panic = "unwind"

[patch."https://github.com/input-output-hk/midnight-ledger-prototype"]
mn-ledger-storage = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", package = "midnight-storage", tag = "ledger-4.0.0" }
coin-structure = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", package = "midnight-coin-structure", tag = "ledger-4.0.0" }
onchain-runtime = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", package = "midnight-onchain-runtime", tag = "ledger-4.0.0" }
midnight-serialize = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", tag = "ledger-4.0.0" }
base-crypto = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", package = "midnight-base-crypto", tag = "ledger-4.0.0" }
transient-crypto = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", package = "midnight-transient-crypto", tag = "ledger-4.0.0" }

[dependencies]
actix-web = "4"
log = "0.4"
simplelog = "0.12"
prometheus = "0.13"
lazy_static = "1.5"
dotenvy = "0.15"
thiserror = "2"
async-trait = "0.1"
actix-governor = "0.8"
actix-rt = "2.0.0"
actix-web = "4"
alloy = { version = "0.9", features = ["full"] }
serde_json = "1"
strum = { version = "0.27", default-features = false, features = ["derive"] }
strum_macros = "0.27"
serde = { version = "1.0", features = ["derive", "alloc"] }
num_enum = { version = "0.7", default-features = false }
once_cell = "1.17"
regex = "1"
futures = "0.3"
uuid = { version = "1.11", features = ["v4"] }
apalis = { version = "0.7", features = [
"limit",
"retry",
"catch-panic",
"timeout",
] }
apalis-cron = { version = "0.7" }
apalis-redis = { version = "0.7" }
async-trait = "0.1"
backoff = { version = "0.4.0", features = ["tokio"] }
base64 = { version = "0.22" }
bech32 = "0.11.0"
bincode = { version = "1.3.3" }
bs58 = "0.5"
bytes = { version = "1.9" }
chrono = "0.4"
eyre = "0.6"
color-eyre = "0.6"
apalis = { version = "0.7", features = ["limit", "retry", "catch-panic", "timeout"] }
apalis-redis = { version = "0.7" }
apalis-cron = { version = "0.7" }
redis = { version = "0.31" }
tokio = { version = "1.43", features = ["sync", "io-util", "time"] }
rand = "0.9"
dashmap = { version = "6.1" }
dotenvy = "0.15"
ed25519-dalek = "2.1"
eyre = "0.6"
futures = "0.3"
futures-util = "0.3"
google-cloud-auth = "0.20.0"
governor = "0.8.0"
hex = { version = "0.4" }
hmac = { version = "0.12" }
http = { version = "1.3.1" }
itertools = "0.12.0" # Required by midnight
k256 = { version = "0.13" }
lazy_static = "1.5"
libsodium-sys = "0.2.7"
log = "0.4"
midnight-ledger-prototype = { git = "https://github.com/midnightntwrk/midnight-ledger-prototype", package = "midnight-ledger", tag = "ledger-4.0.0" }
midnight-node-ledger-helpers = { git = "https://github.com/midnightntwrk/midnight-node", package = "midnight-node-ledger-helpers", tag = "node-0.12.0" }
midnight-node-res = { git = "https://github.com/midnightntwrk/midnight-node", package = "midnight-node-res", tag = "node-0.12.0" }
mpl-token-metadata = { version = "5.1" }
num_enum = { version = "0.7", default-features = false }
once_cell = "1.17"
oz-keystore = { version = "0.1.4" }
p256 = { version = "0.13.2" }
parking_lot = "0.12"
tower = "0.5"
oz-keystore = { version = "0.1.4"}
hex = { version = "0.4"}
bytes = { version = "1.9" }
pem = { version = "3" }
prometheus = "0.13"
rand = "0.9"
redis = { version = "0.31" }
regex = "1"
reqwest = { version = "0.12", features = ["json"] }
base64 = { version = "0.22" }
hmac = { version = "0.12" }
secrets = { version = "1.2" }
serde = { version = "1.0", features = ["derive", "alloc"] }
serde_json = "1"
sha2 = { version = "0.10" }
dashmap = { version = "6.1" }
actix-governor = "0.8"
solana-sdk = { version = "2.2" }
simple_asn1 = { version = "0.6" }
simplelog = "0.12"
solana-client = { version = "2.2" }
solana-sdk = { version = "2.2" }
soroban-rs = "0.2.4"
spl-associated-token-account = "6.0.0"
spl-token = { version = "8" }
spl-token-2022 = { version = "8" }
mpl-token-metadata = { version = "5.1" }
stellar-strkey = "0.0.12"
strum = { version = "0.27", default-features = false, features = ["derive"] }
strum_macros = "0.27"
subtle = "2.6"
subxt = { version = "0.37.0", features = ["substrate-compat"] }
sysinfo = "0.35"
bincode = { version = "1.3" }
bs58 = "0.5"
spl-associated-token-account = "6.0.0"
itertools = "0.14.0"
thiserror = "2"
tokio = { version = "1.43", features = ["sync", "io-util", "time"] }
tokio-tungstenite = { version = "0.20", features = ["native-tls"] }
tower = "0.5"
utoipa = { version = "5.3", features = ["actix_extras"] }
uuid = { version = "1.11", features = ["v4"] }
validator = { version = "0.20", features = ["derive"] }
vaultrs = { version = "0.7.4" }
utoipa = { version = "5.3", features = ["actix_extras"] }
secrets = { version = "1.2"}
libsodium-sys = "0.2.7"
zeroize = "1.8"
subtle = "2.6"
ed25519-dalek = "2.1"
stellar-strkey = "0.0.12"
soroban-rs = "0.2.4"
p256 = { version = "0.13.2" }
google-cloud-auth = "0.20.0"
http = { version = "1.3.1" }
pem = { version = "3" }
simple_asn1 = { version = "0.6" }
k256 = { version = "0.13" }

[dev-dependencies]
cargo-llvm-cov = "0.6"
clap = { version = "4.4", features = ["derive"] }
mockall = { version = "0.13" }
mockito = "1.6.1"
proptest = "1.6.0"
rand = "0.9.0"
tempfile = "3.2"
serial_test = "3.2"
clap = { version = "4.4", features = ["derive"] }
tempfile = "3.2"
wiremock = "0.6"

[[bin]]
Expand Down
21 changes: 21 additions & 0 deletions config/networks/midnight.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"networks": [
{
"type": "midnight",
"network": "testnet",
"rpc_urls": [
"wss://rpc.testnet-02.midnight.network/"
],
"explorer_urls": [
"https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.testnet-02.midnight.network#/explorer"
],
"indexer_urls": {
"ws": "wss://indexer.testnet-02.midnight.network/api/v1/graphql/ws",
"http": "https://indexer.testnet-02.midnight.network/api/v1/graphql"
},
"prover_url": "http://localhost:6300",
"average_blocktime_ms": 6000,
"is_testnet": true
}
]
}
5 changes: 3 additions & 2 deletions src/api/routes/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ mod tests {
jobs::{JobProducer, Queue},
repositories::{
InMemoryNetworkRepository, InMemoryNotificationRepository, InMemoryRelayerRepository,
InMemorySignerRepository, InMemoryTransactionCounter, InMemoryTransactionRepository,
RelayerRepositoryStorage,
InMemorySignerRepository, InMemorySyncState, InMemoryTransactionCounter,
InMemoryTransactionRepository, RelayerRepositoryStorage,
},
};
use actix_web::{http::StatusCode, test, App};
Expand All @@ -209,6 +209,7 @@ mod tests {
notification_repository: Arc::new(InMemoryNotificationRepository::new()),
network_repository: Arc::new(InMemoryNetworkRepository::new()),
transaction_counter_store: Arc::new(InMemoryTransactionCounter::new()),
sync_state_store: Arc::new(InMemorySyncState::new()),
job_producer: Arc::new(JobProducer::new(Queue::setup().await.unwrap())),
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/bootstrap/config_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ async fn process_relayers<J: JobProducerTrait>(
.find(|s| s.id == repo_model.signer_id)
.ok_or_else(|| eyre::eyre!("Signer not found"))?;
let network_type = repo_model.network_type;
let signer_service = SignerFactory::create_signer(&network_type, signer_model)
.wrap_err("Failed to create signer service")?;
let signer_service =
SignerFactory::create_signer(&network_type, signer_model, &repo_model.network)
.wrap_err("Failed to create signer service")?;

let address = signer_service.address().await?;
repo_model.address = address.to_string();
Expand Down Expand Up @@ -353,8 +354,8 @@ mod tests {
models::{NetworkType, PlainOrEnvValue, SecretString},
repositories::{
InMemoryNetworkRepository, InMemoryNotificationRepository, InMemoryRelayerRepository,
InMemorySignerRepository, InMemoryTransactionCounter, InMemoryTransactionRepository,
RelayerRepositoryStorage,
InMemorySignerRepository, InMemorySyncState, InMemoryTransactionCounter,
InMemoryTransactionRepository, RelayerRepositoryStorage,
},
};
use serde_json::json;
Expand Down Expand Up @@ -392,6 +393,7 @@ mod tests {
notification_repository: Arc::new(InMemoryNotificationRepository::default()),
network_repository: Arc::new(InMemoryNetworkRepository::default()),
transaction_counter_store: Arc::new(InMemoryTransactionCounter::default()),
sync_state_store: Arc::new(InMemorySyncState::default()),
job_producer: Arc::new(mock_job_producer),
}
}
Expand Down Expand Up @@ -994,6 +996,7 @@ mod tests {
let network_repo = Arc::new(InMemoryNetworkRepository::default());
let transaction_repo = Arc::new(InMemoryTransactionRepository::default());
let transaction_counter = Arc::new(InMemoryTransactionCounter::default());
let sync_state_store = Arc::new(InMemorySyncState::default());

// Create a mock job producer
let mut mock_job_producer = MockJobProducerTrait::new();
Expand All @@ -1019,6 +1022,7 @@ mod tests {
network_repository: network_repo.clone(),
transaction_repository: transaction_repo.clone(),
transaction_counter_store: transaction_counter.clone(),
sync_state_store: sync_state_store.clone(),
job_producer: job_producer.clone(),
});

Expand Down
6 changes: 4 additions & 2 deletions src/bootstrap/initialize_app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::{
models::{AppState, DefaultAppState},
repositories::{
InMemoryNetworkRepository, InMemoryNotificationRepository, InMemoryRelayerRepository,
InMemorySignerRepository, InMemoryTransactionCounter, InMemoryTransactionRepository,
RelayerRepositoryStorage,
InMemorySignerRepository, InMemorySyncState, InMemoryTransactionCounter,
InMemoryTransactionRepository, RelayerRepositoryStorage,
},
};
use actix_web::web;
Expand All @@ -35,6 +35,7 @@ pub async fn initialize_app_state() -> Result<web::ThinData<DefaultAppState>> {
let notification_repository = Arc::new(InMemoryNotificationRepository::new());
let network_repository = Arc::new(InMemoryNetworkRepository::new());
let transaction_counter_store = Arc::new(InMemoryTransactionCounter::new());
let sync_state_store = Arc::new(InMemorySyncState::new());
let queue = Queue::setup().await?;
let job_producer = Arc::new(jobs::JobProducer::new(queue.clone()));

Expand All @@ -45,6 +46,7 @@ pub async fn initialize_app_state() -> Result<web::ThinData<DefaultAppState>> {
notification_repository,
network_repository,
transaction_counter_store,
sync_state_store,
job_producer,
});

Expand Down
5 changes: 3 additions & 2 deletions src/config/config_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub use notification::*;

pub mod network;
pub use network::{
EvmNetworkConfig, NetworkConfigCommon, NetworkFileConfig, NetworksFileConfig,
SolanaNetworkConfig, StellarNetworkConfig,
EvmNetworkConfig, MidnightNetworkConfig, NetworkConfigCommon, NetworkFileConfig,
NetworksFileConfig, SolanaNetworkConfig, StellarNetworkConfig,
};

#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
Expand All @@ -49,6 +49,7 @@ pub enum ConfigFileNetworkType {
Evm,
Stellar,
Solana,
Midnight,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down
Loading