-
Notifications
You must be signed in to change notification settings - Fork 1
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
mapping #4
mapping #4
Conversation
4e4dbe1
to
b775579
Compare
8b8a692
to
367a554
Compare
2b19daa
to
d8f37ba
Compare
9983716
to
2b564c3
Compare
src/config.rs
Outdated
#[serde(rename = "beacon-urls")] | ||
pub beacon_urls: Vec<String>, | ||
#[serde(rename = "lookahead")] | ||
pub lookahead_providers_relays: Vec<Lookahead>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be something like lookaheads
?
src/config.rs
Outdated
#[serde(rename = "chain-id")] | ||
pub chain_id: u16, | ||
#[serde(rename = "relay-urls")] | ||
pub relay_urls: Vec<String>, | ||
#[serde(rename = "relays")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this?
src/lookahead/manager.rs
Outdated
None => bail!("no lookahead provider found"), | ||
Some(entry) => match &self.url_provider { | ||
UrlProvider::LookaheadEntry => { | ||
Ok(Url::from_str(&entry.url).expect("not a valid url")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think we should panic here, eg. if there is a malformed string coming from the provider. Let's return an error and log the wrong string
src/forward_service.rs
Outdated
.route("/", post(forward_request)) | ||
.layer(TraceLayer::new_for_http()) | ||
.with_state(Arc::new(shared_state)) | ||
} | ||
|
||
#[tracing::instrument] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would log the full function parameters every time , which is a bit verbose. We can customize what is added to the span https://docs.rs/tracing/latest/tracing/attr.instrument.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should log all errors but otherwise we can keep debug/trace for others , otherwise logging for each request may be create too much overhead
#[serde(rename = "registry")] | ||
pub registry: Option<HashMap<BlsPublicKey, Url>>, | ||
#[serde(rename = "url-provider")] | ||
pub url_provider: UrlProvider, | ||
} | ||
|
||
impl Config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add some validation here? eg if there' s no relays
No description provided.