diff --git a/Cargo.lock b/Cargo.lock index 9fdab2cb0a0b..9e32ce9be0c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1959,6 +1959,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "snowbridge-core", + "sp-core", "sp-runtime", "sp-std 8.0.0", "staging-xcm", diff --git a/cumulus/parachains/runtimes/bridge-hubs/common/src/digest_item.rs b/cumulus/parachains/runtimes/bridge-hubs/common/src/digest_item.rs index 8ea1bc05c0f2..f0be93172722 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/common/src/digest_item.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/common/src/digest_item.rs @@ -28,16 +28,6 @@ pub enum CustomDigestItem { /// Convert custom application digest item into a concrete digest item impl Into for CustomDigestItem { fn into(self) -> DigestItem { - match self { - // For snowbridge, we sidestep SCALE-encoding of `CustomDigestItem`, and insert the - // merkle root directly into the DigestItem::Other payload. This reduces complexity - // and gas costs on the Ethereum side. - // - // Other light clients can discriminate between custom digest items by checking the - // length of the encoded payload. If the length is greater than 32, then its a digest - // item inserted by some application other than Snowbridge. - CustomDigestItem::Snowbridge(merkle_root) => - DigestItem::Other(merkle_root.to_fixed_bytes().into()), - } + DigestItem::Other(self.encode()) } }