This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: backport fix of 0.0.11 (#453)
Signed-off-by: Simon Paitrault <[email protected]> Co-authored-by: David Palm <[email protected]>
- Loading branch information
Showing
26 changed files
with
295 additions
and
59 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Configuration for the TCE synchronization | ||
#[derive(Serialize, Deserialize, Debug, Clone)] | ||
#[serde(rename_all = "kebab-case")] | ||
pub struct SynchronizationConfig { | ||
/// Interval in seconds to synchronize the TCE | ||
#[serde(default = "SynchronizationConfig::default_interval_seconds")] | ||
pub interval_seconds: u64, | ||
|
||
/// Maximum number of Proof of delivery per query per subnet | ||
#[serde(default = "SynchronizationConfig::default_limit_per_subnet")] | ||
pub limit_per_subnet: usize, | ||
} | ||
|
||
impl Default for SynchronizationConfig { | ||
fn default() -> Self { | ||
Self { | ||
interval_seconds: SynchronizationConfig::INTERVAL_SECONDS, | ||
limit_per_subnet: SynchronizationConfig::LIMIT_PER_SUBNET, | ||
} | ||
} | ||
} | ||
|
||
impl SynchronizationConfig { | ||
pub const INTERVAL_SECONDS: u64 = 10; | ||
pub const LIMIT_PER_SUBNET: usize = 100; | ||
|
||
const fn default_interval_seconds() -> u64 { | ||
Self::INTERVAL_SECONDS | ||
} | ||
|
||
const fn default_limit_per_subnet() -> usize { | ||
Self::LIMIT_PER_SUBNET | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.