From b3dab76aec773fa55d59dc7234447b63514c6e62 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 7 Dec 2023 12:03:31 +0000 Subject: [PATCH] Add flag to disable check header hash --- contracts/near/eth-types/Cargo.toml | 3 ++- contracts/near/eth-types/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/near/eth-types/Cargo.toml b/contracts/near/eth-types/Cargo.toml index 868c2c46..43f2b59a 100644 --- a/contracts/near/eth-types/Cargo.toml +++ b/contracts/near/eth-types/Cargo.toml @@ -28,4 +28,5 @@ sha3 = "0.10.0" [features] default = ["eth2"] -eth2 = ["dep:eth2_ssz", "dep:eth2_ssz_derive", "dep:tree_hash", "dep:tree_hash_derive", "dep:eth2_serde_utils"] \ No newline at end of file +eth2 = ["dep:eth2_ssz", "dep:eth2_ssz_derive", "dep:tree_hash", "dep:tree_hash_derive", "dep:eth2_serde_utils"] +disable_check_header_hash = [] diff --git a/contracts/near/eth-types/src/lib.rs b/contracts/near/eth-types/src/lib.rs index c2fb72f6..be8b9fc4 100644 --- a/contracts/near/eth-types/src/lib.rs +++ b/contracts/near/eth-types/src/lib.rs @@ -272,6 +272,7 @@ impl RlpDecodable for BlockHeader { .into(), ); + #[cfg(not(feature = "disable_check_header_hash"))] if block_header.hash.unwrap() != near_keccak256(serialized.as_raw()).into() { return Err(RlpDecoderError::RlpInconsistentLengthAndData); }