Skip to content

test(contracts): full ADR 030 updateRegion e2e — EIP-712 + ed25519 registerNode signing harness #689

Closed

Description

@thiras

Context

PR #684 added regionPrev / regionLastChanged / updateRegion on CapacityBond per ADR 030, with a smoke test covering the cooldown branch. The full e2e — register a node with a real EIP-712 + ed25519 signature, then attest a region change — is deferred because the test harness needs the registerNode signing path, which depends on the production IEd25519Verifier (#669).

Scope

  • Build a Foundry test harness that produces valid EIP-712 + ed25519 signatures over the registerNode digest.
  • Replace the unit-level cooldown smoke test with an end-to-end flow: keygen → registerNode (signed) → updateRegion (within cooldown reverts; after cooldown succeeds; replay rejected).
  • Cover the cross-contract ejectNode path triggered when regionLastChanged falls outside the attestation window.

Dependencies

References

Activity

  1. added
    status:blocked
    kind:test
    on May 28, 2026
  2. github-actions commented on May 28, 2026

    @github-actions

    🎯 Triage report

    This is a well-scoped follow-up test task from PR #684, tracking the deferred full e2e coverage for CapacityBond.updateRegion per ADR 030. It requires building a Foundry EIP-712 + ed25519 signing harness once the production IEd25519Verifier (blocked on #669) lands, then wiring it into keygen → registerNode → updateRegion flow with cooldown, replay, and ejectNode cross-contract path coverage. Hard blocker is clearly identified; the issue will become actionable as soon as #669 closes.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Pure test-authoring work with no production contract changes
    Labels unchanged (technical, blocked, testing) Existing labels are accurate; no additions needed
    Coding agent Needs more info Scope is clear but cannot start until #669 delivers the production IEd25519Verifier; once unblocked this becomes straightforward Foundry test work suitable for an agent

    🔗 Similar issues

    💡 Notes and suggestions

    Sub-task checklist (once #669 unblocks):

    • Implement a Foundry test helper (Ed25519TestHelper or inline FFI) that generates a valid EIP-712 + ed25519 signature over the registerNode digest using a test ed25519 keypair (Rust FFI via --ffi is the standard approach here — dalek vectors can be generated in a small Rust binary and output hex for vm.ffi).
    • Replace the existing cooldown smoke test with a keygen → registerNode (signed) → updateRegion flow.
    • Assert: updateRegion within cooldown reverts.
    • Assert: updateRegion after cooldown succeeds and updates regionPrev / regionLastChanged.
    • Assert: replay of the same region update is rejected.
    • Cover the ejectNode cross-contract path when regionLastChanged falls outside the attestation window.

    Implementation notes:

    • The registerNode digest follows the pattern in StakingRegistry: keccak256(abi.encodePacked(nodeId, msg.sender, block.chainid, registrationNonce[nodeId])). Make sure the Foundry harness constructs this digest identically before signing.
    • Use vm.warp or skip() to advance time past the cooldown for the positive branch.
    • FOUNDRY_PROFILE=ci forge build --sizes --deny warnings must stay clean — pay attention to the W5740 (unreachable code) trap if any test stub always reverts with a nonReentrant modifier.
    • Pin the test helper to the same ed25519-dalek version used in feat(contracts): production IEd25519Verifier for on-chain NodeId ownership proof #669 differential KATs to avoid cross-test divergence.

    Generated by Agentic Triage for issue #689 · ● 1.6M · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. self-assigned this
    on May 30, 2026
  4. yigitdot commented on Jun 1, 2026

    @yigitdot
    Contributor

    Scope item 3 — deferral note.

    Scope item 3 ("cover the cross-contract ejectNode path triggered when regionLastChanged falls outside the attestation window") has no production implementation in the current revision. ADR 030's region-ripening predicate that reads regionPrev/regionLastChanged is not yet wired into any contract — per contracts/src/CapacityBond.sol:264-272, "no contract reads it in this revision … the ripening leg lands with the ADR 030 enforcement PR." The only cross-contract ejectNode caller that exists today is the blacklist-driven ContentBlacklist.addOperator → CapacityBond.ejectNode.

    PR #760 therefore covers that existing blacklist-driven path (and documents the deferral inline). The region-window-triggered eligibility/eject is tracked in #761 (ADR 030 enforcement); the e2e suite should be extended with the ripening-predicate assertions once that lands.

  5. added a commit that references this issue on Jun 4, 2026
    fdb69b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:testprio:mediumstatus:blocked

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions