Fetch and sign payload envelope

This commit is contained in:
Eitan Seri- Levi
2026-02-03 19:37:09 -08:00
parent 2d321f60eb
commit 1ed80fa35d
8 changed files with 208 additions and 16 deletions

View File

@@ -403,9 +403,9 @@ pub fn get_validator_execution_payload_envelope<T: BeaconChainTypes>(
.and(chain_filter)
.then(
|slot: Slot,
// TODO(gloas) we're only doing local building
// we'll need to implement builder index logic
// eventually.
// TODO(gloas) we're only doing local building
// we'll need to implement builder index logic
// eventually.
_builder_index: u64,
accept_header: Option<Accept>,
not_synced_filter: Result<(), Rejection>,

View File

@@ -3978,8 +3978,26 @@ impl ApiTester {
.unwrap();
let envelope = envelope_response.data;
assert_eq!(envelope.beacon_block_root, block_root);
assert_eq!(envelope.slot, slot);
// Verify envelope fields match the produced block
assert_eq!(
envelope.beacon_block_root, block_root,
"Envelope beacon_block_root should match the produced block's root"
);
assert_eq!(
envelope.slot, slot,
"Envelope slot should match the block's slot"
);
assert_eq!(
envelope.builder_index,
u64::MAX,
"Builder index should be u64::MAX for local building"
);
assert_ne!(
envelope.state_root,
Hash256::ZERO,
"State root should not be zero"
);
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
}
@@ -4054,8 +4072,25 @@ impl ApiTester {
.await
.unwrap();
assert_eq!(envelope.beacon_block_root, block_root);
assert_eq!(envelope.slot, slot);
// Verify envelope fields match the produced block
assert_eq!(
envelope.beacon_block_root, block_root,
"Envelope beacon_block_root should match the produced block's root"
);
assert_eq!(
envelope.slot, slot,
"Envelope slot should match the block's slot"
);
assert_eq!(
envelope.builder_index,
u64::MAX,
"Builder index should be u64::MAX for local building"
);
assert_ne!(
envelope.state_root,
Hash256::ZERO,
"State root should not be zero"
);
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
}