Skip to content

Commit

Permalink
feat: add submit block request query (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jun 30, 2024
1 parent 7b47529 commit b036bc9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion crates/rpc-types-beacon/src/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub struct ValidatorRegistration {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ValidatorRegistrationMessage {
/// The fee recipient's address.
#[serde(rename = "fee_recipient")]
pub fee_recipient: Address,

/// The gas limit for the registration.
Expand Down Expand Up @@ -150,6 +149,23 @@ pub struct SubmitBlockRequest {
pub signature: BlsSignature,
}

/// Query for the `/relay/v1/builder/blocks` endpoint
#[serde_as]
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SubmitBlockRequestQuery {
/// If set to 1, opt into bid cancellations.
#[serde(skip_serializing_if = "Option::is_none")]
#[serde_as(as = "Option<serde_with::BoolFromInt>")]
pub cancellations: Option<bool>,
}

impl SubmitBlockRequestQuery {
/// Opt into bid cancellations.
pub const fn cancellations() -> Self {
Self { cancellations: Some(true) }
}
}

/// A Request to validate a [SubmitBlockRequest] <https://github.com/flashbots/builder/blob/03ee71cf0a344397204f65ff6d3a917ee8e06724/eth/block-validation/api.go#L132-L136>
#[serde_as]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down

0 comments on commit b036bc9

Please sign in to comment.