hyperlane-monorepo icon indicating copy to clipboard operation
hyperlane-monorepo copied to clipboard

feat(contracts): add nonce for monotonically increasing delivery ordering for `HypERC4626`

Open aroralanuk opened this issue 1 year ago • 2 comments

Description

  • Added a rateUpdateNonce in HypERC4626Collateral and previousNonce in HypERC4626 to ensure we only update the exchangeRate on the synthetic asset if the update was after the last recorded update. This is to make sure we don't update it to a stale exchange rate which may cause losses to users using the synthetic asset.

Drive-by changes

  • processInboundMessage in MockMailbox` to simulate processing of messages out of order.

Related issues

  • fixes https://github.com/chainlight-io/2024-08-hyperlane/issues/12

Backward compatibility

Yes

Testing

Unit test

aroralanuk avatar Sep 20 '24 08:09 aroralanuk

🦋 Changeset detected

Latest commit: 8a57266dd8e0a44dc00d96009a85af817a320167

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@hyperlane-xyz/core Patch
@hyperlane-xyz/helloworld Patch
@hyperlane-xyz/sdk Patch
@hyperlane-xyz/infra Patch
@hyperlane-xyz/cli Patch
@hyperlane-xyz/widgets Patch
@hyperlane-xyz/ccip-server Patch
@hyperlane-xyz/github-proxy Patch
@hyperlane-xyz/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Sep 20 '24 08:09 changeset-bot[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.43%. Comparing base (daa9cbc) to head (8a57266). Report is 118 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4534      +/-   ##
==========================================
+ Coverage   81.37%   81.43%   +0.06%     
==========================================
  Files         100      100              
  Lines        1412     1417       +5     
  Branches      178      179       +1     
==========================================
+ Hits         1149     1154       +5     
  Misses        263      263              
Components Coverage Δ
core 96.92% <ø> (ø)
hooks 82.38% <ø> (ø)
isms 92.47% <ø> (ø)
token 93.28% <100.00%> (+0.23%) :arrow_up:
middlewares 86.52% <ø> (ø)

codecov[bot] avatar Sep 25 '24 06:09 codecov[bot]