-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] improvements to proposal handling (#690)
* [fix] improvements to proposal handling * fix harness * fix clippy
- Loading branch information
Showing
9 changed files
with
200 additions
and
86 deletions.
There are no files selected for viewing
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,61 @@ | ||
// Constants for dkg-gadget | ||
|
||
// ================= Common ======================== // | ||
pub const DKG_KEYGEN_PROTOCOL_NAME: &str = "/webb-tools/dkg/keygen/1"; | ||
|
||
pub const DKG_SIGNING_PROTOCOL_NAME: &str = "/webb-tools/dkg/signing/1"; | ||
|
||
// ================= Worker ========================== // | ||
pub mod worker { | ||
pub const ENGINE_ID: sp_runtime::ConsensusEngineId = *b"WDKG"; | ||
|
||
pub const STORAGE_SET_RETRY_NUM: usize = 5; | ||
|
||
pub const MAX_SUBMISSION_DELAY: u32 = 3; | ||
|
||
pub const MAX_KEYGEN_RETRIES: usize = 5; | ||
|
||
/// How many blocks to keep the proposal hash in out local cache. | ||
pub const PROPOSAL_HASH_LIFETIME: u32 = 10; | ||
} | ||
|
||
// ============= Signing Manager ======================= // | ||
|
||
pub mod signing_manager { | ||
// the maximum number of tasks that the work manager tries to assign | ||
pub const MAX_RUNNING_TASKS: usize = 1; | ||
|
||
// the maximum number of tasks that can be enqueued, | ||
// enqueued here implies not actively running but listening for messages | ||
pub const MAX_ENQUEUED_TASKS: usize = 20; | ||
|
||
// How often to poll the jobs to check completion status | ||
pub const JOB_POLL_INTERVAL_IN_MILLISECONDS: u64 = 500; | ||
|
||
// Number of signing sets to generate for every proposal | ||
pub const MAX_POTENTIAL_SIGNING_SETS_PER_PROPOSAL: u8 = 2; | ||
} | ||
|
||
// ============= Networking ======================= // | ||
|
||
pub mod network { | ||
/// Maximum number of known messages hashes to keep for a peer. | ||
pub const MAX_KNOWN_MESSAGES: usize = 4096; | ||
|
||
/// Maximum allowed size for a DKG Signed Message notification. | ||
pub const MAX_MESSAGE_SIZE: u64 = 16 * 1024 * 1024; | ||
|
||
/// Maximum number of duplicate messages that a single peer can send us. | ||
/// | ||
/// This is to prevent a malicious peer from spamming us with messages. | ||
pub const MAX_DUPLICATED_MESSAGES_PER_PEER: usize = 8; | ||
} | ||
|
||
// ============= Keygen Manager ======================= // | ||
|
||
pub mod keygen_manager { | ||
/// only 1 task at a time may run for keygen | ||
pub const MAX_RUNNING_TASKS: usize = 1; | ||
/// There should never be any job enqueueing for keygen | ||
pub const MAX_ENQUEUED_TASKS: usize = 0; | ||
} |
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.