Add Deneb builder test & update mock builder (#4607)

* Update mock builder, mev-rs dependencies, eth2 lib to support deneb builder flow

* Replace `sharingForkTime` with `cancunTime`

* Patch `ethereum-consensus` to include some deneb-devnet-8 changes

* Add deneb builder test and fix block contents deserialization

* Fix builder bid encoding issue and passing deneb builder test \o/

* Fix test compilation

* Revert `cancunTime` change in genesis to pass doppelganger tests
This commit is contained in:
Jimmy Chen
2023-08-19 10:12:09 +10:00
committed by GitHub
parent f031a570ce
commit 4898430330
18 changed files with 440 additions and 130 deletions

View File

@@ -833,17 +833,16 @@ impl BeaconNodeHttpClient {
}
/// `POST v2/beacon/blinded_blocks`
//TODO(sean) update this along with builder updates
pub async fn post_beacon_blinded_blocks_v2<T: EthSpec>(
pub async fn post_beacon_blinded_blocks_v2<T: EthSpec, Payload: AbstractExecPayload<T>>(
&self,
block: &SignedBlindedBeaconBlock<T>,
block_contents: &SignedBlockContents<T, Payload>,
validation_level: Option<BroadcastValidation>,
) -> Result<(), Error> {
self.post_generic_with_consensus_version(
self.post_beacon_blinded_blocks_v2_path(validation_level)?,
block,
block_contents,
Some(self.timeouts.proposal),
block.message().body().fork_name(),
block_contents.signed_block().message().body().fork_name(),
)
.await?;

View File

@@ -1415,9 +1415,21 @@ impl<T: EthSpec, Payload: AbstractExecPayload<T>> ForkVersionDeserialize
D,
>(value, fork_name)?))
}
ForkName::Deneb => Ok(BlockContents::BlockAndBlobSidecars(
BeaconBlockAndBlobSidecars::deserialize_by_fork::<'de, D>(value, fork_name)?,
)),
ForkName::Deneb => {
let block_contents = match Payload::block_type() {
BlockType::Blinded => BlockContents::BlindedBlockAndBlobSidecars(
BlindedBeaconBlockAndBlobSidecars::deserialize_by_fork::<'de, D>(
value, fork_name,
)?,
),
BlockType::Full => BlockContents::BlockAndBlobSidecars(
BeaconBlockAndBlobSidecars::deserialize_by_fork::<'de, D>(
value, fork_name,
)?,
),
};
Ok(block_contents)
}
}
}
}