Files
safe-wallet/packages/utils/jest.integration.config.js
aa1610490d feat(safenet): verify attestations against the coordinator group key (#8469)
Part 6 of the read-layer sequence, completing the reader started in the
previous slice. Answers one question: does FROST verification wire to the
chain correctly, and when do we stop reading?

- SafenetReader.loadGroupKey — getEpochGroupId(epoch) → coordinator
  groupKey(groupId), cached by epoch (the epoch→group binding is immutable
  once staged). An epoch the coordinator has not seen REVERTS rather than
  returning zeros, and an off-curve response is rejected before it can be
  cached — both surface as retryable PENDING, never terminal INVALID, and a
  failed fetch is never cached.
- SafenetReader.verifyAttestation — derives each path's EIP-712 preimage
  from the event it decoded (oracle vs plain are different preimages, and
  the domain chainId is the Safenet chain, not the event's Safe chain), so
  callers cannot pair the wrong hash with the wrong attestation. Verified
  against BOTH checked-in captures: the devnet oracle-path golden and the
  live Gnosis beta plain-path golden — the only path beta emits.
- computePollingInterval — fast (6s) until the effective deadline (the
  on-chain deadline block, or PLAIN_DEADLINE_BLOCKS past the first observed
  event on the plain path, which never emits one — without the substitute a
  never-attested check would poll a public RPC forever), slow (30s) through
  a ~1h late window (a late BENIGN can still replace TIMED_OUT), then stop;
  0 = stopped, RTK Query's pollingInterval convention.
- Coordinator discovery via getCoordinator() is dropped: the config always
  carries the coordinator address, so the unused fragment leaves the ABI.
- Opt-in *.integration.test.ts runs only under yarn test:integration
  against a live devnet and self-skips with instructions when
  SAFENET_IT_RPC is unset; excluded from the default jest config.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-07 12:08:52 +02:00

16 lines
570 B
JavaScript

const preset = require('../../config/test/presets/jest-preset')
/**
* Opt-in integration config: runs only `*.integration.test.ts` in a node
* environment against a live Safenet network (sim :8546 / devnet :8547) selected
* by `SAFENET_IT_RPC`. Excluded from the default config and from turbo — invoke
* explicitly with `yarn test:integration`. Specs self-skip (with a clear message)
* when `SAFENET_IT_RPC` is unset.
*/
module.exports = {
...preset,
testEnvironment: 'node',
testMatch: ['<rootDir>/**/*.integration.test.ts'],
collectCoverage: false,
}