From 894c437e3f865a7fbce81614e113d98b15201d24 Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Tue, 4 Jun 2024 12:53:06 +0900 Subject: [PATCH 1/2] chore: small tweak to get foundaiton cash --- resources/scripts/get-foundation-cash.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/scripts/get-foundation-cash.sh b/resources/scripts/get-foundation-cash.sh index 52929d90a8..ef13ff9e59 100755 --- a/resources/scripts/get-foundation-cash.sh +++ b/resources/scripts/get-foundation-cash.sh @@ -4,6 +4,8 @@ # Suffix to append to the version. Passed as an argument to this script. FOUNDATION_SERVER="$1" +PEER="$2" + # if doundation server not provided, exit if [ -z "$FOUNDATION_SERVER" ]; then @@ -11,6 +13,12 @@ FOUNDATION_SERVER="$1" exit 1 fi -scp root@$FOUNDATION_SERVER:/home/safe/.local/share/safe/test_faucet/wallet/foundation_disbursement.cash_note $TMPDIR/foundation.transfer -safe wallet receive $TMPDIR/foundation.transfer +# if doundation server not provided, exit + if [ -z "$PEER" ]; then + echo "Please provide the starting peer id an argument to this script" + exit 1 +fi + +scp root@$FOUNDATION_SERVER:/home/safe/.local/share/safe/test_faucet/wallet/foundation_disbursement.transfer $TMPDIR/foundation.transfer +safe --peer $2 wallet receive $TMPDIR/foundation.transfer --file safe wallet balance From 34c23c45ce5c27728197405f3bcd6e26fffc4dfc Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Tue, 4 Jun 2024 13:13:12 +0900 Subject: [PATCH 2/2] chore: reduce dag recrawl interval --- sn_auditor/src/dag_db.rs | 8 ++++---- sn_auditor/src/main.rs | 6 +++--- sn_node/src/node.rs | 5 ++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sn_auditor/src/dag_db.rs b/sn_auditor/src/dag_db.rs index 2e965ec91d..b16c4f4a2f 100644 --- a/sn_auditor/src/dag_db.rs +++ b/sn_auditor/src/dag_db.rs @@ -28,7 +28,7 @@ pub const SPEND_DAG_SVG_FILENAME: &str = "spend_dag.svg"; /// Store a locally copy to restore on restart pub const BETA_PARTICIPANTS_FILENAME: &str = "beta_participants.txt"; -const REATTEMPT_INTERVAL: Duration = Duration::from_secs(3600); +const DAG_RECRAWL_INTERVAL: Duration = Duration::from_secs(60); const SPENDS_PROCESSING_BUFFER_SIZE: usize = 4096; /// Abstraction for the Spend DAG database @@ -223,8 +223,8 @@ impl SpendDagDb { let addrs_to_get = utxos_to_fetch.keys().cloned().collect::>(); if addrs_to_get.is_empty() { - debug!("Sleeping for {REATTEMPT_INTERVAL:?} until next re-attempt..."); - tokio::time::sleep(REATTEMPT_INTERVAL).await; + debug!("Sleeping for {DAG_RECRAWL_INTERVAL:?} until next re-attempt..."); + tokio::time::sleep(DAG_RECRAWL_INTERVAL).await; continue; } @@ -241,7 +241,7 @@ impl SpendDagDb { utxo_addresses.extend( new_utxos .into_iter() - .map(|a| (a, Instant::now() + REATTEMPT_INTERVAL)), + .map(|a| (a, Instant::now() + DAG_RECRAWL_INTERVAL)), ); // write updates to local DAG and save to disk diff --git a/sn_auditor/src/main.rs b/sn_auditor/src/main.rs index 0f7976ff0a..4398a17c14 100644 --- a/sn_auditor/src/main.rs +++ b/sn_auditor/src/main.rs @@ -25,7 +25,7 @@ use std::path::PathBuf; use tiny_http::{Response, Server}; /// Backup the beta rewards in a timestamped json file -const BETA_REWARDS_BACKOUP_INTERVAL_SECS: u64 = 20 * 60; +const BETA_REWARDS_BACKUP_INTERVAL_SECS: u64 = 20 * 60; #[derive(Parser)] #[command(author, version, about, long_about = None)] @@ -163,10 +163,10 @@ fn initialize_background_rewards_backup(dag: SpendDagDb) { tokio::spawn(async move { loop { trace!( - "Sleeping for {BETA_REWARDS_BACKOUP_INTERVAL_SECS} seconds before next backup..." + "Sleeping for {BETA_REWARDS_BACKUP_INTERVAL_SECS} seconds before next backup..." ); tokio::time::sleep(tokio::time::Duration::from_secs( - BETA_REWARDS_BACKOUP_INTERVAL_SECS, + BETA_REWARDS_BACKUP_INTERVAL_SECS, )) .await; println!("Backing up beta rewards..."); diff --git a/sn_node/src/node.rs b/sn_node/src/node.rs index 954a5f15b3..7845f5062e 100644 --- a/sn_node/src/node.rs +++ b/sn_node/src/node.rs @@ -250,7 +250,10 @@ impl Node { PERIODIC_REPLICATION_INTERVAL_MAX_S / 2..PERIODIC_REPLICATION_INTERVAL_MAX_S, ); let balance_forward_time = Duration::from_secs(balance_forward_interval); - debug!("BalanceForward interval set to {balance_forward_time:?}"); + debug!( + "BalanceForward interval set to {balance_forward_time:?} to: {:?}", + PAYMENT_FORWARD_PK.to_hex(), + ); let mut balance_forward_interval = tokio::time::interval(balance_forward_time); let _ = balance_forward_interval.tick().await; // first tick completes immediately