mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 06:48:27 +00:00
Clean up blockv3 metadata and client (#5015)
* Improve block production v3 client * Delete wayward line * Overhaul JSON endpoint as well * Rename timeout param * Update tests * I broke everything * Ah this is an insane fix * Remove unnecessary optionals * Doc fix
This commit is contained in:
@@ -4,6 +4,7 @@ use beacon_chain::{
|
||||
test_utils::{AttestationStrategy, BlockStrategy, SyncCommitteeStrategy},
|
||||
ChainConfig,
|
||||
};
|
||||
use eth2::types::ProduceBlockV3Response;
|
||||
use eth2::types::{DepositContractData, StateId};
|
||||
use execution_layer::{ForkchoiceState, PayloadAttributes};
|
||||
use http_api::test_utils::InteractiveTester;
|
||||
@@ -21,8 +22,6 @@ use types::{
|
||||
MinimalEthSpec, ProposerPreparationData, Slot,
|
||||
};
|
||||
|
||||
use eth2::types::ForkVersionedBeaconBlockType::{Blinded, Full};
|
||||
|
||||
type E = MainnetEthSpec;
|
||||
|
||||
// Test that the deposit_contract endpoint returns the correct chain_id and address.
|
||||
@@ -113,8 +112,8 @@ async fn state_by_root_pruned_from_fork_choice() {
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
assert!(response.finalized.unwrap());
|
||||
assert!(!response.execution_optimistic.unwrap());
|
||||
assert!(response.metadata.finalized.unwrap());
|
||||
assert!(!response.metadata.execution_optimistic.unwrap());
|
||||
|
||||
let mut state = response.data;
|
||||
assert_eq!(state.update_tree_hash_cache().unwrap(), state_root);
|
||||
@@ -619,15 +618,17 @@ pub async fn proposer_boost_re_org_test(
|
||||
let randao_reveal = harness
|
||||
.sign_randao_reveal(&state_b, proposer_index, slot_c)
|
||||
.into();
|
||||
let unsigned_block_type = tester
|
||||
let (unsigned_block_type, _) = tester
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot_c, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let (unsigned_block_c, block_c_blobs) = match unsigned_block_type {
|
||||
Full(unsigned_block_contents_c) => unsigned_block_contents_c.data.deconstruct(),
|
||||
Blinded(_) => {
|
||||
let (unsigned_block_c, block_c_blobs) = match unsigned_block_type.data {
|
||||
ProduceBlockV3Response::Full(unsigned_block_contents_c) => {
|
||||
unsigned_block_contents_c.deconstruct()
|
||||
}
|
||||
ProduceBlockV3Response::Blinded(_) => {
|
||||
panic!("Should not be a blinded block");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,7 +7,9 @@ use environment::null_logger;
|
||||
use eth2::{
|
||||
mixin::{RequestAccept, ResponseForkName, ResponseOptional},
|
||||
reqwest::RequestBuilder,
|
||||
types::{BlockId as CoreBlockId, ForkChoiceNode, StateId as CoreStateId, *},
|
||||
types::{
|
||||
BlockId as CoreBlockId, ForkChoiceNode, ProduceBlockV3Response, StateId as CoreStateId, *,
|
||||
},
|
||||
BeaconNodeHttpClient, Error, StatusCode, Timeouts,
|
||||
};
|
||||
use execution_layer::test_utils::{
|
||||
@@ -38,8 +40,6 @@ use types::{
|
||||
MainnetEthSpec, RelativeEpoch, SelectionProof, SignedRoot, Slot,
|
||||
};
|
||||
|
||||
use eth2::types::ForkVersionedBeaconBlockType::{Blinded, Full};
|
||||
|
||||
type E = MainnetEthSpec;
|
||||
|
||||
const SECONDS_PER_SLOT: u64 = 12;
|
||||
@@ -655,6 +655,7 @@ impl ApiTester {
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.metadata
|
||||
.finalized
|
||||
.unwrap();
|
||||
|
||||
@@ -691,6 +692,7 @@ impl ApiTester {
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.metadata
|
||||
.finalized
|
||||
.unwrap();
|
||||
|
||||
@@ -728,6 +730,7 @@ impl ApiTester {
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.metadata
|
||||
.finalized
|
||||
.unwrap();
|
||||
|
||||
@@ -2725,52 +2728,57 @@ impl ApiTester {
|
||||
sk.sign(message).into()
|
||||
};
|
||||
|
||||
let (fork_version_response_bytes, is_blinded_payload) = self
|
||||
let (response, metadata) = self
|
||||
.client
|
||||
.get_validator_blocks_v3_ssz::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
if is_blinded_payload {
|
||||
let blinded_block = <BlindedBeaconBlock<E>>::from_ssz_bytes(
|
||||
&fork_version_response_bytes.unwrap(),
|
||||
&self.chain.spec,
|
||||
)
|
||||
.expect("block contents bytes can be decoded");
|
||||
match response {
|
||||
ProduceBlockV3Response::Blinded(blinded_block) => {
|
||||
assert!(metadata.execution_payload_blinded);
|
||||
assert_eq!(
|
||||
metadata.consensus_version,
|
||||
blinded_block.to_ref().fork_name(&self.chain.spec).unwrap()
|
||||
);
|
||||
let signed_blinded_block =
|
||||
blinded_block.sign(&sk, &fork, genesis_validators_root, &self.chain.spec);
|
||||
|
||||
let signed_blinded_block =
|
||||
blinded_block.sign(&sk, &fork, genesis_validators_root, &self.chain.spec);
|
||||
self.client
|
||||
.post_beacon_blinded_blocks_ssz(&signed_blinded_block)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
self.client
|
||||
.post_beacon_blinded_blocks_ssz(&signed_blinded_block)
|
||||
.await
|
||||
.unwrap();
|
||||
let head_block = self.chain.head_beacon_block().clone_as_blinded();
|
||||
assert_eq!(head_block, signed_blinded_block);
|
||||
|
||||
let head_block = self.chain.head_beacon_block().clone_as_blinded();
|
||||
assert_eq!(head_block, signed_blinded_block);
|
||||
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
|
||||
}
|
||||
ProduceBlockV3Response::Full(block_contents) => {
|
||||
assert!(!metadata.execution_payload_blinded);
|
||||
assert_eq!(
|
||||
metadata.consensus_version,
|
||||
block_contents
|
||||
.block()
|
||||
.to_ref()
|
||||
.fork_name(&self.chain.spec)
|
||||
.unwrap()
|
||||
);
|
||||
let signed_block_contents =
|
||||
block_contents.sign(&sk, &fork, genesis_validators_root, &self.chain.spec);
|
||||
|
||||
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
|
||||
} else {
|
||||
let block_contents = <FullBlockContents<E>>::from_ssz_bytes(
|
||||
&fork_version_response_bytes.unwrap(),
|
||||
&self.chain.spec,
|
||||
)
|
||||
.expect("block contents bytes can be decoded");
|
||||
self.client
|
||||
.post_beacon_blocks_ssz(&signed_block_contents)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let signed_block_contents =
|
||||
block_contents.sign(&sk, &fork, genesis_validators_root, &self.chain.spec);
|
||||
assert_eq!(
|
||||
self.chain.head_beacon_block().as_ref(),
|
||||
signed_block_contents.signed_block()
|
||||
);
|
||||
|
||||
self.client
|
||||
.post_beacon_blocks_ssz(&signed_block_contents)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
self.chain.head_beacon_block().as_ref(),
|
||||
signed_block_contents.signed_block()
|
||||
);
|
||||
|
||||
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
|
||||
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3543,15 +3551,17 @@ impl ApiTester {
|
||||
|
||||
let (proposer_index, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: BlindedPayload<E> = match payload_type {
|
||||
Blinded(payload) => payload.data.body().execution_payload().unwrap().into(),
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
let payload: BlindedPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(payload) => {
|
||||
payload.body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
let expected_fee_recipient = Address::from_low_u64_be(proposer_index as u64);
|
||||
@@ -3645,15 +3655,17 @@ impl ApiTester {
|
||||
|
||||
let (proposer_index, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: BlindedPayload<E> = match payload_type {
|
||||
Blinded(payload) => payload.data.body().execution_payload().unwrap().into(),
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
let payload: BlindedPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(payload) => {
|
||||
payload.body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
let expected_fee_recipient = Address::from_low_u64_be(proposer_index as u64);
|
||||
@@ -3719,15 +3731,17 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: BlindedPayload<E> = match payload_type {
|
||||
Blinded(payload) => payload.data.body().execution_payload().unwrap().into(),
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
let payload: BlindedPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(payload) => {
|
||||
payload.body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
assert_eq!(payload.fee_recipient(), test_fee_recipient);
|
||||
@@ -3807,21 +3821,17 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: FullPayload<E> = match payload_type {
|
||||
Full(payload) => payload
|
||||
.data
|
||||
.block()
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap()
|
||||
.into(),
|
||||
Blinded(_) => panic!("Expecting a blinded payload"),
|
||||
let payload: FullPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Full(payload) => {
|
||||
payload.block().body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
assert_eq!(payload.parent_hash(), expected_parent_hash);
|
||||
@@ -3897,21 +3907,17 @@ impl ApiTester {
|
||||
.unwrap();
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: FullPayload<E> = match payload_type {
|
||||
Full(payload) => payload
|
||||
.data
|
||||
.block()
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap()
|
||||
.into(),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
let payload: FullPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Full(payload) => {
|
||||
payload.block().body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
assert_eq!(payload.prev_randao(), expected_prev_randao);
|
||||
@@ -3987,21 +3993,17 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: FullPayload<E> = match payload_type {
|
||||
Full(payload) => payload
|
||||
.data
|
||||
.block()
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap()
|
||||
.into(),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
let payload: FullPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Full(payload) => {
|
||||
payload.block().body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
assert_eq!(payload.block_number(), expected_block_number);
|
||||
@@ -4075,21 +4077,17 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: FullPayload<E> = match payload_type {
|
||||
Full(payload) => payload
|
||||
.data
|
||||
.block()
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap()
|
||||
.into(),
|
||||
Blinded(_) => panic!("Expecting a blinded payload"),
|
||||
let payload: FullPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Full(payload) => {
|
||||
payload.block().body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
assert!(payload.timestamp() > min_expected_timestamp);
|
||||
@@ -4135,15 +4133,15 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4201,15 +4199,15 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4309,15 +4307,15 @@ impl ApiTester {
|
||||
.get_test_randao(next_slot, next_slot.epoch(E::slots_per_epoch()))
|
||||
.await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(next_slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Blinded(_) => (),
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(_) => (),
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
// Without proposing, advance into the next slot, this should make us cross the threshold
|
||||
@@ -4329,15 +4327,15 @@ impl ApiTester {
|
||||
.get_test_randao(next_slot, next_slot.epoch(E::slots_per_epoch()))
|
||||
.await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(next_slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4457,15 +4455,15 @@ impl ApiTester {
|
||||
.get_test_randao(next_slot, next_slot.epoch(E::slots_per_epoch()))
|
||||
.await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(next_slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
// Fill another epoch with blocks, should be enough to finalize. (Sneaky plus 1 because this
|
||||
@@ -4487,15 +4485,15 @@ impl ApiTester {
|
||||
.get_test_randao(next_slot, next_slot.epoch(E::slots_per_epoch()))
|
||||
.await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(next_slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Blinded(_) => (),
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(_) => (),
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4567,21 +4565,17 @@ impl ApiTester {
|
||||
|
||||
let (proposer_index, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let payload: FullPayload<E> = match payload_type {
|
||||
Full(payload) => payload
|
||||
.data
|
||||
.block()
|
||||
.body()
|
||||
.execution_payload()
|
||||
.unwrap()
|
||||
.into(),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
let payload: FullPayload<E> = match payload_type.data {
|
||||
ProduceBlockV3Response::Full(payload) => {
|
||||
payload.block().body().execution_payload().unwrap().into()
|
||||
}
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
let expected_fee_recipient = Address::from_low_u64_be(proposer_index as u64);
|
||||
@@ -4640,15 +4634,15 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4704,15 +4698,15 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Blinded(_) => (),
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(_) => (),
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4768,15 +4762,15 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4832,15 +4826,15 @@ impl ApiTester {
|
||||
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4894,15 +4888,15 @@ impl ApiTester {
|
||||
let epoch = self.chain.epoch().unwrap();
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let _block_contents = match payload_type {
|
||||
Blinded(payload) => payload.data,
|
||||
Full(_) => panic!("Expecting a blinded payload"),
|
||||
let _block_contents = match payload_type.data {
|
||||
ProduceBlockV3Response::Blinded(payload) => payload,
|
||||
ProduceBlockV3Response::Full(_) => panic!("Expecting a blinded payload"),
|
||||
};
|
||||
|
||||
self
|
||||
@@ -4966,15 +4960,15 @@ impl ApiTester {
|
||||
let epoch = self.chain.epoch().unwrap();
|
||||
let (_, randao_reveal) = self.get_test_randao(slot, epoch).await;
|
||||
|
||||
let payload_type = self
|
||||
let (payload_type, _) = self
|
||||
.client
|
||||
.get_validator_blocks_v3::<E>(slot, &randao_reveal, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match payload_type {
|
||||
Full(_) => (),
|
||||
Blinded(_) => panic!("Expecting a full payload"),
|
||||
match payload_type.data {
|
||||
ProduceBlockV3Response::Full(_) => (),
|
||||
ProduceBlockV3Response::Blinded(_) => panic!("Expecting a full payload"),
|
||||
};
|
||||
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user