mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-02 04:03:35 +00:00
Removed withdrawals feature flag
This commit is contained in:
@@ -72,4 +72,3 @@ arbitrary-fuzz = [
|
||||
"swap_or_not_shuffle/arbitrary",
|
||||
"tree_hash/arbitrary",
|
||||
]
|
||||
withdrawals = []
|
||||
|
||||
@@ -502,7 +502,6 @@ impl<T: EthSpec, Payload: AbstractExecPayload<T>> EmptyBlock for BeaconBlockCape
|
||||
voluntary_exits: VariableList::empty(),
|
||||
sync_aggregate: SyncAggregate::empty(),
|
||||
execution_payload: Payload::Capella::default(),
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes: VariableList::empty(),
|
||||
},
|
||||
}
|
||||
@@ -532,7 +531,6 @@ impl<T: EthSpec, Payload: AbstractExecPayload<T>> EmptyBlock for BeaconBlockEip4
|
||||
voluntary_exits: VariableList::empty(),
|
||||
sync_aggregate: SyncAggregate::empty(),
|
||||
execution_payload: Payload::Eip4844::default(),
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes: VariableList::empty(),
|
||||
blob_kzg_commitments: VariableList::empty(),
|
||||
},
|
||||
|
||||
@@ -62,7 +62,6 @@ pub struct BeaconBlockBody<T: EthSpec, Payload: AbstractExecPayload<T> = FullPay
|
||||
#[superstruct(only(Eip4844), partial_getter(rename = "execution_payload_eip4844"))]
|
||||
#[serde(flatten)]
|
||||
pub execution_payload: Payload::Eip4844,
|
||||
#[cfg(feature = "withdrawals")]
|
||||
#[superstruct(only(Capella, Eip4844))]
|
||||
pub bls_to_execution_changes:
|
||||
VariableList<SignedBlsToExecutionChange, T::MaxBlsToExecutionChanges>,
|
||||
@@ -301,7 +300,6 @@ impl<E: EthSpec> From<BeaconBlockBodyCapella<E, FullPayload<E>>>
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: FullPayloadCapella { execution_payload },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
} = body;
|
||||
|
||||
@@ -319,7 +317,6 @@ impl<E: EthSpec> From<BeaconBlockBodyCapella<E, FullPayload<E>>>
|
||||
execution_payload: BlindedPayloadCapella {
|
||||
execution_payload_header: From::from(execution_payload.clone()),
|
||||
},
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
},
|
||||
Some(execution_payload),
|
||||
@@ -345,7 +342,6 @@ impl<E: EthSpec> From<BeaconBlockBodyEip4844<E, FullPayload<E>>>
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: FullPayloadEip4844 { execution_payload },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
blob_kzg_commitments,
|
||||
} = body;
|
||||
@@ -364,7 +360,6 @@ impl<E: EthSpec> From<BeaconBlockBodyEip4844<E, FullPayload<E>>>
|
||||
execution_payload: BlindedPayloadEip4844 {
|
||||
execution_payload_header: From::from(execution_payload.clone()),
|
||||
},
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
blob_kzg_commitments,
|
||||
},
|
||||
@@ -433,7 +428,6 @@ impl<E: EthSpec> BeaconBlockBodyCapella<E, FullPayload<E>> {
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: FullPayloadCapella { execution_payload },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
} = self;
|
||||
|
||||
@@ -450,7 +444,6 @@ impl<E: EthSpec> BeaconBlockBodyCapella<E, FullPayload<E>> {
|
||||
execution_payload: BlindedPayloadCapella {
|
||||
execution_payload_header: From::from(execution_payload.clone()),
|
||||
},
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes: bls_to_execution_changes.clone(),
|
||||
}
|
||||
}
|
||||
@@ -469,7 +462,6 @@ impl<E: EthSpec> BeaconBlockBodyEip4844<E, FullPayload<E>> {
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: FullPayloadEip4844 { execution_payload },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
blob_kzg_commitments,
|
||||
} = self;
|
||||
@@ -487,7 +479,6 @@ impl<E: EthSpec> BeaconBlockBodyEip4844<E, FullPayload<E>> {
|
||||
execution_payload: BlindedPayloadEip4844 {
|
||||
execution_payload_header: From::from(execution_payload.clone()),
|
||||
},
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes: bls_to_execution_changes.clone(),
|
||||
blob_kzg_commitments: blob_kzg_commitments.clone(),
|
||||
}
|
||||
|
||||
@@ -297,10 +297,8 @@ where
|
||||
pub latest_execution_payload_header: ExecutionPayloadHeaderEip4844<T>,
|
||||
|
||||
// Withdrawals
|
||||
#[cfg(feature = "withdrawals")]
|
||||
#[superstruct(only(Capella, Eip4844), partial_getter(copy))]
|
||||
pub next_withdrawal_index: u64,
|
||||
#[cfg(feature = "withdrawals")]
|
||||
#[superstruct(only(Capella, Eip4844), partial_getter(copy))]
|
||||
pub next_withdrawal_validator_index: u64,
|
||||
|
||||
|
||||
@@ -336,11 +336,9 @@ impl<T: EthSpec> BeaconTreeHashCacheInner<T> {
|
||||
}
|
||||
|
||||
// Withdrawal indices (Capella and later).
|
||||
#[cfg(feature = "withdrawals")]
|
||||
if let Ok(next_withdrawal_index) = state.next_withdrawal_index() {
|
||||
hasher.write(next_withdrawal_index.tree_hash_root().as_bytes())?;
|
||||
}
|
||||
#[cfg(feature = "withdrawals")]
|
||||
if let Ok(next_withdrawal_validator_index) = state.next_withdrawal_validator_index() {
|
||||
hasher.write(next_withdrawal_validator_index.tree_hash_root().as_bytes())?;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ pub struct ExecutionPayload<T: EthSpec> {
|
||||
pub block_hash: ExecutionBlockHash,
|
||||
#[serde(with = "ssz_types::serde_utils::list_of_hex_var_list")]
|
||||
pub transactions: Transactions<T>,
|
||||
#[cfg(feature = "withdrawals")]
|
||||
#[superstruct(only(Capella, Eip4844))]
|
||||
pub withdrawals: Withdrawals<T>,
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ pub struct ExecutionPayloadHeader<T: EthSpec> {
|
||||
pub block_hash: ExecutionBlockHash,
|
||||
#[superstruct(getter(copy))]
|
||||
pub transactions_root: Hash256,
|
||||
#[cfg(feature = "withdrawals")]
|
||||
#[superstruct(only(Capella, Eip4844))]
|
||||
#[superstruct(getter(copy))]
|
||||
pub withdrawals_root: Hash256,
|
||||
@@ -128,7 +127,6 @@ impl<T: EthSpec> ExecutionPayloadHeaderMerge<T> {
|
||||
base_fee_per_gas: self.base_fee_per_gas,
|
||||
block_hash: self.block_hash,
|
||||
transactions_root: self.transactions_root,
|
||||
#[cfg(feature = "withdrawals")]
|
||||
withdrawals_root: Hash256::zero(),
|
||||
}
|
||||
}
|
||||
@@ -153,7 +151,6 @@ impl<T: EthSpec> ExecutionPayloadHeaderCapella<T> {
|
||||
excess_data_gas: Uint256::zero(),
|
||||
block_hash: self.block_hash,
|
||||
transactions_root: self.transactions_root,
|
||||
#[cfg(feature = "withdrawals")]
|
||||
withdrawals_root: self.withdrawals_root,
|
||||
}
|
||||
}
|
||||
@@ -196,7 +193,6 @@ impl<T: EthSpec> From<ExecutionPayloadCapella<T>> for ExecutionPayloadHeaderCape
|
||||
base_fee_per_gas: payload.base_fee_per_gas,
|
||||
block_hash: payload.block_hash,
|
||||
transactions_root: payload.transactions.tree_hash_root(),
|
||||
#[cfg(feature = "withdrawals")]
|
||||
withdrawals_root: payload.withdrawals.tree_hash_root(),
|
||||
}
|
||||
}
|
||||
@@ -219,7 +215,6 @@ impl<T: EthSpec> From<ExecutionPayloadEip4844<T>> for ExecutionPayloadHeaderEip4
|
||||
excess_data_gas: payload.excess_data_gas,
|
||||
block_hash: payload.block_hash,
|
||||
transactions_root: payload.transactions.tree_hash_root(),
|
||||
#[cfg(feature = "withdrawals")]
|
||||
withdrawals_root: payload.withdrawals.tree_hash_root(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ pub trait ExecPayload<T: EthSpec>: Debug + Clone + PartialEq + Hash + TreeHash +
|
||||
fn gas_limit(&self) -> u64;
|
||||
fn transactions(&self) -> Option<&Transactions<T>>;
|
||||
/// fork-specific fields
|
||||
#[cfg(feature = "withdrawals")]
|
||||
fn withdrawals_root(&self) -> Result<Hash256, Error>;
|
||||
|
||||
/// Is this a default payload with 0x0 roots for transactions and withdrawals?
|
||||
@@ -241,7 +240,6 @@ impl<T: EthSpec> ExecPayload<T> for FullPayload<T> {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(feature = "withdrawals")]
|
||||
fn withdrawals_root(&self) -> Result<Hash256, Error> {
|
||||
match self {
|
||||
FullPayload::Merge(_) => Err(Error::IncorrectStateVariant),
|
||||
@@ -343,7 +341,6 @@ impl<'b, T: EthSpec> ExecPayload<T> for FullPayloadRef<'b, T> {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(feature = "withdrawals")]
|
||||
fn withdrawals_root(&self) -> Result<Hash256, Error> {
|
||||
match self {
|
||||
FullPayloadRef::Merge(_) => Err(Error::IncorrectStateVariant),
|
||||
@@ -523,7 +520,6 @@ impl<T: EthSpec> ExecPayload<T> for BlindedPayload<T> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(feature = "withdrawals")]
|
||||
fn withdrawals_root(&self) -> Result<Hash256, Error> {
|
||||
match self {
|
||||
BlindedPayload::Merge(_) => Err(Error::IncorrectStateVariant),
|
||||
@@ -614,7 +610,6 @@ impl<'b, T: EthSpec> ExecPayload<T> for BlindedPayloadRef<'b, T> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(feature = "withdrawals")]
|
||||
fn withdrawals_root(&self) -> Result<Hash256, Error> {
|
||||
match self {
|
||||
BlindedPayloadRef::Merge(_) => Err(Error::IncorrectStateVariant),
|
||||
@@ -712,7 +707,6 @@ macro_rules! impl_exec_payload_common {
|
||||
f(self)
|
||||
}
|
||||
|
||||
#[cfg(feature = "withdrawals")]
|
||||
fn withdrawals_root(&self) -> Result<Hash256, Error> {
|
||||
let g = $g;
|
||||
g(self)
|
||||
|
||||
@@ -341,7 +341,6 @@ impl<E: EthSpec> SignedBeaconBlockCapella<E, BlindedPayload<E>> {
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: BlindedPayloadCapella { .. },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
},
|
||||
},
|
||||
@@ -364,7 +363,6 @@ impl<E: EthSpec> SignedBeaconBlockCapella<E, BlindedPayload<E>> {
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: FullPayloadCapella { execution_payload },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
},
|
||||
},
|
||||
@@ -397,7 +395,6 @@ impl<E: EthSpec> SignedBeaconBlockEip4844<E, BlindedPayload<E>> {
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: BlindedPayloadEip4844 { .. },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
blob_kzg_commitments,
|
||||
},
|
||||
@@ -421,7 +418,6 @@ impl<E: EthSpec> SignedBeaconBlockEip4844<E, BlindedPayload<E>> {
|
||||
voluntary_exits,
|
||||
sync_aggregate,
|
||||
execution_payload: FullPayloadEip4844 { execution_payload },
|
||||
#[cfg(feature = "withdrawals")]
|
||||
bls_to_execution_changes,
|
||||
blob_kzg_commitments,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user