Skip to content

Commit

Permalink
Fix failing payload_invalidation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Jun 28, 2022
1 parent 7b7b356 commit 2296643
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
24 changes: 11 additions & 13 deletions beacon_node/beacon_chain/tests/payload_invalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,14 +980,14 @@ async fn payload_preparation() {
let fee_recipient = Address::repeat_byte(99);

// Provide preparation data to the EL for `proposer`.
el.update_proposer_preparation_blocking(
el.update_proposer_preparation(
Epoch::new(1),
&[ProposerPreparationData {
validator_index: proposer as u64,
fee_recipient,
}],
)
.unwrap();
.await;

rig.harness
.chain
Expand Down Expand Up @@ -1082,16 +1082,14 @@ async fn payload_preparation_before_transition_block() {
let el = rig.execution_layer();

let head = rig.harness.chain.head().unwrap();
let head_execution_status = rig
.harness
.chain
.canonical_head
.read()
.head_execution_status()
.unwrap();
assert_eq!(
head_execution_status.block_hash(),
Some(ExecutionBlockHash::zero()),
head.beacon_block
.message()
.body()
.execution_payload()
.unwrap()
.block_hash(),
ExecutionBlockHash::zero(),
"the head block is post-bellatrix but pre-transition"
);

Expand All @@ -1104,14 +1102,14 @@ async fn payload_preparation_before_transition_block() {
let fee_recipient = Address::repeat_byte(99);

// Provide preparation data to the EL for `proposer`.
el.update_proposer_preparation_blocking(
el.update_proposer_preparation(
Epoch::new(0),
&[ProposerPreparationData {
validator_index: proposer as u64,
fee_recipient,
}],
)
.unwrap();
.await;

rig.move_to_terminal_block();

Expand Down
14 changes: 1 addition & 13 deletions beacon_node/execution_layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,7 @@ impl ExecutionLayer {
}

/// Updates the proposer preparation data provided by validators
pub fn update_proposer_preparation_blocking(
&self,
update_epoch: Epoch,
preparation_data: &[ProposerPreparationData],
) -> Result<(), Error> {
self.block_on_generic(|_| async move {
self.update_proposer_preparation(update_epoch, preparation_data)
.await
})
}

/// Updates the proposer preparation data provided by validators
async fn update_proposer_preparation(
pub async fn update_proposer_preparation(
&self,
update_epoch: Epoch,
preparation_data: &[ProposerPreparationData],
Expand Down

0 comments on commit 2296643

Please sign in to comment.