Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
465ecf6
update bs58
michaeldjeffrey Apr 30, 2025
855317a
anchor-client and helium-anchor-gen to solana workspace
michaeldjeffrey Apr 30, 2025
94944db
solana-client to solana workspace
michaeldjeffrey Apr 30, 2025
45c82af
solana-sdk to solana workspace
michaeldjeffrey Apr 30, 2025
13442d8
solana-program to solana workspace
michaeldjeffrey Apr 30, 2025
e177e87
spl-token to solana workspace
michaeldjeffrey Apr 30, 2025
2856a64
helium-lib to solana workspace
michaeldjeffrey Apr 30, 2025
4698b2b
Left with aws dep issues
michaeldjeffrey May 2, 2025
672ad29
finally resolved deps
michaeldjeffrey May 2, 2025
d646658
upgrading sqlx
michaeldjeffrey May 2, 2025
e95e194
fixup iot-packet-verifier for db connection types
michaeldjeffrey May 2, 2025
e6cb456
fixup iot-verifier for db connection types
michaeldjeffrey May 2, 2025
cf709d4
fixup mobile-config for db connection types
michaeldjeffrey May 2, 2025
a9fee6b
fixup reward-index for db connection types
michaeldjeffrey May 2, 2025
4cf208a
fixup mobile-packet-verifier for db connection types
michaeldjeffrey May 2, 2025
edf2ffa
fixup moile-verifier for db connection types
michaeldjeffrey May 2, 2025
12c1c61
fixup boost-manager for db connection types
michaeldjeffrey May 2, 2025
c8e2f5e
remove unused import
michaeldjeffrey May 2, 2025
67558d3
deref which would be done by auto-deref
michaeldjeffrey May 2, 2025
8d30a05
back to known backon
michaeldjeffrey May 2, 2025
eaf2ce2
fixup iot-config for db connection types
michaeldjeffrey May 2, 2025
4b19a48
back to known metrics
michaeldjeffrey May 2, 2025
c451fc2
remove all patches but anchor-lang
michaeldjeffrey May 5, 2025
de4a24f
order imports for boost-manager
michaeldjeffrey May 5, 2025
0bcf8af
Export SolPubkey as top level
michaeldjeffrey May 5, 2025
39e1375
Export RpcClient as top level for price
michaeldjeffrey May 5, 2025
f37da51
Remove solana from iot-config
michaeldjeffrey May 5, 2025
bc098d6
reorder cargo for iot-packet-verifier
michaeldjeffrey May 5, 2025
96e487b
Cleanup imports for iot-verifier
michaeldjeffrey May 5, 2025
2176bbe
update to SolPubkeyin mobile-config
michaeldjeffrey May 5, 2025
aaa5e4c
Update to top level exports for mobile-verifier
michaeldjeffrey May 5, 2025
607085b
export SubDao as top level
michaeldjeffrey May 5, 2025
a914f10
merge imports for helium-lib
michaeldjeffrey May 5, 2025
607adfb
format cargo.toml files
michaeldjeffrey May 5, 2025
567914a
use published xorf-generator
michaeldjeffrey May 5, 2025
ce5d091
back to main branch for helium-lib and xorf-generator
michaeldjeffrey May 6, 2025
739b15c
update sqlx to 0.8
jeffgrunewald May 14, 2025
3fbf7f6
disable default sqlx features
jeffgrunewald May 14, 2025
28cbc12
roll back majority of branch deps from helium-crypto
jeffgrunewald May 16, 2025
483b1bc
restore helium-lib to main branch
jeffgrunewald May 16, 2025
09afbc1
Merge pull request #999 from helium/jg/helium-lib-update-plus
jeffgrunewald May 16, 2025
b3b88a6
clippy remove unused lifetimes for sqlx@0.8 update
michaeldjeffrey May 21, 2025
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
8,375 changes: 5,065 additions & 3,310 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 5 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ license = "Apache-2.0"
edition = "2021"

