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
598 changes: 328 additions & 270 deletions Cargo.lock

Large diffs are not rendered by default.

30 changes: 27 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ members = [
"task_manager",
"hex_assignments",
"aws_local",
"tls_init",
]
resolver = "2"

Expand Down Expand Up @@ -62,7 +63,8 @@ sqlx = { version = "0.8", default-features = false, features = [
"chrono",
"migrate",
"macros",
"runtime-tokio-rustls",
"runtime-tokio",
"tls-rustls-aws-lc-rs",
] }
helium-crypto = { version = "0.9.3", default-features = false }
hextree = { git = "https://github.com/jaykickliter/HexTree", branch = "main", features = [
Expand All @@ -71,7 +73,8 @@ hextree = { git = "https://github.com/jaykickliter/HexTree", branch = "main", fe
reqwest = { version = "0", default-features = false, features = [
"gzip",
"json",
"rustls-tls",
"http2",
"default-tls",
] }
humantime = "2"
humantime-serde = "1"
Expand Down Expand Up @@ -126,7 +129,28 @@ helium-proto = { git = "https://github.com/helium/proto", branch = "master", fea
beacon = { git = "https://github.com/helium/proto", branch = "master" }
# Pickup versions from above
prost = "*"
tonic = { version = "*", features = ["tls-ring", "tls-native-roots"] }
tonic = { version = "*", features = ["tls-aws-lc", "tls-native-roots"] }

### TLS
# Updates to `rustls` now support multiple CryptoProvider backends. Namely
# `aws-lc-rs` (default) and `ring` (legacy).
#
# Until more crates have updated to default to `aws-lc-rs` we need to ensure
# that a single CryptoProvider backend is installed. Because of our heavy
# reliance on aws crates, we've chosen `aws-lc-rs`. Also because `rustls` has
# recently chosen that as it's default.
#
# If you're crate needs to use tls, add the following.
# // Cargo.toml
# tls-init = { path = "../tls_init" }
#
# // lib.rs
# `extern crate tls_init;`
#
# `tls_init` uses `ctor` to run a constructor when the code is loaded a single
# time. We need to `extern` the crate to prevent the linker from optimizing the
# codepath away because there are no direct calls into the workspace.


[patch.crates-io]
anchor-lang = { git = "https://github.com/madninja/anchor.git", branch = "madninja/const_pubkey" }
Expand Down
1 change: 1 addition & 0 deletions db_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ serde = { workspace = true }
http = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
tls-init = { path = "../tls_init" }

aws-config = { workspace = true }
aws-sdk-sts = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions db_store/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

use std::str::FromStr;
mod error;
mod iam_auth_pool;
Expand Down Expand Up @@ -84,3 +86,6 @@ where
Ok(std::mem::replace(&mut self.value, new_val))
}
}

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions file_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ uuid = { workspace = true }
h3o = { workspace = true }
task-manager = { path = "../task_manager" }
humantime-serde = { workspace = true }
tls-init = { path = "../tls_init" }

aws-config = { workspace = true }
aws-sdk-s3 = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions file_store/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod cli;
pub mod coverage;
pub mod entropy_report;
Expand Down Expand Up @@ -45,3 +47,6 @@ use futures::stream::BoxStream;
pub type Stream<T> = BoxStream<'static, Result<T>>;
pub type FileInfoStream = Stream<FileInfo>;
pub type BytesMutStream = Stream<BytesMut>;

#[cfg(test)]
tls_init::include_tls_tests!();
3 changes: 2 additions & 1 deletion hex_assignments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ license.workspace = true
[dependencies]
anyhow = { workspace = true }
hextree = { workspace = true }
sqlx = { version = "*", features = ["runtime-tokio-rustls"] }
sqlx = { workspace = true }
rust_decimal = { workspace = true }
rust_decimal_macros = { workspace = true }
helium-proto = { workspace = true }
async-trait = { workspace = true }
chrono = { workspace = true }
derive_builder = { workspace = true }
tls-init = { path = "../tls_init" }
5 changes: 5 additions & 0 deletions hex_assignments/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod assignment;
pub mod footfall;
pub mod landtype;
Expand Down Expand Up @@ -81,6 +83,9 @@ pub struct HexBoostData {
pub service_provider_override: ServiceProviderOverride,
}

#[cfg(test)]
tls_init::include_tls_tests!();

#[cfg(test)]
mod tests {

Expand Down
3 changes: 2 additions & 1 deletion ingest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ task-manager = { path = "../task_manager" }
rand = { workspace = true }
custom-tracing = { path = "../custom_tracing", features = ["grpc"] }
humantime-serde = { workspace = true }
tls-init = { path = "../tls_init" }

[dev-dependencies]
backon = "0"
backon = "1"
5 changes: 5 additions & 0 deletions ingest/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
extern crate tls_init;

pub mod server_iot;
pub mod server_mobile;
pub mod settings;

pub use settings::{Mode, Settings};

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions iot_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tower-http = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
triggered = { workspace = true }
tls-init = { path = "../tls_init" }

custom-tracing = { path = "../custom_tracing", features = ["grpc"] }
db-store = { path = "../db_store" }
Expand Down
5 changes: 5 additions & 0 deletions iot_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod admin;
pub mod admin_service;
pub mod client;
Expand Down Expand Up @@ -80,3 +82,6 @@ impl From<u64> for EpochInfo {
}
}
}

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions iot_packet_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ iot-config = { path = "../iot_config" }
poc-metrics = { path = "../metrics" }
solana = { path = "../solana" }
task-manager = { path = "../task_manager" }
tls-init = { path = "../tls_init" }
5 changes: 5 additions & 0 deletions iot_packet_verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
extern crate tls_init;

pub mod balances;
pub mod burner;
pub mod daemon;
pub mod pending;
pub mod settings;
pub mod verifier;

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions iot_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ price = { path = "../price" }
reward-scheduler = { path = "../reward_scheduler" }
solana = { path = "../solana" }
task-manager = { path = "../task_manager" }
tls-init = { path = "../tls_init" }
5 changes: 5 additions & 0 deletions iot_verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod entropy;
pub mod entropy_loader;
pub mod gateway_cache;
Expand Down Expand Up @@ -50,3 +52,6 @@ impl PriceInfo {
pub fn resolve_subdao_pubkey() -> SolPubkey {
solana::SubDao::Iot.key()
}

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions mobile_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ file-store = { path = "../file_store" }
poc-metrics = { path = "../metrics" }
solana = { path = "../solana" }
task-manager = { path = "../task_manager" }
tls-init = { path = "../tls_init" }

[dev-dependencies]
rand = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions mobile_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

use base64::Engine;
use chrono::{DateTime, Duration, Utc};
use helium_crypto::{Keypair, PublicKey};
Expand Down Expand Up @@ -132,3 +134,6 @@ where
.map(Arc::new)
.map_err(serde::de::Error::custom)
}

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions mobile_config_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ tokio-stream = {workspace = true}
tonic = {workspace = true}
tracing = {workspace = true}
custom-tracing = { path = "../custom_tracing" }
tls-init = { path = "../tls_init" }

5 changes: 5 additions & 0 deletions mobile_config_cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod client;
pub mod cmds;

Expand Down Expand Up @@ -108,3 +110,6 @@ impl Display for NetworkKeyRole {
}
}
}

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions mobile_packet_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ file-store = { path = "../file_store" }
mobile-config = { path = "../mobile_config" }
poc-metrics = { path = "../metrics" }
task-manager = { path = "../task_manager" }
tls-init = { path = "../tls_init" }

