From 91b9f4c4c6e0ea6a9750438e80af1b4e5f0d440d Mon Sep 17 00:00:00 2001 From: zyc <18611145971@163.com> Date: Wed, 26 Nov 2025 21:07:29 +0800 Subject: [PATCH 1/2] Fix assertion --- nym-node/src/config/gateway_tasks.rs | 2 +- nym-node/src/config/old_configs/old_config_v10.rs | 2 +- nym-node/src/config/old_configs/old_config_v4.rs | 2 +- nym-node/src/config/old_configs/old_config_v5.rs | 2 +- nym-node/src/config/old_configs/old_config_v6.rs | 2 +- nym-node/src/config/old_configs/old_config_v7.rs | 2 +- nym-node/src/config/old_configs/old_config_v8.rs | 2 +- nym-node/src/config/old_configs/old_config_v9.rs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nym-node/src/config/gateway_tasks.rs b/nym-node/src/config/gateway_tasks.rs index ca47c155386..4830c1f0b2a 100644 --- a/nym-node/src/config/gateway_tasks.rs +++ b/nym-node/src/config/gateway_tasks.rs @@ -149,7 +149,7 @@ impl ZkNymTicketHandlerDebug { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v10.rs b/nym-node/src/config/old_configs/old_config_v10.rs index e45cca8dd21..7bd41bd63a7 100644 --- a/nym-node/src/config/old_configs/old_config_v10.rs +++ b/nym-node/src/config/old_configs/old_config_v10.rs @@ -598,7 +598,7 @@ impl ZkNymTicketHandlerDebugV10 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v4.rs b/nym-node/src/config/old_configs/old_config_v4.rs index 12934243224..a0a2251ad82 100644 --- a/nym-node/src/config/old_configs/old_config_v4.rs +++ b/nym-node/src/config/old_configs/old_config_v4.rs @@ -436,7 +436,7 @@ impl ZkNymTicketHandlerDebugV4 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v5.rs b/nym-node/src/config/old_configs/old_config_v5.rs index ec22dbb111d..edad4d85d19 100644 --- a/nym-node/src/config/old_configs/old_config_v5.rs +++ b/nym-node/src/config/old_configs/old_config_v5.rs @@ -438,7 +438,7 @@ impl ZkNymTicketHandlerDebugV5 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v6.rs b/nym-node/src/config/old_configs/old_config_v6.rs index 32c9fc41d7e..ae469945a20 100644 --- a/nym-node/src/config/old_configs/old_config_v6.rs +++ b/nym-node/src/config/old_configs/old_config_v6.rs @@ -458,7 +458,7 @@ impl ZkNymTicketHandlerDebugV6 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v7.rs b/nym-node/src/config/old_configs/old_config_v7.rs index 4f836edbd83..4d1d992ceda 100644 --- a/nym-node/src/config/old_configs/old_config_v7.rs +++ b/nym-node/src/config/old_configs/old_config_v7.rs @@ -516,7 +516,7 @@ impl ZkNymTicketHandlerDebugV7 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v8.rs b/nym-node/src/config/old_configs/old_config_v8.rs index cd469fc92c8..8ee710e8513 100644 --- a/nym-node/src/config/old_configs/old_config_v8.rs +++ b/nym-node/src/config/old_configs/old_config_v8.rs @@ -490,7 +490,7 @@ impl ZkNymTicketHandlerDebugV8 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) diff --git a/nym-node/src/config/old_configs/old_config_v9.rs b/nym-node/src/config/old_configs/old_config_v9.rs index d14b89f31ad..242560f93e3 100644 --- a/nym-node/src/config/old_configs/old_config_v9.rs +++ b/nym-node/src/config/old_configs/old_config_v9.rs @@ -591,7 +591,7 @@ impl ZkNymTicketHandlerDebugV9 { }; assert!( - target_secs > 86400, + target_secs >= 86400, "the maximum time between redemption can't be lower than 1 day!" ); Duration::from_secs(target_secs as u64) From e50051795e166c6fae63689ca0cc2bde79cc5e01 Mon Sep 17 00:00:00 2001 From: zyc <18611145971@163.com> Date: Wed, 26 Nov 2025 21:11:38 +0800 Subject: [PATCH 2/2] Fix comment --- nym-node/src/config/gateway_tasks.rs | 2 +- nym-node/src/config/old_configs/old_config_v10.rs | 2 +- nym-node/src/config/old_configs/old_config_v4.rs | 2 +- nym-node/src/config/old_configs/old_config_v5.rs | 2 +- nym-node/src/config/old_configs/old_config_v6.rs | 2 +- nym-node/src/config/old_configs/old_config_v7.rs | 2 +- nym-node/src/config/old_configs/old_config_v8.rs | 2 +- nym-node/src/config/old_configs/old_config_v9.rs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nym-node/src/config/gateway_tasks.rs b/nym-node/src/config/gateway_tasks.rs index 4830c1f0b2a..ed6335fed8d 100644 --- a/nym-node/src/config/gateway_tasks.rs +++ b/nym-node/src/config/gateway_tasks.rs @@ -133,7 +133,7 @@ impl ZkNymTicketHandlerDebug { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.7; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v10.rs b/nym-node/src/config/old_configs/old_config_v10.rs index 7bd41bd63a7..73adcfe518a 100644 --- a/nym-node/src/config/old_configs/old_config_v10.rs +++ b/nym-node/src/config/old_configs/old_config_v10.rs @@ -582,7 +582,7 @@ impl ZkNymTicketHandlerDebugV10 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v4.rs b/nym-node/src/config/old_configs/old_config_v4.rs index a0a2251ad82..85543007422 100644 --- a/nym-node/src/config/old_configs/old_config_v4.rs +++ b/nym-node/src/config/old_configs/old_config_v4.rs @@ -420,7 +420,7 @@ impl ZkNymTicketHandlerDebugV4 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v5.rs b/nym-node/src/config/old_configs/old_config_v5.rs index edad4d85d19..dc1d4240c12 100644 --- a/nym-node/src/config/old_configs/old_config_v5.rs +++ b/nym-node/src/config/old_configs/old_config_v5.rs @@ -422,7 +422,7 @@ impl ZkNymTicketHandlerDebugV5 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v6.rs b/nym-node/src/config/old_configs/old_config_v6.rs index ae469945a20..3db0e98f1dc 100644 --- a/nym-node/src/config/old_configs/old_config_v6.rs +++ b/nym-node/src/config/old_configs/old_config_v6.rs @@ -442,7 +442,7 @@ impl ZkNymTicketHandlerDebugV6 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v7.rs b/nym-node/src/config/old_configs/old_config_v7.rs index 4d1d992ceda..015b0f3e301 100644 --- a/nym-node/src/config/old_configs/old_config_v7.rs +++ b/nym-node/src/config/old_configs/old_config_v7.rs @@ -500,7 +500,7 @@ impl ZkNymTicketHandlerDebugV7 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v8.rs b/nym-node/src/config/old_configs/old_config_v8.rs index 8ee710e8513..c022c999da1 100644 --- a/nym-node/src/config/old_configs/old_config_v8.rs +++ b/nym-node/src/config/old_configs/old_config_v8.rs @@ -474,7 +474,7 @@ impl ZkNymTicketHandlerDebugV8 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function diff --git a/nym-node/src/config/old_configs/old_config_v9.rs b/nym-node/src/config/old_configs/old_config_v9.rs index 242560f93e3..8e6abd79c57 100644 --- a/nym-node/src/config/old_configs/old_config_v9.rs +++ b/nym-node/src/config/old_configs/old_config_v9.rs @@ -575,7 +575,7 @@ impl ZkNymTicketHandlerDebugV9 { pub const DEFAULT_MINIMUM_API_QUORUM: f32 = 0.8; pub const DEFAULT_MINIMUM_REDEMPTION_TICKETS: usize = 100; - // use min(4/5 of max validity, validity - 1), but making sure it's no greater than 1 day + // use min(4/5 of max validity, validity - 1), but making sure it's no lower than 1 day // ASSUMPTION: our validity period is AT LEAST 2 days // // this could have been a constant, but it's more readable as a function