Skip to content

Commit

Permalink
more consistently use Nakamoto coefficient term
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Aug 16, 2024
1 parent 6e31be8 commit 9a88b91
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const SubnetChangePage = ({ network }: { network: string }) => {
<Grid item xs={12}>
<Chip label="Vote on the proposal" component="a" href={`https://nns.ic0.app/proposal/?proposal=${change?.proposal_id}`} clickable target='_blank' icon={<HowToVoteIcon style={{ color: purple[500] }} />} />
</Grid>
<Typography variant="h5" style={{ marginLeft: 16 }}>Decentralization scores</Typography>
<Typography variant="h5" style={{ marginLeft: 16 }}>Decentralization Nakamoto coefficients</Typography>
<Grid item xs={12} container direction='column'>

{Object.entries(change?.score_after?.coefficients ?? {}).map(([key, _]) => {
Expand All @@ -158,7 +158,7 @@ export const SubnetChangePage = ({ network }: { network: string }) => {
</Grid>
{change?.comment && <Grid item>
<Alert variant="filled" severity="warning">
{ change?.comment.split("\n").filter(l => l).map((line, index) => { if (index == 0) {return line} else { return <li>{line}</li> } }) }
{change?.comment.split("\n").filter(l => l).map((line, index) => { if (index == 0) { return line } else { return <li>{line}</li> } })}
</Alert>
</Grid>
}
Expand Down
4 changes: 2 additions & 2 deletions rs/cli/src/commands/subnet/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ pub struct Create {
#[clap(long, num_args(1..))]
pub only: Vec<String>,

#[clap(long, num_args(1..), help = r#"Force t he inclusion of the provided nodes for replacement,
regardless of the decentralization score"#)]
#[clap(long, num_args(1..), help = r#"Force the inclusion of the provided nodes for replacement,
regardless of the decentralization coefficients"#)]
pub include: Vec<PrincipalId>,

/// Motivation for replacing custom nodes
Expand Down
2 changes: 1 addition & 1 deletion rs/cli/src/commands/subnet/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ algorithm"#
pub only: Vec<String>,

/// Force the inclusion of the provided nodes for replacement, regardless
/// of the decentralization score
/// of the decentralization coefficients
#[clap(long, num_args(1..))]
pub include: Vec<PrincipalId>,

Expand Down
6 changes: 5 additions & 1 deletion rs/decentralization/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ impl From<&network::SubnetChange> for SubnetChangeResponse {

impl Display for SubnetChangeResponse {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
writeln!(f, "Decentralization score changes for subnet {}:\n", self.subnet_id.unwrap_or_default())?;
writeln!(
f,
"Decentralization Nakamoto coefficient changes for subnet {}:\n",
self.subnet_id.unwrap_or_default()
)?;
let before_individual = self.score_before.scores_individual();
let after_individual = self.score_after.scores_individual();
self.score_before
Expand Down

0 comments on commit 9a88b91

Please sign in to comment.