Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions validator_client/validator_services/src/block_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,13 +740,9 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> BlockService<S, T> {
None
}
None => {
// A Gloas block always carries a bid; not finding one here is a wiring bug.
// Skip the envelope step rather than chase an envelope that cannot exist.
warn!(
slot = slot.as_u64(),
"Produced Gloas block has no readable payload bid; skipping envelope"
);
None
return Err(BlockError::Recoverable(
"Gloas block response is missing its execution payload bid".to_string(),
));
}
}
} else {
Expand Down Expand Up @@ -967,7 +963,7 @@ mod tests {
use super::*;
use slot_clock::ManualSlotClock;
use std::time::Duration;
use types::{BeaconBlock, ExecutionPayloadEnvelope, ForkName, Slot};
use types::{BeaconBlock, ExecutionPayloadEnvelope, ForkName, MainnetEthSpec, Slot};
use validator_test_rig::validator_client_harness::{S, ValidatorClientHarness};

#[tokio::test]
Expand Down Expand Up @@ -1216,6 +1212,40 @@ mod tests {
mock_post_envelope.expect(0).assert();
}

#[tokio::test]
async fn non_gloas_block_response_is_not_published() {
let mut test_harness = TestHarness::new_with_validators(1).await;

let slot = Slot::new(1);
let validator_pubkey = test_harness.harness.pubkeys[0];
let mut pre_gloas_spec = test_harness.harness.spec.as_ref().clone();
pre_gloas_spec.gloas_fork_epoch = None;
let block = BeaconBlock::empty(&pre_gloas_spec);
let response_fork = pre_gloas_spec.fork_name_at_slot::<MainnetEthSpec>(slot);
assert!(block.body().signed_execution_payload_bid().is_err());

test_harness
.harness
.mock_beacon_node_1
.mock_post_validator_blocks_v4_ssz(&block, response_fork, slot);
let mock_post_block = test_harness
.harness
.mock_beacon_node_1
.mock_post_beacon_blocks_v2_ssz(ForkName::Gloas);

let result = test_harness
.service
.clone()
.get_validator_block_and_publish_block(slot, validator_pubkey, None)
.await;

let Err(BlockError::Recoverable(msg)) = result else {
panic!("Expected Recoverable error, got: {result:?}");
};
assert!(msg.contains("Gloas block response is missing its execution payload bid"));
mock_post_block.expect(0).assert();
}

#[tokio::test]
async fn get_validator_block_and_publish_block_fails() {
let mut test_harness = TestHarness::new_with_validators(1).await;
Expand Down
Loading