[workspace.dependencies]
anchor-client = { version = "0.29.0", features = ["async"] }
anyhow = { version = "1", features = ["backtrace"] }
bs58 = { version = "0.4", features = ["check"] }
bs58 = { version = "0.5.1", features = ["check"] }
thiserror = "1"
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
Expand All @@ -55,29 +54,23 @@ tokio = { version = "1", default-features = false, features = [
"time",
] }
tokio-stream = "0"
sqlx = { version = "0", features = [
sqlx = { version = "0.8", default-features = false, features = [
"postgres",
"uuid",
"decimal",
"rust_decimal",
"chrono",
"migrate",
"macros",
"runtime-tokio-rustls",
] }
helium-anchor-gen = { git = "https://github.com/helium/helium-anchor-gen.git" }
helium-crypto = { version = "0.8.4", features = ["multisig"] }
helium-lib = { git = "https://github.com/helium/helium-wallet-rs.git", branch = "master" }
helium-crypto = { version = "0.9.2", features = ["multisig", "sqlx-postgres"] }
hextree = { git = "https://github.com/jaykickliter/HexTree", branch = "main", features = [
"disktree",
] }
helium-proto = { git = "https://github.com/helium/proto", branch = "master", features = [
"services",
] }
beacon = { git = "https://github.com/helium/proto", branch = "master" }
solana-client = "1.18"
solana-sdk = "1.18"
solana-program = "1.18"
spl-token = "3.5.0"
reqwest = { version = "0", default-features = false, features = [
"gzip",
"json",
Expand Down Expand Up @@ -122,9 +115,7 @@ tower-http = { version = "0", features = ["trace"] }
derive_builder = "0"

[patch.crates-io]
# v0.7.0-alpha.3
# https://github.com/launchbadge/sqlx/commit/42dd78fe931df651eac411316ed3eab87c2f79b2
sqlx = { git = "https://github.com/launchbadge/sqlx.git", rev = "42dd78fe931df651eac411316ed3eab87c2f79b2" }
anchor-lang = { git = "https://github.com/madninja/anchor.git", branch = "madninja/const_pubkey" }

# When attempting to test proto changes without needing to push a branch you can
# patch the github url to point to your local proto repo.
Expand Down
19 changes: 10 additions & 9 deletions boost_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ license.workspace = true


[dependencies]
anyhow = { workspace = true }
axum = { version = "0", features = ["tracing"] }

anyhow = { workspace = true }
bs58 = { workspace = true }
config = { workspace = true }
clap = { workspace = true }
Expand All @@ -25,10 +26,6 @@ futures = { workspace = true }
futures-util = { workspace = true }
prost = { workspace = true }
once_cell = { workspace = true }
mobile-config = { path = "../mobile_config" }
file-store = { path = "../file_store" }
db-store = { path = "../db_store" }
poc-metrics = { path = "../metrics" }
tokio = { workspace = true }
tokio-util = { workspace = true }
tracing = { workspace = true }
Expand All @@ -42,11 +39,15 @@ rust_decimal_macros = { workspace = true }
tonic = { workspace = true }
rand = { workspace = true }
async-trait = { workspace = true }
task-manager = { path = "../task_manager" }
http = { workspace = true }
http-serde = { workspace = true }
solana = { path = "../solana" }
solana-sdk = { workspace = true }
humantime-serde = { workspace = true }
custom-tracing = { path = "../custom_tracing" }
hextree = { workspace = true }

custom-tracing = { path = "../custom_tracing" }
db-store = { path = "../db_store" }
file-store = { path = "../file_store" }
mobile-config = { path = "../mobile_config" }
poc-metrics = { path = "../metrics" }
solana = { path = "../solana" }
task-manager = { path = "../task_manager" }
2 changes: 1 addition & 1 deletion boost_manager/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub async fn insert_activated_hex(
.bind(boosted_hex_pubkey)
.bind(boost_config_pubkey)
.bind(OnChainStatus::Queued)
.execute(txn)
.execute(&mut **txn)
.await?;

Ok(())
Expand Down
14 changes: 7 additions & 7 deletions boost_manager/tests/integrations/activator_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use boost_manager::{activator, db, OnChainStatus};
use chrono::{DateTime, Duration as ChronoDuration, Duration, Timelike, Utc};
use mobile_config::boosted_hex_info::{BoostedHexInfo, BoostedHexes};
use solana_sdk::pubkey::Pubkey;
use solana::SolPubkey;
use sqlx::PgPool;
use std::{collections::HashMap, num::NonZeroU32, str::FromStr};

Expand Down Expand Up @@ -47,8 +47,8 @@ impl TestContext {
end_ts: Some(end_ts_1),
period_length: boost_period_length,
multipliers: multipliers1,
boosted_hex_pubkey: Pubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: Pubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
boosted_hex_pubkey: SolPubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: SolPubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
version: 0,
},
BoostedHexInfo {
Expand All @@ -57,8 +57,8 @@ impl TestContext {
end_ts: Some(end_ts_2),
period_length: boost_period_length,
multipliers: multipliers2,
boosted_hex_pubkey: Pubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: Pubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
boosted_hex_pubkey: SolPubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: SolPubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
version: 0,
},
BoostedHexInfo {
Expand All @@ -68,8 +68,8 @@ impl TestContext {
end_ts: None,
period_length: boost_period_length,
multipliers: multipliers3,
boosted_hex_pubkey: Pubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: Pubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
boosted_hex_pubkey: SolPubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: SolPubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
version: 0,
},
];
Expand Down
2 changes: 1 addition & 1 deletion boost_manager/tests/integrations/purger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub async fn insert_data(
.bind(BOOST_CONFIG_PUBKEY)
.bind(status)
.bind(last_updated_at)
.execute(txn)
.execute(&mut **txn)
.await?;
Ok(())
}
3 changes: 1 addition & 2 deletions boost_manager/tests/integrations/updater_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use async_trait::async_trait;
use boost_manager::{db, updater::Updater, OnChainStatus};
use chrono::{DateTime, Utc};
use file_store::hex_boost::BoostedHexActivation;
use solana::{start_boost::SolanaNetwork, GetSignature, SolanaRpcError};
use solana_sdk::signature::Signature;
use solana::{start_boost::SolanaNetwork, GetSignature, Signature, SolanaRpcError};
use sqlx::{PgPool, Postgres, Transaction};
use std::{string::ToString, sync::Mutex, time::Duration};

Expand Down
18 changes: 9 additions & 9 deletions boost_manager/tests/integrations/watcher_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use boost_manager::watcher::{self, Watcher};
use chrono::{Duration as ChronoDuration, Duration, Utc};
use helium_proto::BoostedHexInfoV1 as BoostedHexInfoProto;
use mobile_config::boosted_hex_info::BoostedHexInfo;
use solana_sdk::pubkey::Pubkey;
use solana::SolPubkey;
use sqlx::PgPool;
use std::{num::NonZeroU32, str::FromStr};

Expand Down Expand Up @@ -42,8 +42,8 @@ async fn test_boosted_hex_updates_to_filestore(pool: PgPool) -> anyhow::Result<(
end_ts: Some(end_ts_1),
period_length: boost_period_length,
multipliers: multipliers1,
boosted_hex_pubkey: Pubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: Pubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
boosted_hex_pubkey: SolPubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: SolPubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
version: 0,
},
BoostedHexInfo {
Expand All @@ -52,8 +52,8 @@ async fn test_boosted_hex_updates_to_filestore(pool: PgPool) -> anyhow::Result<(
end_ts: Some(end_ts_2),
period_length: boost_period_length,
multipliers: multipliers2,
boosted_hex_pubkey: Pubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: Pubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
boosted_hex_pubkey: SolPubkey::from_str(BOOST_HEX_PUBKEY).unwrap(),
boost_config_pubkey: SolPubkey::from_str(BOOST_CONFIG_PUBKEY).unwrap(),
version: 0,
},
];
Expand All @@ -74,13 +74,13 @@ async fn test_boosted_hex_updates_to_filestore(pool: PgPool) -> anyhow::Result<(

if let Ok(boosted_hexes) = boosted_hexes_result {
let res_boosted_hex_pubkey1 =
Pubkey::try_from(boosted_hexes[0].boosted_hex_pubkey.as_slice())?.to_string();
SolPubkey::try_from(boosted_hexes[0].boosted_hex_pubkey.as_slice())?.to_string();
let res_boost_config_pubkey1 =
Pubkey::try_from(boosted_hexes[0].boost_config_pubkey.as_slice())?.to_string();
SolPubkey::try_from(boosted_hexes[0].boost_config_pubkey.as_slice())?.to_string();
let res_boosted_hex_pubkey2 =
Pubkey::try_from(boosted_hexes[1].boosted_hex_pubkey.as_slice())?.to_string();
SolPubkey::try_from(boosted_hexes[1].boosted_hex_pubkey.as_slice())?.to_string();
let res_boost_config_pubkey2 =
Pubkey::try_from(boosted_hexes[1].boost_config_pubkey.as_slice())?.to_string();
SolPubkey::try_from(boosted_hexes[1].boost_config_pubkey.as_slice())?.to_string();

// assert the boosted hexes outputted to filestore
assert_eq!(2, boosted_hexes.len());
Expand Down
21 changes: 10 additions & 11 deletions db_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ authors.workspace = true
license.workspace = true

[dependencies]
metrics = {workspace = true }
metrics = { workspace = true }
poc-metrics = { path = "../metrics" }
thiserror = {workspace = true}
sqlx = {workspace = true}
serde = {workspace = true}
http = {workspace = true}
tokio = {workspace = true}
tracing = {workspace = true}
thiserror = { workspace = true }
sqlx = { workspace = true }
serde = { workspace = true }
http = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }

aws-config = "0"
aws-sdk-sts = "0"
aws-credential-types = "0"
aws-smithy-http = "0"
aws-types = "0"
aws-sig-auth = "0"

aws-smithy-http = "0.54.4"
aws-types = "0.54.1"
aws-sig-auth = "0.54.1"
3 changes: 2 additions & 1 deletion denylist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ serde = { workspace = true }
serde_json = { workspace = true }
config = { workspace = true }
chrono = { workspace = true }
xorf-generator = { git = "https://github.com/helium/xorf-generator", branch = "main" }
humantime-serde = { workspace = true }

xorf-generator = { git = "https://github.com/helium/xorf-generator", branch = "main" }
2 changes: 1 addition & 1 deletion file_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ tempfile = "3"
[features]
default = ["sqlx-postgres"]
local = ["aws-types"]
sqlx-postgres = ["sqlx"]
sqlx-postgres = ["sqlx/postgres"]
10 changes: 5 additions & 5 deletions file_store/src/file_info_poller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait FileInfoPollerParser<T>: Send + Sync + 'static {

#[async_trait::async_trait]
pub trait FileInfoPollerStateRecorder {
async fn record(self, process_name: &str, file_info: &FileInfo) -> Result;
async fn record(&mut self, process_name: &str, file_info: &FileInfo) -> Result;
}

#[async_trait::async_trait]
Expand Down Expand Up @@ -80,7 +80,7 @@ where

pub async fn into_stream(
self,
recorder: impl FileInfoPollerStateRecorder,
recorder: &mut impl FileInfoPollerStateRecorder,
) -> Result<BoxStream<'static, T>>
where
T: 'static,
Expand Down Expand Up @@ -433,8 +433,8 @@ use sqlx::postgres::PgQueryResult;

#[cfg(feature = "sqlx-postgres")]
#[async_trait::async_trait]
impl FileInfoPollerStateRecorder for &mut sqlx::Transaction<'_, sqlx::Postgres> {
async fn record(self, process_name: &str, file_info: &FileInfo) -> Result {
impl FileInfoPollerStateRecorder for sqlx::Transaction<'_, sqlx::Postgres> {
async fn record(&mut self, process_name: &str, file_info: &FileInfo) -> Result {
sqlx::query(
r#"
INSERT INTO files_processed(process_name, file_name, file_type, file_timestamp, processed_at) VALUES($1, $2, $3, $4, $5)
Expand All @@ -444,7 +444,7 @@ impl FileInfoPollerStateRecorder for &mut sqlx::Transaction<'_, sqlx::Postgres>
.bind(&file_info.prefix)
.bind(file_info.timestamp)
.bind(Utc::now())
.execute(self)
.execute(&mut **self)
.await
.map(|_| ())
.map_err(Error::from)
Expand Down
3 changes: 2 additions & 1 deletion file_store/src/file_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ impl FileSinkBuilder {
metric: self.metric,
};

metrics::counter!(client.metric.clone(), vec![OK_LABEL]);
// Seed a value for the metric
metrics::counter!(client.metric.clone(), vec![OK_LABEL]).increment(1);

let mut sink = FileSink {
target_path: self.target_path,
Expand Down
16 changes: 8 additions & 8 deletions iot_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@ bs58 = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
config = { workspace = true }
db-store = { path = "../db_store" }
rust_decimal = { workspace = true, features = ["maths"] }
rust_decimal_macros = { workspace = true }
file-store = { path = "../file_store" }
futures = { workspace = true }
futures-util = { workspace = true }
helium-crypto = { workspace = true, features = ["sqlx-postgres"] }
helium-lib = { workspace = true }
helium-proto = { workspace = true }
hextree = { workspace = true }
http = { workspace = true }
http-serde = { workspace = true }
humantime-serde = { workspace = true }
libflate = "1"
metrics = { workspace = true }
metrics-exporter-prometheus = { workspace = true }
poc-metrics = { path = "../metrics" }
prost = { workspace = true }
retainer = { workspace = true }
rust_decimal = { workspace = true, features = ["maths"] }
rust_decimal_macros = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
sqlx = { workspace = true }
Expand All @@ -44,9 +41,12 @@ tower-http = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
triggered = { workspace = true }
task-manager = { path = "../task_manager" }
humantime-serde = { workspace = true }

custom-tracing = { path = "../custom_tracing", features = ["grpc"] }
db-store = { path = "../db_store" }
file-store = { path = "../file_store" }
poc-metrics = { path = "../metrics" }
task-manager = { path = "../task_manager" }

[dev-dependencies]
rand = { workspace = true }
Expand Down
13 changes: 5 additions & 8 deletions iot_config/src/db_cleaner.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use chrono::{DateTime, Utc};
use futures::TryFutureExt;
use sqlx::{Pool, Postgres, Transaction};
use sqlx::{PgConnection, Pool, Postgres, Transaction};
use std::time::Duration;
use task_manager::ManagedTask;

Expand Down Expand Up @@ -67,7 +67,7 @@ async fn delete_routes(
"#,
)
.bind(timestamp)
.execute(tx)
.execute(&mut **tx)
.await?;

Ok(())
Expand All @@ -84,7 +84,7 @@ async fn delete_euis(
"#,
)
.bind(timestamp)
.execute(tx)
.execute(&mut **tx)
.await?;

Ok(())
Expand All @@ -101,16 +101,13 @@ async fn delete_devaddr_ranges(
"#,
)
.bind(timestamp)
.execute(tx)
.execute(&mut **tx)
.await?;

Ok(())
}

async fn delete_skfs(
tx: &mut Transaction<'_, Postgres>,
timestamp: DateTime<Utc>,
) -> anyhow::Result<()> {
async fn delete_skfs(tx: &mut PgConnection, timestamp: DateTime<Utc>) -> anyhow::Result<()> {
sqlx::query(
r#"
delete from route_session_key_filters
Expand Down
Loading
Loading