Skip to content

V2-SC-005 — Implement Canonical Module Registry and Dependency Validation #356

Description

@dDevAhmed

V2-SC-005 — Implement Canonical Module Registry and Dependency Validation

Overview

Implement a version-aware module registry that exposes the canonical suite and validates dependency compatibility.

Problem Context

Modular contracts require authoritative dependency addresses. Ad hoc constructor wiring and legacy deployment modules currently allow missing, zero, incompatible, or deprecated components.

This issue belongs to V2-EPIC-SC-001 — Canonical Contract Topology and Deployment. Existing repository issues are historical only; their titles, labels, closure state, or partial implementations do not satisfy this issue.

Technical Scope

  • Register canonical module keys, versions, interface IDs, proxy/implementation metadata, and active status.
  • Require timelocked governance for replacements and emit versioned module-change events.
  • Validate nonzero code-bearing addresses, expected interfaces, release compatibility, and forbidden legacy addresses.
  • Provide preflight views used by deployment and consumer-manifest tooling.

The contributor must begin by auditing current files that overlap this scope. Reusable logic may be retained only when it conforms to the governing V2 interfaces, events, authority boundaries, and tests. The pull request must identify reused, replaced, and deprecated paths.

Security and Integrity Requirements

  • Prevent self-registration, circular authority, and EOA module addresses.
  • Ensure a guardian cannot replace modules.
  • Make replacement atomic or fail without partially changing the suite.
  • Preserve blockchain authority and every applicable protocol invariant.
  • Do not add secrets, production credentials, dummy production addresses, backend settlement authority, or Stellar/Freighter runtime dependencies.

Required Tests

  • Registration and replacement authorization tests.
  • Interface/version mismatch tests.
  • Fuzz tests for invalid keys and addresses.
  • Atomicity test for failed multi-module activation.
  • Run the repository’s complete required Hardhat and Foundry suites and report unrelated pre-existing failures separately.
  • Add regression coverage for every defect or unsafe legacy behavior removed by this work.

Acceptance Criteria

  • All canonical modules can be resolved by stable keys.
  • Deprecated contracts cannot be activated in the canonical suite.
  • Changes are timelocked, versioned, and emitted.
  • Dependency validation is reusable by deployment checks.
  • All new and existing relevant tests pass on the final commit.
  • Static analysis and formatting introduce no new unresolved finding.
  • Documentation and generated artifacts affected by the change are current.
  • The pull request maps evidence to every acceptance criterion.

Deliverables

  • Production-quality Solidity, interfaces, libraries, deployment code, or test code required by the scope.
  • Unit and higher-level tests described above.
  • NatSpec and contract-specific technical documentation.
  • A pull-request summary covering architecture, security analysis, gas or storage impact, migration implications, and residual risks.
  • Evidence of commands run and their results.

Dependencies

  • V2-SC-001 — Define Canonical V2 Contract Interfaces
  • V2-SC-004 — Implement Versioned Protocol Configuration Registry

This issue must not be assigned while any required dependency is unresolved or incompatible with the reviewed interface version.

Non-Goals

  • Deploying the complete module suite.
  • Providing an unrestricted service locator to external callers.
  • Creating, modifying, reopening, or relabelling historical GitHub issues.
  • Applying the external Stellar Wave label.

Complexity and Review

  • Complexity: high
  • Repository: DigiNodes/truthbounty-contract
  • Risk: protocol-critical
  • Required review: human maintainer review; automatic merge is prohibited
  • Candidate state: wave-candidate

References

  • Protocol specification §§5, 18, 26, 28
  • TruthBounty Protocol V2 Specification
  • TruthBounty V2 Engineering Blueprint
  • ADR-0001 — Canonical V2 Contract Topology
  • Drips Stellar Wave Operations

🏷 Labels

  • contracts
  • architecture
  • protocol-critical
  • web3
  • complexity-high
  • wave-candidate
  • registry
  • governance
  • security

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions