From 258ba2089c6f9c0c8dfde9dbcb5570ec428bf379 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Mon, 10 Apr 2023 14:27:32 -0600 Subject: [PATCH 1/6] add retries to mobilecoind when it submits transactions i'm finding that sometimes it fails with attestation permission denied errors otherwise --- feel free to leave comments about how you would like this to be more configurable or use exponential backoff or something, let's decide exactly how it should work during review --- mobilecoind/src/payments.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mobilecoind/src/payments.rs b/mobilecoind/src/payments.rs index 314806092f..2f72eb8791 100644 --- a/mobilecoind/src/payments.rs +++ b/mobilecoind/src/payments.rs @@ -36,12 +36,12 @@ use rand::Rng; use std::{ cmp::{max, Reverse}, collections::BTreeMap, - iter::empty, str::FromStr, sync::{ atomic::{AtomicUsize, Ordering}, Arc, }, + time::Duration, }; /// Default number of blocks used for calculating transaction tombstone block @@ -826,12 +826,14 @@ impl Date: Mon, 10 Apr 2023 15:24:09 -0600 Subject: [PATCH 2/6] make it match full-service retries --- mobilecoind/src/payments.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobilecoind/src/payments.rs b/mobilecoind/src/payments.rs index 2f72eb8791..f3d59529d9 100644 --- a/mobilecoind/src/payments.rs +++ b/mobilecoind/src/payments.rs @@ -33,6 +33,7 @@ use mc_transaction_extra::{ }; use mc_util_uri::FogUri; use rand::Rng; +use retry::delay::Fibonacci; use std::{ cmp::{max, Reverse}, collections::BTreeMap, @@ -41,7 +42,6 @@ use std::{ atomic::{AtomicUsize, Ordering}, Arc, }, - time::Duration, }; /// Default number of blocks used for calculating transaction tombstone block @@ -826,7 +826,8 @@ impl Date: Tue, 11 Apr 2023 08:42:31 -0600 Subject: [PATCH 3/6] tweak retry timings per review --- mobilecoind/src/payments.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mobilecoind/src/payments.rs b/mobilecoind/src/payments.rs index f3d59529d9..d6afaa750f 100644 --- a/mobilecoind/src/payments.rs +++ b/mobilecoind/src/payments.rs @@ -826,8 +826,14 @@ impl Date: Tue, 11 Apr 2023 08:43:39 -0600 Subject: [PATCH 4/6] unused import --- mobilecoind/src/payments.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/mobilecoind/src/payments.rs b/mobilecoind/src/payments.rs index d6afaa750f..e05a0251d3 100644 --- a/mobilecoind/src/payments.rs +++ b/mobilecoind/src/payments.rs @@ -33,7 +33,6 @@ use mc_transaction_extra::{ }; use mc_util_uri::FogUri; use rand::Rng; -use retry::delay::Fibonacci; use std::{ cmp::{max, Reverse}, collections::BTreeMap, From 2c355550da22270778044b745be1d14b672141a6 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Tue, 11 Apr 2023 10:01:09 -0600 Subject: [PATCH 5/6] fix build --- mobilecoind/src/payments.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mobilecoind/src/payments.rs b/mobilecoind/src/payments.rs index e05a0251d3..ae546331b2 100644 --- a/mobilecoind/src/payments.rs +++ b/mobilecoind/src/payments.rs @@ -41,6 +41,7 @@ use std::{ atomic::{AtomicUsize, Ordering}, Arc, }, + time::Duration, }; /// Default number of blocks used for calculating transaction tombstone block @@ -832,6 +833,7 @@ impl Date: Tue, 11 Apr 2023 10:25:34 -0600 Subject: [PATCH 6/6] clippy --- mobilecoind/src/payments.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobilecoind/src/payments.rs b/mobilecoind/src/payments.rs index ae546331b2..071e125899 100644 --- a/mobilecoind/src/payments.rs +++ b/mobilecoind/src/payments.rs @@ -831,7 +831,7 @@ impl