mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 04:44:28 +00:00
additional updates per pr review
This commit is contained in:
@@ -439,7 +439,7 @@ impl<E: EthSpec> MockBuilder<E> {
|
|||||||
block: SignedBlindedBeaconBlock<E>,
|
block: SignedBlindedBeaconBlock<E>,
|
||||||
) -> Result<FullPayloadContents<E>, String> {
|
) -> Result<FullPayloadContents<E>, String> {
|
||||||
let root = match &block {
|
let root = match &block {
|
||||||
SignedBlindedBeaconBlock::Base(_) | SignedBlindedBeaconBlock::Altair(_) => {
|
SignedBlindedBeaconBlock::Base(_) | types::SignedBeaconBlock::Altair(_) => {
|
||||||
return Err("invalid fork".to_string());
|
return Err("invalid fork".to_string());
|
||||||
}
|
}
|
||||||
SignedBlindedBeaconBlock::Bellatrix(block) => {
|
SignedBlindedBeaconBlock::Bellatrix(block) => {
|
||||||
@@ -846,10 +846,6 @@ impl<E: EthSpec> MockBuilder<E> {
|
|||||||
// first to avoid polluting the execution block generator with invalid payload attributes
|
// first to avoid polluting the execution block generator with invalid payload attributes
|
||||||
// NOTE: this was part of an effort to add payload attribute uniqueness checks,
|
// NOTE: this was part of an effort to add payload attribute uniqueness checks,
|
||||||
// which was abandoned because it broke too many tests in subtle ways.
|
// which was abandoned because it broke too many tests in subtle ways.
|
||||||
ForkName::Gloas => {
|
|
||||||
// TODO(EIP7732) Check if this is how we want to do error handling for gloas
|
|
||||||
return Err("invalid fork".to_string());
|
|
||||||
}
|
|
||||||
ForkName::Bellatrix | ForkName::Capella => PayloadAttributes::new(
|
ForkName::Bellatrix | ForkName::Capella => PayloadAttributes::new(
|
||||||
timestamp,
|
timestamp,
|
||||||
*prev_randao,
|
*prev_randao,
|
||||||
@@ -857,11 +853,16 @@ impl<E: EthSpec> MockBuilder<E> {
|
|||||||
expected_withdrawals,
|
expected_withdrawals,
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
ForkName::Deneb
|
ForkName::Deneb | ForkName::Electra | ForkName::Fulu | ForkName::Gloas => {
|
||||||
| ForkName::Electra
|
PayloadAttributes::new(
|
||||||
| ForkName::Fulu
|
timestamp,
|
||||||
| ForkName::Base
|
*prev_randao,
|
||||||
| ForkName::Altair => {
|
fee_recipient,
|
||||||
|
expected_withdrawals,
|
||||||
|
Some(head_block_root),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
ForkName::Base | ForkName::Altair => {
|
||||||
return Err("invalid fork".to_string());
|
return Err("invalid fork".to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -167,9 +167,6 @@ where
|
|||||||
#[superstruct(only(Gloas))]
|
#[superstruct(only(Gloas))]
|
||||||
pub latest_block_hash: ExecutionBlockHash,
|
pub latest_block_hash: ExecutionBlockHash,
|
||||||
|
|
||||||
#[superstruct(only(Gloas))]
|
|
||||||
pub latest_full_slot: Slot,
|
|
||||||
|
|
||||||
#[superstruct(only(Gloas))]
|
#[superstruct(only(Gloas))]
|
||||||
pub latest_withdrawals_root: Hash256,
|
pub latest_withdrawals_root: Hash256,
|
||||||
}
|
}
|
||||||
@@ -500,7 +497,6 @@ impl<E: EthSpec> TryInto<BeaconState<E>> for PartialBeaconState<E> {
|
|||||||
builder_pending_payments,
|
builder_pending_payments,
|
||||||
builder_pending_withdrawals,
|
builder_pending_withdrawals,
|
||||||
latest_block_hash,
|
latest_block_hash,
|
||||||
latest_full_slot,
|
|
||||||
latest_withdrawals_root
|
latest_withdrawals_root
|
||||||
],
|
],
|
||||||
[historical_summaries]
|
[historical_summaries]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use bls::Hash256;
|
use bls::Hash256;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use types::{
|
use types::{
|
||||||
BeaconState, BeaconStateError as Error, BeaconStateGloas, BitVector, ChainSpec, EthSpec,
|
BeaconState, BeaconStateError as Error, BeaconStateGloas, BitVector, BuilderPendingPayment,
|
||||||
ExecutionBid, Fork, List, Vector,
|
ChainSpec, EthSpec, ExecutionBid, Fork, List, Vector,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Transform a `Fulu` state into a `Gloas` state.
|
/// Transform a `Fulu` state into a `Gloas` state.
|
||||||
@@ -85,10 +85,12 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
|
|||||||
pending_consolidations: pre.pending_consolidations.clone(),
|
pending_consolidations: pre.pending_consolidations.clone(),
|
||||||
// Gloas
|
// Gloas
|
||||||
execution_payload_availability: BitVector::default(), // All bits set to false initially
|
execution_payload_availability: BitVector::default(), // All bits set to false initially
|
||||||
builder_pending_payments: Vector::default(), // Empty vector initially,
|
builder_pending_payments: Vector::new(vec![
|
||||||
|
BuilderPendingPayment::default();
|
||||||
|
2 * E::slots_per_epoch() as usize
|
||||||
|
])?,
|
||||||
builder_pending_withdrawals: List::default(), // Empty list initially,
|
builder_pending_withdrawals: List::default(), // Empty list initially,
|
||||||
latest_block_hash: pre.latest_execution_payload_header.block_hash,
|
latest_block_hash: pre.latest_execution_payload_header.block_hash,
|
||||||
latest_full_slot: pre.slot,
|
|
||||||
latest_withdrawals_root: Hash256::default(),
|
latest_withdrawals_root: Hash256::default(),
|
||||||
// Caches
|
// Caches
|
||||||
total_active_balance: pre.total_active_balance,
|
total_active_balance: pre.total_active_balance,
|
||||||
|
|||||||
@@ -597,11 +597,6 @@ where
|
|||||||
#[metastruct(exclude_from(tree_lists))]
|
#[metastruct(exclude_from(tree_lists))]
|
||||||
pub latest_block_hash: ExecutionBlockHash,
|
pub latest_block_hash: ExecutionBlockHash,
|
||||||
|
|
||||||
#[test_random(default)]
|
|
||||||
#[superstruct(only(Gloas))]
|
|
||||||
#[metastruct(exclude_from(tree_lists))]
|
|
||||||
pub latest_full_slot: Slot,
|
|
||||||
|
|
||||||
#[test_random(default)]
|
#[test_random(default)]
|
||||||
#[superstruct(only(Gloas))]
|
#[superstruct(only(Gloas))]
|
||||||
#[metastruct(exclude_from(tree_lists))]
|
#[metastruct(exclude_from(tree_lists))]
|
||||||
|
|||||||
Reference in New Issue
Block a user