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
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