Skip to content

test(integration-matrix): expect the chain mismatch error from cross-chain ACP decrypts - #484

Open
erhnysr wants to merge 1 commit into
FhenixProtocol:masterfrom
erhnysr:fix/matrix-cross-chain-acp-tests
Open

erhnysr wants to merge 1 commit into
FhenixProtocol:masterfrom
erhnysr:fix/matrix-cross-chain-acp-tests

Conversation

@erhnysr

@erhnysr erhnysr commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Matrix (Hardhat Mock) has failed on every master push since #409 (first red run at 800cdb3, still red at 5b3e61c). The same two React tests time out after 90 s:

  • react-read-contracts.web.test.tsx › decryption follows the read's chain: decrypted with the pinned chain's ACP
  • react-decrypt-chain-key.web.test.tsx › the same ctHash decrypted on two chains is two cache entries, each keyed by its chain

Both play "another chain" as a second chain id (31338) over the same Anvil, and register the ACP signed on 31337 under the 31338 slot. Since #409 the decrypt builders refuse that ACP before anything is sent:

decryptForView: builder chainId (31338) does not match ACP signed chainId (31337)

so the value the tests wait for never arrives. What they asserted (the pinned chain's decrypt succeeds with an ACP signed for another chain) is what #409 now rejects on purpose.

Change

Tests only. Each test now asserts the fail-fast and keeps what it was written to check:

  • read-contracts: the decrypt is still built for the pinned chain and resolves the pinned slot's ACP (the error names both 31338 and 31337), and no value is shown.
  • decrypt-chain-key: chain B still gets its own cache entry (two entries, keyed by chain id), holds the mismatch error, and never shows chain A's plaintext.

No changeset: @cofhe/integration-matrix is private.

Verification

I reproduced the Matrix (Hardhat Mock) job (same setup steps and versions, MATRIX_CHAIN=hardhat) on my fork's runners:

commit result
4418149 (parent of #409) pass
800cdb3 (#409), b70a067, ddd7026, 5b3e61c fail, only these two tests
5b3e61c + this commit pass, React suite 25/25

prettier --check passes on the changed files. Matrix (Hardhat Mock) does not run for PRs from forks, so its result shows again on master after merge.


Note

Low Risk
Test-only changes with no production code; they align CI with intentional decrypt builder validation from #409.

Overview
Updates two React integration tests that were timing out after #409 started fail-fast rejecting decrypts when the builder’s chainId does not match the ACP’s signed chain.

In react-decrypt-chain-key.web.test.tsx, chain B no longer expects plaintext 42; it asserts the mismatch error, an empty value, and still two per-chain decrypt cache entries. The helper renders a dedicated error output, and the file comment documents that a chain-A ACP in chain B’s slot is refused before network I/O.

In react-read-contracts.web.test.tsx, the pinned-chain decrypt test is retitled and now expects the same builder vs ACP chainId error and no decrypted value, with a comment that the old behavior silently decrypted on the connected chain.

Reviewed by Cursor Bugbot for commit 1d08b55. Bugbot is set up for automated code reviews on this repo. Configure here.

…chain ACP decrypts

FhenixProtocol#409 made decryptForView and decryptForTx refuse an ACP signed for a
different chain than the builder's. Two React tests decrypt on a second
chain id over the same Anvil using an ACP signed for the first, so on
master they now wait out their 90 s timeout with a ChainIdMismatch
error on screen, and Matrix (Hardhat Mock) has failed since FhenixProtocol#409.

Assert that error instead: the decrypt is still built for the pinned
chain and resolves the pinned slot's ACP, the second chain still gets
its own cache entry, and it never shows the first chain's plaintext.
@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1d08b55

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T19:49:55.129201Z
We couldn’t complete this review. Comment @codex review to try again.
1d08b55 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

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