Skip to content

Commit 6bbc7b5

Browse files
authored
revert: aggregation ISM verify change (#8417) (#8451)
1 parent 56bd9a2 commit 6bbc7b5

1 file changed

Lines changed: 0 additions & 62 deletions

File tree

rust/main/chains/hyperlane-ethereum/src/ism/interchain_security_module.rs

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ where
126126
message: &HyperlaneMessage,
127127
metadata: &Metadata,
128128
) -> ChainResult<Option<U256>> {
129-
// Null-type ISMs (e.g. TrustedRelayerIsm) check post-delivery state (e.g.
130-
// mailbox.processor()), so verify() always returns false pre-delivery. Assign
131-
// gas cost 0 so they are always preferred over heavier sub-ISMs in aggregation.
132-
if self.module_type().await? == ModuleType::Null {
133-
return Ok(Some(U256::zero()));
134-
}
135129
let mut tx = self.contract.verify(
136130
metadata.to_owned().into(),
137131
RawHyperlaneMessage::from(message).to_vec().into(),
@@ -152,62 +146,6 @@ where
152146
}
153147
}
154148

155-
#[cfg(test)]
156-
mod test {
157-
use std::sync::Arc;
158-
159-
use ethers::providers::{MockProvider, Provider};
160-
use ethers_core::{abi, types::Bytes};
161-
use hyperlane_core::{
162-
ContractLocator, HyperlaneDomain, HyperlaneMessage, InterchainSecurityModule,
163-
KnownHyperlaneDomain, Metadata, ModuleType, H256, U256,
164-
};
165-
166-
use super::EthereumInterchainSecurityModule;
167-
168-
fn get_test_ism(
169-
domain: HyperlaneDomain,
170-
) -> (
171-
EthereumInterchainSecurityModule<Provider<Arc<MockProvider>>>,
172-
Arc<MockProvider>,
173-
) {
174-
let mock_provider = Arc::new(MockProvider::new());
175-
let provider = Arc::new(Provider::new(mock_provider.clone()));
176-
let ism = EthereumInterchainSecurityModule::new(
177-
provider,
178-
&ContractLocator {
179-
domain: &domain,
180-
// Address doesn't matter because we're using a MockProvider
181-
address: H256::default(),
182-
},
183-
);
184-
(ism, mock_provider)
185-
}
186-
187-
/// Verifies that dry_run_verify returns Ok(Some(U256::zero())) for Null-type ISMs
188-
/// (e.g. TrustedRelayerIsm) without calling verify(), since verify() always returns
189-
/// false pre-delivery (mailbox.processor() state check).
190-
#[tokio::test]
191-
async fn test_dry_run_verify_null_ism_returns_zero_gas() {
192-
let domain = HyperlaneDomain::Known(KnownHyperlaneDomain::Ethereum);
193-
let (ism, mock_provider) = get_test_ism(domain);
194-
195-
// MockProvider responses are LIFO — only module_type() is called; verify() is not.
196-
// ABI-encode uint8(6) = ModuleType::Null as a 32-byte padded value.
197-
let encoded = Bytes::from(abi::encode(&[abi::Token::Uint(
198-
(ModuleType::Null as u8).into(),
199-
)]));
200-
mock_provider.push::<Bytes, _>(encoded).unwrap();
201-
202-
let result = ism
203-
.dry_run_verify(&HyperlaneMessage::default(), &Metadata::new(vec![]))
204-
.await
205-
.unwrap();
206-
207-
assert_eq!(result, Some(U256::zero()));
208-
}
209-
}
210-
211149
pub struct EthereumInterchainSecurityModuleAbi;
212150

213151
impl HyperlaneAbi for EthereumInterchainSecurityModuleAbi {

0 commit comments

Comments
 (0)