<!-- canonical: https://0xsimao.com/findings/fuji-finance-handler-store-hash-messages -->

# ConnextHandler can store the hash of the failed messages instead

Low/Info · Three Sigma · Lending aggregator · 6th May, 2023

Finding 3S-FUJI-N05 of the Fuji Finance security review.

- Report: /reports/fuji-finance
- Source: https://cdn.sanity.io/files/qoqld077/staging/32181a28eac3175d15fb8924d249bb0d91ca350c.pdf

---

### Description

Storing the failed message itself is very expensive.

### Recommendation

Store the hash and then when calling executeFailedWithUpdatedArgs(...) send the txn
as an argument and match it against the stored hash.

### Status

Acknowledged with the following statement:
The optimization identified is acknowledged by the Fuji team. During Q3 the team will be
working on optimizations that will improve the router contracts.

---

Related findings:

- [Adapters could store the index instead of true in the `VaultV2` to remove the O(n) search](https://0xsimao.com/findings/morpho-vault-v2-adapters-store-index-search): Morpho Vault V2
