Re-issue ForkchoiceUpdate based on updated PayloadStatus (#9102)

Co-Authored-By: hopinheimer <knmanas6@gmail.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
This commit is contained in:
hopinheimer
2026-04-25 04:04:09 -04:00
committed by GitHub
parent 8a384ff445
commit df764ffa9a
14 changed files with 808 additions and 41 deletions

View File

@@ -771,6 +771,36 @@ where
.execution_block_generator()
}
/// Create a switch-to-compounding `ConsolidationRequest` for the given validator.
///
/// Panics if the validator doesn't exist, doesn't have eth1 withdrawal credentials,
/// or doesn't have an execution withdrawal address.
pub fn make_switch_to_compounding_request(
&self,
validator_index: usize,
) -> ConsolidationRequest {
let head = self.chain.canonical_head.cached_head();
let head_state = &head.snapshot.beacon_state;
let validator = head_state
.get_validator(validator_index)
.expect("validator should exist");
assert!(
validator.has_eth1_withdrawal_credential(&self.spec),
"validator {validator_index} should have eth1 withdrawal credentials"
);
let source_address = validator
.get_execution_withdrawal_address(&self.spec)
.expect("validator should have execution withdrawal address");
ConsolidationRequest {
source_address,
source_pubkey: validator.pubkey,
target_pubkey: validator.pubkey,
}
}
pub fn set_mock_builder(
&mut self,
beacon_url: SensitiveUrl,