Skip to content

Commit

Permalink
Merge branch 'brent+grarco/jail-inactive-validator' (#2174)
Browse files Browse the repository at this point in the history
* brent+grarco/jail-inactive-validator:
  finalize_block: unit test
  more refactors to liveness unjailing protocol and data
  refactors
  Improves liveness jail test
  Updates masp proofs
  Jails validators up to the pipeline len
  Clippy fix
  Adds test and fixes bug with multi-jailing
  Turns liveness const into pos params
  Fixes underflow bug in validator inactivity jailing
  Deactivate validator when jailing for inactivity
  Refactors validator activity data
  Jail validators for inactivity
  Adds liveness data for conensus validators
  • Loading branch information
brentstone committed Nov 17, 2023
2 parents d2efffe + 232ca99 commit 085d892
Show file tree
Hide file tree
Showing 20 changed files with 887 additions and 208 deletions.
4 changes: 4 additions & 0 deletions apps/src/lib/config/genesis/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ impl Finalized {
light_client_attack_min_slash_rate,
cubic_slashing_window_length,
validator_stake_threshold,
liveness_window_check,
liveness_threshold,
} = self.parameters.pos_params.clone();

namada::proof_of_stake::parameters::PosParams {
Expand All @@ -350,6 +352,8 @@ impl Finalized {
light_client_attack_min_slash_rate,
cubic_slashing_window_length,
validator_stake_threshold,
liveness_window_check,
liveness_threshold,
},
max_proposal_period: self.parameters.gov_params.max_proposal_period,
}
Expand Down
6 changes: 6 additions & 0 deletions apps/src/lib/config/genesis/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ pub struct PosParams {
/// The minimum amount of bonded tokens that a validator needs to be in
/// either the `consensus` or `below_capacity` validator sets
pub validator_stake_threshold: token::Amount,
/// The length, in blocks, of the sliding window for consensus validators
/// inactivity verification
pub liveness_window_check: u64,
/// The minimum required activity of consensus validators, in percentage,
/// over the `liveness_window_check`
pub liveness_threshold: Dec,
}

#[derive(
Expand Down
Loading

0 comments on commit 085d892

Please sign in to comment.