Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

score-all command #119

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

luciotato
Copy link

  • make stake pool optional, score-all command

  • generate validator-detail.csv

  • skip heavy rpc-call, ensure all validators scored

  • compute score

  • scripts

  • parametrize score, do not combine with --confirm

  • fix score-all arguments

* make stake pool optional, score-all command

* generate validator-detail.csv

* skip heavy rpc-call, ensure all validators scored

* compute score

* scripts

* parametrize score, do not combine with --confirm

* fix score-all arguments
bot/src/db.rs Outdated
Comment on lines 33 to 39
/// computed score (more granular than ValidatorStakeState)
pub epoch_credits: u64, // epoch_credits is the base score
pub score_discounts: ScoreDiscounts,
pub commission: u8,
pub active_stake: u64,
pub data_center_concentration: f64,

Copy link
Contributor

@mvines mvines Jul 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to avoid breaking the existing database entries, the new fields here need to each be wrapped in an Option<>. You might find it easier to move them all out into a single struct and wrap an Option around just that struct

@@ -196,6 +196,15 @@ struct Config {

dry_run: bool,

/// compute score foll all validators in the cluster
score_all: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about rebasing this PR on #118, where we add a Command enum to avoid adding command-specific (ScoreAll in this case) parameters into the Config struct

@@ -293,7 +306,9 @@ impl Config {
}

fn cluster_db_path_for(&self, cluster: Cluster) -> PathBuf {
self.db_path.join(format!("data-{}", cluster))
// store db on different dir for score-all to not mess with SPL-stake-pool distribution usage
let dir = if self.score_all { "score-all" } else { "data" };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid this change by making the db.rs changes backwards compatible ?

bot/src/main.rs Outdated
continue;
}

/* -- ------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this comment block

@luciotato
Copy link
Author

making some changes, will fix based on recommendations after our launch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants