diff --git a/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs b/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs index 4b32c609366..d2d19431014 100644 --- a/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs +++ b/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs @@ -8,7 +8,10 @@ use crate::{ }, }; use log::{debug, error}; -use sqlx::ConnectOptions; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + ConnectOptions, +}; use std::path::Path; #[derive(Debug, Clone)] @@ -30,6 +33,9 @@ impl StorageManager { } let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging(); @@ -110,7 +116,7 @@ impl StorageManager { ) -> Result<(), sqlx::Error> { sqlx::query!( r#" - INSERT INTO registered_gateway(gateway_id_bs58, registration_timestamp, gateway_type) + INSERT INTO registered_gateway(gateway_id_bs58, registration_timestamp, gateway_type) VALUES (?, ?, ?) "#, registered_gateway.gateway_id_bs58, @@ -224,7 +230,7 @@ impl StorageManager { ) -> Result<(), sqlx::Error> { sqlx::query!( r#" - INSERT INTO custom_gateway_details(gateway_id_bs58, data) + INSERT INTO custom_gateway_details(gateway_id_bs58, data) VALUES (?, ?) "#, custom.gateway_id_bs58, diff --git a/common/client-core/surb-storage/src/backend/fs_backend/manager.rs b/common/client-core/surb-storage/src/backend/fs_backend/manager.rs index b6adadd3d52..02316ddb7fa 100644 --- a/common/client-core/surb-storage/src/backend/fs_backend/manager.rs +++ b/common/client-core/surb-storage/src/backend/fs_backend/manager.rs @@ -9,7 +9,10 @@ use crate::backend::fs_backend::{ }, }; use log::{error, info}; -use sqlx::ConnectOptions; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + ConnectOptions, +}; use std::path::Path; #[derive(Debug, Clone)] @@ -31,6 +34,9 @@ impl StorageManager { } let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(fresh) .disable_statement_logging(); diff --git a/common/credential-storage/src/persistent_storage/mod.rs b/common/credential-storage/src/persistent_storage/mod.rs index 80e746b4826..e8c9eca5aa9 100644 --- a/common/credential-storage/src/persistent_storage/mod.rs +++ b/common/credential-storage/src/persistent_storage/mod.rs @@ -33,7 +33,10 @@ use nym_credentials::{ IssuanceTicketBook, IssuedTicketBook, }; use nym_ecash_time::{ecash_today, Date, EcashTime}; -use sqlx::ConnectOptions; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + ConnectOptions, +}; use std::path::Path; use zeroize::Zeroizing; @@ -56,6 +59,9 @@ impl PersistentStorage { ); let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging(); diff --git a/common/gateway-stats-storage/src/lib.rs b/common/gateway-stats-storage/src/lib.rs index e57f7452cd6..5bfc658a938 100644 --- a/common/gateway-stats-storage/src/lib.rs +++ b/common/gateway-stats-storage/src/lib.rs @@ -6,7 +6,10 @@ use models::StoredFinishedSession; use nym_node_metrics::entry::{ActiveSession, FinishedSession, SessionType}; use nym_sphinx::DestinationAddressBytes; use sessions::SessionManager; -use sqlx::ConnectOptions; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + ConnectOptions, +}; use std::path::Path; use time::Date; use tracing::{debug, error}; @@ -36,6 +39,9 @@ impl PersistentStatsStorage { // TODO: we can inject here more stuff based on our gateway global config // struct. Maybe different pool size or timeout intervals? let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging(); diff --git a/common/gateway-storage/src/lib.rs b/common/gateway-storage/src/lib.rs index 9d574dbe913..d95581f88af 100644 --- a/common/gateway-storage/src/lib.rs +++ b/common/gateway-storage/src/lib.rs @@ -12,7 +12,10 @@ use nym_credentials_interface::ClientTicket; use nym_gateway_requests::shared_key::SharedGatewayKey; use nym_sphinx::DestinationAddressBytes; use shared_keys::SharedKeysManager; -use sqlx::ConnectOptions; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + ConnectOptions, +}; use std::path::Path; use tickets::TicketStorageManager; use time::OffsetDateTime; @@ -86,6 +89,9 @@ impl GatewayStorage { // TODO: we can inject here more stuff based on our gateway global config // struct. Maybe different pool size or timeout intervals? let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging(); diff --git a/common/nyxd-scraper/src/storage/mod.rs b/common/nyxd-scraper/src/storage/mod.rs index 8ac0f077757..a3b0550677d 100644 --- a/common/nyxd-scraper/src/storage/mod.rs +++ b/common/nyxd-scraper/src/storage/mod.rs @@ -13,7 +13,11 @@ use crate::{ models::{CommitSignature, Validator}, }, }; -use sqlx::{types::time::OffsetDateTime, ConnectOptions, Sqlite, Transaction}; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + types::time::OffsetDateTime, + ConnectOptions, Sqlite, Transaction, +}; use std::{fmt::Debug, path::Path}; use tendermint::{ block::{Commit, CommitSig}, @@ -51,6 +55,9 @@ impl ScraperStorage { #[instrument] pub async fn init + Debug>(database_path: P) -> Result { let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging(); diff --git a/nym-api/src/support/storage/mod.rs b/nym-api/src/support/storage/mod.rs index 72ff9aea1df..dc5e4c25602 100644 --- a/nym-api/src/support/storage/mod.rs +++ b/nym-api/src/support/storage/mod.rs @@ -18,6 +18,7 @@ use crate::support::storage::models::{ use dashmap::DashMap; use nym_mixnet_contract_common::NodeId; use nym_types::monitoring::NodeResult; +use sqlx::sqlite::{SqliteAutoVacuum, SqliteSynchronous}; use sqlx::ConnectOptions; use std::path::Path; use std::sync::Arc; @@ -67,6 +68,9 @@ impl NymApiStorage { // TODO: we can inject here more stuff based on our nym-api global config // struct. Maybe different pool size or timeout intervals? let connect_opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .log_statements(LevelFilter::Trace) diff --git a/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs b/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs index 6133d1acbc1..5480f96d5b5 100644 --- a/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs +++ b/nym-credential-proxy/nym-credential-proxy/src/storage/mod.rs @@ -16,6 +16,7 @@ use nym_validator_client::ecash::BlindedSignatureResponse; use nym_validator_client::nym_api::EpochId; use nym_validator_client::nyxd::contract_traits::ecash_query_client::DepositId; use nym_validator_client::nyxd::Coin; +use sqlx::sqlite::{SqliteAutoVacuum, SqliteSynchronous}; use sqlx::ConnectOptions; use std::fmt::Debug; use std::path::Path; @@ -40,6 +41,9 @@ impl VpnApiStorage { debug!("Attempting to connect to database"); let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .log_statements(LevelFilter::Trace) diff --git a/nym-node-status-api/nym-node-status-agent/run.sh b/nym-node-status-api/nym-node-status-agent/run.sh index 680c87db8bd..f3900ec227b 100755 --- a/nym-node-status-api/nym-node-status-agent/run.sh +++ b/nym-node-status-api/nym-node-status-agent/run.sh @@ -3,7 +3,7 @@ set -eu export ENVIRONMENT=${ENVIRONMENT:-"sandbox"} -probe_git_ref="nym-vpn-core-v1.0.0-rc.14" +probe_git_ref="nym-vpn-core-v1.1.0" crate_root=$(dirname $(realpath "$0")) monorepo_root=$(realpath "${crate_root}/../..") @@ -54,7 +54,7 @@ function swarm() { echo "All agents completed" } -copy_gw_probe +# copy_gw_probe build_agent swarm $workers diff --git a/nym-node-status-api/nym-node-status-api/launch_node_status_api.sh b/nym-node-status-api/nym-node-status-api/launch_node_status_api.sh index 24b9a68ae8e..9735f873d7f 100755 --- a/nym-node-status-api/nym-node-status-api/launch_node_status_api.sh +++ b/nym-node-status-api/nym-node-status-api/launch_node_status_api.sh @@ -2,6 +2,7 @@ set -e +user_rust_log_preference=$RUST_LOG export NYM_API_CLIENT_TIMEOUT=60 export EXPLORER_CLIENT_TIMEOUT=60 export NODE_STATUS_API_TESTRUN_REFRESH_INTERVAL=120 @@ -20,7 +21,8 @@ function run_bare() { set -a source "${monorepo_root}/envs/${ENVIRONMENT}.env" set +a - export RUST_LOG=debug + export RUST_LOG=${user_rust_log_preference:-debug} + echo "RUST_LOG=${RUST_LOG}" # --conection-url is provided in build.rs cargo run --package nym-node-status-api diff --git a/nym-validator-rewarder/src/rewarder/storage/mod.rs b/nym-validator-rewarder/src/rewarder/storage/mod.rs index 1d58da9b111..876cb6d98d0 100644 --- a/nym-validator-rewarder/src/rewarder/storage/mod.rs +++ b/nym-validator-rewarder/src/rewarder/storage/mod.rs @@ -7,6 +7,7 @@ use crate::{ rewarder::{epoch::Epoch, storage::manager::StorageManager, RewardingResult}, }; use nym_contracts_common::types::NaiveFloat; +use sqlx::sqlite::{SqliteAutoVacuum, SqliteSynchronous}; use sqlx::ConnectOptions; use std::{fmt::Debug, path::Path}; use time::{Date, OffsetDateTime}; @@ -23,6 +24,9 @@ impl RewarderStorage { #[instrument] pub async fn init + Debug>(database_path: P) -> Result { let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging(); diff --git a/tools/internal/testnet-manager/src/manager/storage/mod.rs b/tools/internal/testnet-manager/src/manager/storage/mod.rs index c61f52070e0..7eb3df7cb16 100644 --- a/tools/internal/testnet-manager/src/manager/storage/mod.rs +++ b/tools/internal/testnet-manager/src/manager/storage/mod.rs @@ -10,7 +10,10 @@ use crate::{ storage::manager::StorageManager, }, }; -use sqlx::ConnectOptions; +use sqlx::{ + sqlite::{SqliteAutoVacuum, SqliteSynchronous}, + ConnectOptions, +}; use std::path::Path; use tracing::{error, info}; use url::Url; @@ -39,6 +42,9 @@ impl NetworkManagerStorage { // TODO: we can inject here more stuff based on our nym-api global config // struct. Maybe different pool size or timeout intervals? let opts = sqlx::sqlite::SqliteConnectOptions::new() + .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal) + .synchronous(SqliteSynchronous::Normal) + .auto_vacuum(SqliteAutoVacuum::Incremental) .filename(database_path) .create_if_missing(true) .disable_statement_logging();