mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
Resolve merge confklicts
This commit is contained in:
@@ -58,6 +58,7 @@ pub const V4: EndpointVersion = EndpointVersion(4);
|
||||
pub const CONSENSUS_VERSION_HEADER: &str = "Eth-Consensus-Version";
|
||||
pub const EXECUTION_PAYLOAD_BLINDED_HEADER: &str = "Eth-Execution-Payload-Blinded";
|
||||
pub const EXECUTION_PAYLOAD_VALUE_HEADER: &str = "Eth-Execution-Payload-Value";
|
||||
pub const EXECUTION_PAYLOAD_INCLUDED_HEADER: &str = "Eth-Execution-Payload-Included";
|
||||
pub const CONSENSUS_BLOCK_VALUE_HEADER: &str = "Eth-Consensus-Block-Value";
|
||||
|
||||
pub const CONTENT_TYPE_HEADER: &str = "Content-Type";
|
||||
@@ -2582,12 +2583,14 @@ impl BeaconNodeHttpClient {
|
||||
}
|
||||
|
||||
/// returns `GET v4/validator/blocks/{slot}` URL path
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn get_validator_blocks_v4_path(
|
||||
&self,
|
||||
slot: Slot,
|
||||
randao_reveal: &SignatureBytes,
|
||||
graffiti: Option<&Graffiti>,
|
||||
skip_randao_verification: SkipRandaoVerification,
|
||||
include_payload: Option<bool>,
|
||||
builder_booster_factor: Option<u64>,
|
||||
graffiti_policy: Option<GraffitiPolicy>,
|
||||
) -> Result<Url, Error> {
|
||||
@@ -2612,6 +2615,11 @@ impl BeaconNodeHttpClient {
|
||||
.append_pair("skip_randao_verification", "");
|
||||
}
|
||||
|
||||
if let Some(include_payload) = include_payload {
|
||||
path.query_pairs_mut()
|
||||
.append_pair("include_payload", &include_payload.to_string());
|
||||
}
|
||||
|
||||
if let Some(builder_booster_factor) = builder_booster_factor {
|
||||
path.query_pairs_mut()
|
||||
.append_pair("builder_boost_factor", &builder_booster_factor.to_string());
|
||||
@@ -2631,6 +2639,7 @@ impl BeaconNodeHttpClient {
|
||||
slot: Slot,
|
||||
randao_reveal: &SignatureBytes,
|
||||
graffiti: Option<&Graffiti>,
|
||||
include_payload: Option<bool>,
|
||||
builder_booster_factor: Option<u64>,
|
||||
graffiti_policy: Option<GraffitiPolicy>,
|
||||
) -> Result<
|
||||
@@ -2645,6 +2654,7 @@ impl BeaconNodeHttpClient {
|
||||
randao_reveal,
|
||||
graffiti,
|
||||
SkipRandaoVerification::No,
|
||||
include_payload,
|
||||
builder_booster_factor,
|
||||
graffiti_policy,
|
||||
)
|
||||
@@ -2652,12 +2662,14 @@ impl BeaconNodeHttpClient {
|
||||
}
|
||||
|
||||
/// `GET v4/validator/blocks/{slot}`
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn get_validator_blocks_v4_modular<E: EthSpec>(
|
||||
&self,
|
||||
slot: Slot,
|
||||
randao_reveal: &SignatureBytes,
|
||||
graffiti: Option<&Graffiti>,
|
||||
skip_randao_verification: SkipRandaoVerification,
|
||||
include_payload: Option<bool>,
|
||||
builder_booster_factor: Option<u64>,
|
||||
graffiti_policy: Option<GraffitiPolicy>,
|
||||
) -> Result<
|
||||
@@ -2673,6 +2685,7 @@ impl BeaconNodeHttpClient {
|
||||
randao_reveal,
|
||||
graffiti,
|
||||
skip_randao_verification,
|
||||
include_payload,
|
||||
builder_booster_factor,
|
||||
graffiti_policy,
|
||||
)
|
||||
@@ -2703,6 +2716,7 @@ impl BeaconNodeHttpClient {
|
||||
slot: Slot,
|
||||
randao_reveal: &SignatureBytes,
|
||||
graffiti: Option<&Graffiti>,
|
||||
include_payload: Option<bool>,
|
||||
builder_booster_factor: Option<u64>,
|
||||
graffiti_policy: Option<GraffitiPolicy>,
|
||||
) -> Result<(BeaconBlock<E>, ProduceBlockV4Metadata), Error> {
|
||||
@@ -2711,6 +2725,7 @@ impl BeaconNodeHttpClient {
|
||||
randao_reveal,
|
||||
graffiti,
|
||||
SkipRandaoVerification::No,
|
||||
include_payload,
|
||||
builder_booster_factor,
|
||||
graffiti_policy,
|
||||
)
|
||||
@@ -2718,12 +2733,14 @@ impl BeaconNodeHttpClient {
|
||||
}
|
||||
|
||||
/// `GET v4/validator/blocks/{slot}` in ssz format
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn get_validator_blocks_v4_modular_ssz<E: EthSpec>(
|
||||
&self,
|
||||
slot: Slot,
|
||||
randao_reveal: &SignatureBytes,
|
||||
graffiti: Option<&Graffiti>,
|
||||
skip_randao_verification: SkipRandaoVerification,
|
||||
include_payload: Option<bool>,
|
||||
builder_booster_factor: Option<u64>,
|
||||
graffiti_policy: Option<GraffitiPolicy>,
|
||||
) -> Result<(BeaconBlock<E>, ProduceBlockV4Metadata), Error> {
|
||||
@@ -2733,6 +2750,7 @@ impl BeaconNodeHttpClient {
|
||||
randao_reveal,
|
||||
graffiti,
|
||||
skip_randao_verification,
|
||||
include_payload,
|
||||
builder_booster_factor,
|
||||
graffiti_policy,
|
||||
)
|
||||
@@ -2762,11 +2780,10 @@ impl BeaconNodeHttpClient {
|
||||
opt_response.ok_or(Error::StatusCode(StatusCode::NOT_FOUND))
|
||||
}
|
||||
|
||||
/// `GET v1/validator/execution_payload_envelope/{slot}/{builder_index}`
|
||||
/// `GET v1/validator/execution_payload_envelope/{slot}`
|
||||
pub async fn get_validator_execution_payload_envelope<E: EthSpec>(
|
||||
&self,
|
||||
slot: Slot,
|
||||
builder_index: u64,
|
||||
) -> Result<ForkVersionedResponse<ExecutionPayloadEnvelope<E>>, Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
@@ -2774,17 +2791,15 @@ impl BeaconNodeHttpClient {
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("validator")
|
||||
.push("execution_payload_envelope")
|
||||
.push(&slot.to_string())
|
||||
.push(&builder_index.to_string());
|
||||
.push(&slot.to_string());
|
||||
|
||||
self.get(path).await
|
||||
}
|
||||
|
||||
/// `GET v1/validator/execution_payload_envelope/{slot}/{builder_index}` in SSZ format
|
||||
/// `GET v1/validator/execution_payload_envelope/{slot}` in SSZ format
|
||||
pub async fn get_validator_execution_payload_envelope_ssz<E: EthSpec>(
|
||||
&self,
|
||||
slot: Slot,
|
||||
builder_index: u64,
|
||||
fork_name: ForkName,
|
||||
) -> Result<ExecutionPayloadEnvelope<E>, Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
@@ -2793,8 +2808,7 @@ impl BeaconNodeHttpClient {
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("validator")
|
||||
.push("execution_payload_envelope")
|
||||
.push(&slot.to_string())
|
||||
.push(&builder_index.to_string());
|
||||
.push(&slot.to_string());
|
||||
|
||||
let opt_response = self
|
||||
.get_bytes_opt_accept_header(path, Accept::Ssz, self.timeouts.get_validator_block)
|
||||
|
||||
@@ -5,7 +5,7 @@ pub use types::*;
|
||||
|
||||
use crate::{
|
||||
CONSENSUS_BLOCK_VALUE_HEADER, CONSENSUS_VERSION_HEADER, EXECUTION_PAYLOAD_BLINDED_HEADER,
|
||||
EXECUTION_PAYLOAD_VALUE_HEADER, Error as ServerError,
|
||||
EXECUTION_PAYLOAD_INCLUDED_HEADER, EXECUTION_PAYLOAD_VALUE_HEADER, Error as ServerError,
|
||||
};
|
||||
use bls::{PublicKeyBytes, SecretKey, Signature, SignatureBytes};
|
||||
use context_deserialize::ContextDeserialize;
|
||||
@@ -778,6 +778,7 @@ pub struct ValidatorBlocksQuery {
|
||||
pub randao_reveal: SignatureBytes,
|
||||
pub graffiti: Option<Graffiti>,
|
||||
pub skip_randao_verification: SkipRandaoVerification,
|
||||
pub include_payload: Option<bool>,
|
||||
pub builder_boost_factor: Option<u64>,
|
||||
pub graffiti_policy: Option<GraffitiPolicy>,
|
||||
}
|
||||
@@ -1874,6 +1875,7 @@ pub struct ProduceBlockV4Metadata {
|
||||
pub consensus_version: ForkName,
|
||||
#[serde(with = "serde_utils::u256_dec")]
|
||||
pub consensus_block_value: Uint256,
|
||||
pub execution_payload_included: bool,
|
||||
}
|
||||
|
||||
impl<E: EthSpec> FullBlockContents<E> {
|
||||
@@ -2047,10 +2049,16 @@ impl TryFrom<&HeaderMap> for ProduceBlockV4Metadata {
|
||||
Uint256::from_str_radix(s, 10)
|
||||
.map_err(|e| format!("invalid {CONSENSUS_BLOCK_VALUE_HEADER}: {e:?}"))
|
||||
})?;
|
||||
let execution_payload_included =
|
||||
parse_required_header(headers, EXECUTION_PAYLOAD_INCLUDED_HEADER, |s| {
|
||||
s.parse::<bool>()
|
||||
.map_err(|e| format!("invalid {EXECUTION_PAYLOAD_INCLUDED_HEADER}: {e:?}"))
|
||||
})?;
|
||||
|
||||
Ok(ProduceBlockV4Metadata {
|
||||
consensus_version,
|
||||
consensus_block_value,
|
||||
execution_payload_included,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user