add builder_pubkey to relay queries (#6236)

This commit is contained in:
bsh98
2024-01-26 08:55:36 -08:00
committed by GitHub
parent 0aa22466d2
commit 3043244db0

View File

@@ -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<u64>,
/// 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<BlsPublicKey>,
pub proposer_pubkey: Option<BlsPublicKey>,
/// Filter results by a builder public key
#[serde(skip_serializing_if = "Option::is_none")]
pub builder_pubkey: Option<BlsPublicKey>,
/// How to order results
#[serde(skip_serializing_if = "Option::is_none")]
pub order_by: Option<OrderBy>,
@@ -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<u64>,
/// Search for a specific builder public key.
#[serde(skip_serializing_if = "Option::is_none")]
pub builder_pubkey: Option<BlsPublicKey>,
}
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)]