[dev-dependencies]
reqwest = { workspace = true }
5 changes: 5 additions & 0 deletions mobile_packet_verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

use helium_crypto::PublicKeyBinary;
use helium_proto::services::mobile_config::NetworkKeyRole;
use mobile_config::client::{
Expand Down Expand Up @@ -72,3 +74,6 @@ mod tests {
assert_eq!(2, bytes_to_dc(20_001));
}
}

#[cfg(test)]
tls_init::include_tls_tests!();
2 changes: 1 addition & 1 deletion mobile_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition.workspace = true
authors.workspace = true

[dependencies]
tls-init = { path = "../tls_init" }
async-compression = { version = "0", features = ["tokio", "gzip"] }
regex = "1"

anyhow = { workspace = true }
async-trait = { workspace = true }
base64 = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions mobile_verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod banning;
pub mod boosting_oracles;
pub mod cell_type;
Expand Down Expand Up @@ -115,3 +117,6 @@ impl PriceInfo {
pub fn resolve_subdao_pubkey() -> SolPubkey {
solana::SubDao::Mobile.key()
}

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions poc_entropy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ helium-crypto = { workspace = true }
file-store = { path = "../file_store" }
poc-metrics = { path = "../metrics" }
custom-tracing = { path = "../custom_tracing", features = ["grpc"] }
tls-init = { path = "../tls_init" }
5 changes: 5 additions & 0 deletions poc_entropy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
extern crate tls_init;

pub mod entropy_generator;
pub mod server;
pub mod settings;

pub use settings::Settings;

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions price/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ file-store = { path = "../file_store" }
poc-metrics = { path = "../metrics" }
solana = { path = "../solana" }
task-manager = { path = "../task_manager" }
tls-init = { path = "../tls_init" }

[dev-dependencies]
temp-env = "0.3.6"
5 changes: 5 additions & 0 deletions price/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod cli;
pub mod metrics;
pub mod price_generator;
Expand All @@ -7,3 +9,6 @@ pub mod settings;
pub use price_generator::PriceGenerator;
pub use price_tracker::PriceTracker;
pub use settings::Settings;

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions reward_index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ db-store = { path = "../db_store" }
file-store = { path = "../file_store" }
poc-metrics = { path = "../metrics" }
task-manager = { path = "../task_manager" }
tls-init = { path = "../tls_init" }
5 changes: 5 additions & 0 deletions reward_index/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

pub mod db;
pub mod extract;
pub mod indexer;
Expand All @@ -6,3 +8,6 @@ pub mod telemetry;

pub use indexer::Indexer;
pub use settings::Settings;

#[cfg(test)]
tls_init::include_tls_tests!();
1 change: 1 addition & 0 deletions solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ spl-token = { version = "8" }
sqlx = { workspace = true }

helium-lib = { git = "https://github.com/helium/helium-wallet-rs", branch = "master" }
tls-init = { path = "../tls_init" }
5 changes: 5 additions & 0 deletions solana/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate tls_init;

use helium_lib::{
solana_client::client_error::ClientError,
solana_sdk::{
Expand Down Expand Up @@ -105,3 +107,6 @@ where
let keypair = read_keypair(&mut s.as_bytes()).map_err(serde::de::Error::custom)?;
Ok(keypair)
}

#[cfg(test)]
tls_init::include_tls_tests!();
23 changes: 23 additions & 0 deletions tls_init/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "tls-init"
version = "0.1.0"
authors.workspace = true
license.workspace = true
edition.workspace = true

[dependencies]
rustls = { version = "0.23", default-features = true }
ctor = "0.5"
rustls-webpki = { version = "0.103", default-features = false, features = [
"aws-lc-rs",
] }

tokio-rustls = { version = "0.26", default-features = false, features = [
"aws-lc-rs",
] }
hyper-rustls = { version = "0.27", default-features = false, features = [
"http1",
"http2",
"tls12",
"aws-lc-rs",
] }
Loading
Loading