mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-27 17:53:42 +00:00
Gloas process execution payload bid (#8355)
* add proces_execution_bid * add has_builder_withdrawal_credential * process_execution_payload_bid signature is infinity check for self-build * process_execution_payload_bid updates per consensus spec v1.6.0-beta.1 release * process_execution_bid to avoid expensive lookups for 0 amount bids * verify builder not slashed even for self-building
This commit is contained in:
@@ -513,9 +513,10 @@ pub fn process_withdrawal_requests<E: EthSpec>(
|
||||
|
||||
let validator = state.get_validator(validator_index)?;
|
||||
// Verify withdrawal credentials
|
||||
let has_correct_credential = validator.has_execution_withdrawal_credential(spec);
|
||||
let has_correct_credential =
|
||||
validator.has_execution_withdrawal_credential(spec, state.fork_name_unchecked());
|
||||
let is_correct_source_address = validator
|
||||
.get_execution_withdrawal_address(spec)
|
||||
.get_execution_withdrawal_address(spec, state.fork_name_unchecked())
|
||||
.map(|addr| addr == request.source_address)
|
||||
.unwrap_or(false);
|
||||
|
||||
@@ -560,7 +561,7 @@ pub fn process_withdrawal_requests<E: EthSpec>(
|
||||
.safe_add(pending_balance_to_withdraw)?;
|
||||
|
||||
// Only allow partial withdrawals with compounding withdrawal credentials
|
||||
if validator.has_compounding_withdrawal_credential(spec)
|
||||
if validator.has_compounding_withdrawal_credential(spec, state.fork_name_unchecked())
|
||||
&& has_sufficient_effective_balance
|
||||
&& has_excess_balance
|
||||
{
|
||||
@@ -729,7 +730,9 @@ pub fn process_consolidation_request<E: EthSpec>(
|
||||
|
||||
let source_validator = state.get_validator(source_index)?;
|
||||
// Verify the source withdrawal credentials
|
||||
if let Some(withdrawal_address) = source_validator.get_execution_withdrawal_address(spec) {
|
||||
if let Some(withdrawal_address) =
|
||||
source_validator.get_execution_withdrawal_address(spec, state.fork_name_unchecked())
|
||||
{
|
||||
if withdrawal_address != consolidation_request.source_address {
|
||||
return Ok(());
|
||||
}
|
||||
@@ -740,7 +743,7 @@ pub fn process_consolidation_request<E: EthSpec>(
|
||||
|
||||
let target_validator = state.get_validator(target_index)?;
|
||||
// Verify the target has compounding withdrawal credentials
|
||||
if !target_validator.has_compounding_withdrawal_credential(spec) {
|
||||
if !target_validator.has_compounding_withdrawal_credential(spec, state.fork_name_unchecked()) {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user