Skip to content

test: cover CCTP replay rejection in cross-chain mock#2902

Open
m0n3r0 wants to merge 2 commits into
OriginProtocol:masterfrom
m0n3r0:hermes/cctp-direct-replay-regression-20260523
Open

test: cover CCTP replay rejection in cross-chain mock#2902
m0n3r0 wants to merge 2 commits into
OriginProtocol:masterfrom
m0n3r0:hermes/cctp-direct-replay-regression-20260523

Conversation

@m0n3r0
Copy link
Copy Markdown

@m0n3r0 m0n3r0 commented May 22, 2026

Summary

This PR tightens local cross-chain CCTP test coverage by making the unit mock reject replayed encoded messages and adding a regression test for replaying an already-relayed balance update.

Changes

  • Tracks processed encoded messages in CCTPMessageTransmitterMock.
  • Adds a cross-chain test that processes a balance update once, then directly attempts to relay the same encoded CCTP message again and expects rejection.
  • Preserves existing CCTP sender/domain/finality and pending-state behavior.

Testing

  • IS_TEST=true pnpm exec hardhat test test/strategies/crosschain/cross-chain-strategy.js --grep "direct replay" --bail
  • IS_TEST=true pnpm exec hardhat test test/strategies/crosschain/cross-chain-strategy.js --grep "Should mint USDC to master strategy|direct replay|Should emit a BalanceCheckIgnored|Should fail on deposit if a previous one has not completed" --bail
  • IS_TEST=true pnpm exec hardhat test test/strategies/crosschain/cross-chain-strategy.js

Notes

Defensive regression coverage only; no sensitive vulnerability details are included.

@m0n3r0 m0n3r0 force-pushed the hermes/cctp-direct-replay-regression-20260523 branch from de49a8a to 3456ed1 Compare May 22, 2026 15:24
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.92%. Comparing base (cd7218c) to head (3456ed1).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2902      +/-   ##
==========================================
- Coverage   50.68%   41.92%   -8.77%     
==========================================
  Files         110      110              
  Lines        4873     4873              
  Branches     1353     1353              
==========================================
- Hits         2470     2043     -427     
- Misses       2399     2827     +428     
+ Partials        4        3       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant