Skip to content

Commit

Permalink
Add flag to disable check header hash
Browse files Browse the repository at this point in the history
  • Loading branch information
karim-en committed Dec 7, 2023
1 parent 92e6ccc commit b3dab76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/near/eth-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
eth2 = ["dep:eth2_ssz", "dep:eth2_ssz_derive", "dep:tree_hash", "dep:tree_hash_derive", "dep:eth2_serde_utils"]
disable_check_header_hash = []
1 change: 1 addition & 0 deletions contracts/near/eth-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b3dab76

Please sign in to comment.