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

Update prover service to new config format #1723

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions hotshot-state-prover/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ pub fn init_stake_table(
}

#[derive(Debug, Deserialize)]
pub struct PublicHotShotConfig {
pub known_nodes_with_stake: Vec<PeerConfig<BLSPubKey>>,
struct PublicHotShotConfig {
known_nodes_with_stake: Vec<PeerConfig<BLSPubKey>>,
}

#[derive(Debug, Deserialize)]
struct PublicNetworkConfig {
config: PublicHotShotConfig,
}

/// Initialize the stake table from a sequencer node that
Expand All @@ -129,8 +134,8 @@ async fn init_stake_table_from_sequencer(
// Request the configuration until it is successful
let network_config: PublicHotShotConfig = loop {
match reqwest::get(config_url.clone()).await {
Ok(resp) => match resp.json::<PublicHotShotConfig>().await {
Ok(config) => break config,
Ok(resp) => match resp.json::<PublicNetworkConfig>().await {
Ok(config) => break config.config,
Err(e) => {
tracing::error!("Failed to parse the network config: {e}");
sleep(Duration::from_secs(5)).await;
Expand Down
Loading