Skip to content

Feat/contract spec revalidation - #486

Merged
OxDev-max merged 3 commits into
Refract-Protocol:mainfrom
oscar24357:feat/contract-spec-revalidation
Oct 23, 2026
Merged

OxDev-max merged 3 commits into
Refract-Protocol:mainfrom
oscar24357:feat/contract-spec-revalidation

Conversation

@oscar24357

Copy link
Copy Markdown
Contributor

closes #284

oscar24357 and others added 3 commits October 22, 2026 18:21
…ting

- Add oracle_providers, provider_keys, provider_revocations, provider_key_rotations tables (migration 004)
- src/oracle/providers/credentials.ts: key types, generateRawKey, hashKey, verifyKey
- src/oracle/providers/credential.repository.ts: all DB access for provider lifecycle
- src/oracle/providers/provider-credential.service.ts: revocation, rotation with overlap window, forensic report, trust-status surface
- src/oracle/providers/provider-key.guard.ts: submission-boundary guard rejecting revoked keys
- src/oracle/providers/ops-provider.controller.ts: admin endpoints for revoke, reverse-revocation, rotate, complete-rotation, trust-status
- src/oracle/providers/provider-credentials.module.ts: NestJS module wiring
- src/oracle/providers/provider-credentials.spec.ts: tests for revoked-key rejection, overlap-window rotation, forensic report, accidental-revocation reversal

Closes acceptance criteria: revocation record with reason/actor/timestamp/sequence, submission boundary rejection, affected-consensus report, overlap-window rotation, trust-status surface, reversible revocations.
…ff report

- Add ContractSpecRevalidator: revalidates pool + oracle contract specs on
  configurable interval (default 300s) and on-demand via admin API
- Reuses startup validatePoolContractSpec/parseContractSpec so startup and
  runtime checks cannot drift apart
- Three states: valid / mismatch / unknown (RPC unavailable != mismatch)
- assertPublicationAllowed() / assertSettlementAllowed() gates for
  OraclePublisherService and ClaimSettlementService
- Block persisted in control_plane_flags Postgres table -- survives restarts
- Block clears only after successful revalidation or explicit operator
  override (reason + actor recorded, alerted)
- Structured FunctionDiff report (added/removed/changed + expected/actual)
  exposed via GET /ops/contracts/diff-report
- Admin endpoints: revalidate, override, override/clear, diff-report
- Migration 005: control_plane_flags table
- DbModule created so DbService is injectable across modules
- Spec covers: mismatch blocks + alert, RPC error -> unknown, restart
  persistence, diff-report correctness, operator override
…revalidation

# Conflicts:
#	src/db/db.module.ts
#	src/stellar/stellar.module.ts
@OxDev-max
OxDev-max merged commit b13bb61 into Refract-Protocol:main Oct 23, 2026
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.

Revalidate the RefractOracle and Pool Contract Interfaces at Runtime After On-Chain Upgrades

2 participants