Skip to content

Commit

Permalink
feat(api_key): api key passed to FetchConfig correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
antiyro committed Mar 28, 2024
1 parent 222c5e7 commit 4dcc7fc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ git # Deoxys Changelog

## Next release

- feat(api_key): api key passed to FetchConfig correctly
- feat(api_key): Added support for --gateway-api to avoid rate limit from the gateway
- fix(latest): Retrieve latest synced block via internal client
- perf(l2 sync): parallelize commitment computation and refactor part of l2 io sync
- refactor: rpc methods and removed rpc-core
Expand Down
7 changes: 6 additions & 1 deletion crates/client/sync/src/fetch/fetchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ where
}

pub async fn fetch_apply_genesis_block(config: FetchConfig) -> Result<DeoxysBlock, String> {
let client = SequencerGatewayProvider::new(config.gateway.clone(), config.feeder_gateway.clone(), config.chain_id, config.api_key.clone());
let client = SequencerGatewayProvider::new(
config.gateway.clone(),
config.feeder_gateway.clone(),
config.chain_id,
config.api_key.clone(),
);
let block = client.get_block(BlockId::Number(0)).await.map_err(|e| format!("failed to get block: {e}"))?;

Ok(crate::convert::block(block).await)
Expand Down
2 changes: 1 addition & 1 deletion crates/client/sync/src/l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub async fn sync<C>(
fetch_config.gateway.clone(),
fetch_config.feeder_gateway.clone(),
fetch_config.chain_id,
fetch_config.api_key
fetch_config.api_key,
));
let mut last_block_hash = None;

Expand Down
11 changes: 10 additions & 1 deletion crates/node/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ impl NetworkType {
let feeder_gateway = format!("{uri}/feeder_gateway").parse().unwrap();
let l1_core_address = self.l1_core_address();

FetchConfig { gateway, feeder_gateway, chain_id, workers: 5, sound: false, l1_core_address, verify: true, api_key: None }
FetchConfig {
gateway,
feeder_gateway,
chain_id,
workers: 5,
sound: false,
l1_core_address,
verify: true,
api_key: None,
}
}
}

Expand Down

0 comments on commit 4dcc7fc

Please sign in to comment.