@@ -137,8 +137,9 @@ pub struct ChainSpec {
137137 * Fork choice
138138 */
139139 pub proposer_score_boost : Option < u64 > ,
140- pub reorg_head_weight_threshold : Option < u64 > ,
141- pub reorg_parent_weight_threshold : Option < u64 > ,
140+ pub reorg_head_weight_threshold : u64 ,
141+ pub reorg_parent_weight_threshold : u64 ,
142+ pub reorg_max_epochs_since_finalization : u64 ,
142143
143144 /*
144145 * Eth1
@@ -1028,8 +1029,9 @@ impl ChainSpec {
10281029 * Fork choice
10291030 */
10301031 proposer_score_boost : Some ( 40 ) ,
1031- reorg_head_weight_threshold : Some ( 20 ) ,
1032- reorg_parent_weight_threshold : Some ( 160 ) ,
1032+ reorg_head_weight_threshold : 20 ,
1033+ reorg_parent_weight_threshold : 160 ,
1034+ reorg_max_epochs_since_finalization : 2 ,
10331035
10341036 /*
10351037 * Eth1
@@ -1394,8 +1396,9 @@ impl ChainSpec {
13941396 * Fork choice
13951397 */
13961398 proposer_score_boost : Some ( 40 ) ,
1397- reorg_head_weight_threshold : Some ( 20 ) ,
1398- reorg_parent_weight_threshold : Some ( 160 ) ,
1399+ reorg_head_weight_threshold : 20 ,
1400+ reorg_parent_weight_threshold : 160 ,
1401+ reorg_max_epochs_since_finalization : 2 ,
13991402
14001403 /*
14011404 * Eth1
@@ -1811,6 +1814,16 @@ pub struct Config {
18111814 #[ serde( skip_serializing_if = "Option::is_none" ) ]
18121815 proposer_score_boost : Option < MaybeQuoted < u64 > > ,
18131816
1817+ #[ serde( default = "default_reorg_head_weight_threshold" ) ]
1818+ #[ serde( with = "serde_utils::quoted_u64" ) ]
1819+ reorg_head_weight_threshold : u64 ,
1820+ #[ serde( default = "default_reorg_parent_weight_threshold" ) ]
1821+ #[ serde( with = "serde_utils::quoted_u64" ) ]
1822+ reorg_parent_weight_threshold : u64 ,
1823+ #[ serde( default = "default_reorg_max_epochs_since_finalization" ) ]
1824+ #[ serde( with = "serde_utils::quoted_u64" ) ]
1825+ reorg_max_epochs_since_finalization : u64 ,
1826+
18141827 #[ serde( with = "serde_utils::quoted_u64" ) ]
18151828 deposit_chain_id : u64 ,
18161829 #[ serde( with = "serde_utils::quoted_u64" ) ]
@@ -1974,6 +1987,18 @@ const fn default_max_per_epoch_activation_churn_limit() -> u64 {
19741987 8
19751988}
19761989
1990+ const fn default_reorg_head_weight_threshold ( ) -> u64 {
1991+ 20
1992+ }
1993+
1994+ const fn default_reorg_parent_weight_threshold ( ) -> u64 {
1995+ 160
1996+ }
1997+
1998+ const fn default_reorg_max_epochs_since_finalization ( ) -> u64 {
1999+ 2
2000+ }
2001+
19772002const fn default_gas_limit_adjustment_factor ( ) -> u64 {
19782003 1024
19792004}
@@ -2263,6 +2288,10 @@ impl Config {
22632288
22642289 proposer_score_boost : spec. proposer_score_boost . map ( |value| MaybeQuoted { value } ) ,
22652290
2291+ reorg_head_weight_threshold : spec. reorg_head_weight_threshold ,
2292+ reorg_parent_weight_threshold : spec. reorg_parent_weight_threshold ,
2293+ reorg_max_epochs_since_finalization : spec. reorg_max_epochs_since_finalization ,
2294+
22662295 deposit_chain_id : spec. deposit_chain_id ,
22672296 deposit_network_id : spec. deposit_network_id ,
22682297 deposit_contract_address : spec. deposit_contract_address ,
@@ -2351,6 +2380,9 @@ impl Config {
23512380 max_per_epoch_activation_churn_limit,
23522381 churn_limit_quotient,
23532382 proposer_score_boost,
2383+ reorg_head_weight_threshold,
2384+ reorg_parent_weight_threshold,
2385+ reorg_max_epochs_since_finalization,
23542386 deposit_chain_id,
23552387 deposit_network_id,
23562388 deposit_contract_address,
@@ -2423,6 +2455,9 @@ impl Config {
24232455 max_per_epoch_activation_churn_limit,
24242456 churn_limit_quotient,
24252457 proposer_score_boost : proposer_score_boost. map ( |q| q. value ) ,
2458+ reorg_head_weight_threshold,
2459+ reorg_parent_weight_threshold,
2460+ reorg_max_epochs_since_finalization,
24262461 deposit_chain_id,
24272462 deposit_network_id,
24282463 deposit_contract_address,
0 commit comments