avalanche_types/subnet/config/
consensus.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
7#[serde(rename_all = "camelCase")]
8pub struct SnowballParameters {
9 pub k: i32,
11 pub alpha: i32,
13
14 pub beta_virtuous: i32,
16 pub beta_rogue: i32,
18
19 pub concurrent_repolls: i32,
21 pub optimal_processing: i32,
23
24 pub max_outstanding_items: i32,
26 pub max_item_processing_time: i64,
28
29 pub mixed_query_num_push_vdr: i32,
30 pub mixed_query_num_push_non_vdr: i32,
31}
32
33impl Default for SnowballParameters {
34 fn default() -> Self {
37 Self {
38 k: 20,
39 alpha: 15,
40 beta_virtuous: 15,
41 beta_rogue: 20,
42 concurrent_repolls: 4,
43 optimal_processing: 50,
44 max_outstanding_items: 1024,
45 max_item_processing_time: 2 * 1000 * 1000 * 1000, mixed_query_num_push_vdr: 10,
47 mixed_query_num_push_non_vdr: 0,
48 }
49 }
50}
51
52#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
53#[serde(rename_all = "camelCase")]
54pub struct Parameters {
55 #[serde(flatten)]
57 pub snowball_parameters: SnowballParameters,
58 pub parents: i32,
59 pub batch_size: i32,
60}
61
62impl Default for Parameters {
63 fn default() -> Self {
66 Self {
67 snowball_parameters: SnowballParameters::default(),
68 parents: 5,
69 batch_size: 30,
70 }
71 }
72}