fix: chainspec ttd check (#1285)

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Roman Krasiuk
2023-02-11 22:49:01 +02:00
committed by GitHub
parent 4b0acce957
commit eba63b8f77
13 changed files with 73 additions and 24 deletions

View File

@ -161,7 +161,8 @@ impl<Client: HeaderProvider + BlockProvider + StateProvider> EngineApi<Client> {
}))
};
if !self.chain_spec.fork(Hardfork::Paris).active_at_ttd(parent_td) {
// Short circuit the check by passing parent total difficulty.
if !self.chain_spec.fork(Hardfork::Paris).active_at_ttd(parent_td, U256::ZERO) {
return Ok(PayloadStatus::from_status(PayloadStatusEnum::Invalid {
validation_error: EngineApiError::PayloadPreMerge.to_string(),
}))