Conversation
Co-authored-by: eltitanb <lorenzo@gattaca.com> Co-authored-by: ltitanb <163874448+ltitanb@users.noreply.github.com> Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
Co-authored-by: eltitanb <lorenzo@gattaca.com> Co-authored-by: ltitanb <163874448+ltitanb@users.noreply.github.com> Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
Co-authored-by: eltitanb <lorenzo@gattaca.com> Co-authored-by: ltitanb <163874448+ltitanb@users.noreply.github.com> Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
…st-client into sigp-audit-fixes
Co-authored-by: eltitanb <lorenzo@gattaca.com> Co-authored-by: ltitanb <163874448+ltitanb@users.noreply.github.com> Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
Co-authored-by: eltitanb <lorenzo@gattaca.com> Co-authored-by: ltitanb <163874448+ltitanb@users.noreply.github.com> Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
Co-authored-by: ltitanb <163874448+ltitanb@users.noreply.github.com>
Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
… 1.91 as required. Add audit.toml to ignore irrevelent audit error in CI.
…ssing ignored mid_bid despite having the bid value available
df936ef to
5daf7f9
Compare
| /// Which encoding types the original requester accepts in the response. | ||
| /// As the builder spec adds more encoding types, this struct can be expanded. | ||
| #[derive(Clone)] | ||
| pub struct AcceptTypes { |
There was a problem hiding this comment.
these seem to be unused, can delete? also we should have a clippy check that would flag things like that in CI
| let (mux_lookup, registry_muxes) = match config.muxes { | ||
| Some(muxes) => { | ||
| let (mux_lookup, registry_muxes) = | ||
| let (mux_lookup, registry_muxes): (_, _) = |
There was a problem hiding this comment.
nit: can remove type annotation
| let (mux_lookup, registry_muxes) = match cb_config.muxes { | ||
| Some(muxes) => { | ||
| let (mux_lookup, registry_muxes) = muxes | ||
| let (mux_lookup, registry_muxes): (_, _) = muxes |
|
|
||
| let parsed = match mt.essence().to_string().as_str() { | ||
| APPLICATION_OCTET_STREAM => Some(EncodingType::Ssz), | ||
| APPLICATION_JSON | WILDCARD => Some(EncodingType::Json), |
There was a problem hiding this comment.
is wildcard actually a valid json? should this match have two branches maybe: ssz <-> json?
there is a comment below that says "Assume missing Content-Type means JSON" too - ??
| .ok() | ||
| } | ||
|
|
||
| /// Enum for types that can be used to encode incoming request bodies or |
|
|
||
| /// The accepted encoding types from the original request, ordered by | ||
| /// descending caller preference (q-value). | ||
| accepted_types: Vec<EncodingType>, |
There was a problem hiding this comment.
this is max two values, right? can we actually get two accepted types and not one for a single request? if yes, can do an ArrayVec then, otherwise one value is enough
|
|
||
| match code { | ||
| StatusCode::ACCEPTED => { | ||
| return Ok(SubmitBlockResponseInfo { |
There was a problem hiding this comment.
maybe do an option instead? too expensive for a dummy value
| /// response, leaving the raw bytes intact for direct forwarding to the caller. | ||
| /// Used in `HeaderValidationMode::None` where expensive crypto/structural | ||
| /// checks are skipped. | ||
| async fn send_get_header_light( |
There was a problem hiding this comment.
looks like this does pretty much the same thing as the _full version, so the inside part of these can be extracted
can do single function returning the raw response_bytes + content_type + fork, with a single decode step driven by a flag for the full / light
|
|
||
| /// Send and lightly process a submit_block request, minimizing the amount of | ||
| /// decoding and validation done | ||
| async fn send_submit_block_light( |
There was a problem hiding this comment.
same here - some duplicate code with the send_submit_block_full that can be extracted
| pub const CONSENSUS_VERSION_HEADER: &str = "Eth-Consensus-Version"; | ||
|
|
||
| lazy_static! { | ||
| static ref SSZ_VALUE_OFFSETS_BY_FORK: HashMap<ForkName, usize> = { |
There was a problem hiding this comment.
don't think we need a hashmap for this, performance-wise inlining the get_ssz_value_offset_for_fork should do better
This is an update to #372 which is now obsolete, and adds robust SSZ support to
get_header()andsubmit_block():