From 3043244db0df258cb8691eb9480b09396586b3a7 Mon Sep 17 00:00:00 2001 From: bsh98 <31482749+bsh98@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:55:36 -0800 Subject: [PATCH] add `builder_pubkey` to relay queries (#6236) --- crates/rpc/rpc-types/src/relay/mod.rs | 36 +++++++++++++++++++-------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/crates/rpc/rpc-types/src/relay/mod.rs b/crates/rpc/rpc-types/src/relay/mod.rs index 8e8ada470a..8fed94b79b 100644 --- a/crates/rpc/rpc-types/src/relay/mod.rs +++ b/crates/rpc/rpc-types/src/relay/mod.rs @@ -70,11 +70,9 @@ pub struct BidTrace { /// The hash of the block. pub block_hash: B256, /// The public key of the builder. - #[serde(rename = "builder_pubkey")] - pub builder_public_key: BlsPublicKey, + pub builder_pubkey: BlsPublicKey, /// The public key of the proposer. - #[serde(rename = "proposer_pubkey")] - pub proposer_public_key: BlsPublicKey, + pub proposer_pubkey: BlsPublicKey, /// The recipient of the proposer's fee. pub proposer_fee_recipient: Address, /// The gas limit associated with the block. @@ -197,9 +195,12 @@ pub struct ProposerPayloadsDeliveredQuery { /// Search for a specific EL block number #[serde(skip_serializing_if = "Option::is_none")] pub block_number: Option, - /// filter results by a proposer public key + /// Filter results by a proposer public key #[serde(skip_serializing_if = "Option::is_none")] - pub proposer_key: Option, + pub proposer_pubkey: Option, + /// Filter results by a builder public key + #[serde(skip_serializing_if = "Option::is_none")] + pub builder_pubkey: Option, /// How to order results #[serde(skip_serializing_if = "Option::is_none")] pub order_by: Option, @@ -231,8 +232,14 @@ impl ProposerPayloadsDeliveredQuery { } /// Sets the proposer public key - pub fn proposer_key(mut self, proposer_key: BlsPublicKey) -> Self { - self.proposer_key = Some(proposer_key); + pub fn proposer_pubkey(mut self, proposer_pubkey: BlsPublicKey) -> Self { + self.proposer_pubkey = Some(proposer_pubkey); + self + } + + /// Sets the builder public key + pub fn builder_pubkey(mut self, builder_pubkey: BlsPublicKey) -> Self { + self.builder_pubkey = Some(builder_pubkey); self } @@ -271,8 +278,8 @@ pub enum OrderBy { } /// Query for the GET `/relay/v1/data/bidtraces/builder_blocks_received` endpoint. -/// This endpoint provides BidTraces for the builder block submission for a given slot (that were -/// verified successfully). +/// This endpoint provides BidTraces for builder block submissions that match the query and were +/// verified successfully. #[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct BuilderBlocksReceivedQuery { /// A specific slot @@ -287,6 +294,9 @@ pub struct BuilderBlocksReceivedQuery { /// Search for a specific EL block number #[serde(skip_serializing_if = "Option::is_none")] pub block_number: Option, + /// Search for a specific builder public key. + #[serde(skip_serializing_if = "Option::is_none")] + pub builder_pubkey: Option, } impl BuilderBlocksReceivedQuery { @@ -313,6 +323,12 @@ impl BuilderBlocksReceivedQuery { self.block_number = Some(block_number); self } + + /// Sets the specific builder public key + pub fn builder_pubkey(mut self, builder_pubkey: BlsPublicKey) -> Self { + self.builder_pubkey = Some(builder_pubkey); + self + } } #[cfg(test)]