Skip to content

fix(deploy): a zkSync or Tron registry grades parity chains Predetermined - #47

Merged
pegahcarter merged 2 commits into
mainfrom
fix/grade-rule
Oct 6, 2026
Merged

pegahcarter merged 2 commits into
mainfrom
fix/grade-rule

Conversation

@pegahcarter

Copy link
Copy Markdown
Contributor

Stacked on #45. Fixes #46.

ChainConfig.gradeOf gave Predetermined only between two parity chains. A zkSync or Tron transceiver finds a parity chain's transceiver from the provider's deployment record (DivergentTransceiver._parityAddress → predictTransceiver), so its registry is meant to grade parity chains Predetermined. Only a plain transceiver on an other chain (EVM without Arachnid's factory) sits off the shared address and can use no parity address (#33).

Rule now: graded is Predetermined from registryChain exactly when graded is a parity chain and registryChain is not other; a non-parity chain is Unique in every registry, its own included.

Impact of the old rule: a grade is write-once, and a zkSync or Tron registry configured from it would grade the governor's home Unique, so that chain's transceivers could never be born configured. Production scripts were unaffected, since they deploy only to parity chains.

Tests:

  • test_aParityChainIsPredeterminedFromAnyChainButOther: all 16 derivation pairs against an explicit table, replacing a test that asserted the old rule.
  • ConfiguredGradesBornConfigureTest: a zkSync transceiver born against the grade the configuration gives its home. Under the old rule it reverts NoCounterpartFor.

Both fail with the old rule restored. Provenance.sol's NatSpec (comment only), message-flow.md, and the adding-a-chain guide now state the rule the same way. 704 tests; fmt, both lint profiles, and the size check pass.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 08:01
@pegahcarter
pegahcarter added this pull request to stack #48 October 6, 2026 08:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The deploy/README.md grade table's parity row "Graded by others" cell still reflects the old rule and is now inconsistent with the updated zkSync/Tron rows and the new gradeOf logic.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR fixes a bug in the deploy-time helper ChainConfig.gradeOf. The old rule graded a chain Predetermined only between two parity chains, so a zkSync or Tron registry would grade Ethereum/Base (and every parity chain) Unique. That contradicts the contracts: a zkSync/Tron transceiver resolves a parity chain's counterpart from the provider's deployment record (DivergentTransceiver._parityAddress → predictTransceiver), which requires the parity chain to be graded Predetermined. Because a grade is write-once, following the old configuration on zkSync/Tron would have permanently graded the governor's home Unique, making those chains' transceivers unable to be born configured. Production scripts were unaffected since they deploy only to parity chains.

Changes:

  • Rewrites gradeOf to return Predetermined when graded is a parity chain and registryChain is not other, else Unique.
  • Replaces the old parity-only test with a full 16-pair derivation table and adds ConfiguredGradesBornConfigureTest, which born-configures a zkSync transceiver against the grade the configuration gives its home.
  • Updates the rule's description across Provenance.sol NatSpec, message-flow.md, deploy/README.md, and the gradeOf doc comment; bumps the README test count to 704.
File Description
contracts/​evm/​script/​deploy/​ChainConfig.sol Core fix: new gradeOf rule and updated NatSpec.
contracts/​evm/​test/​deploy/​ChainConfig.t.sol New 16-pair grade table test plus a zkSync born-configure test.
contracts/​evm/​src/​registry/​Provenance.sol Comment-only NatSpec update to state the new rule.
docs/​message-flow.md Prose update describing how a parity address is known on zkSync/Tron.
contracts/​evm/​deploy/​README.md Derivation-table and paragraph updates; parity row "Graded by others" cell left stale.
README.md Test count 703 → 704.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread contracts/evm/deploy/README.md Outdated
Base automatically changed from docs/tighten-claims to main October 6, 2026 08:13
…ined

ChainConfig.gradeOf gave Predetermined only between two parity chains.
A zkSync or Tron transceiver finds a parity chain's transceiver from the
provider's deployment record (DivergentTransceiver._parityAddress), so
its registry grades parity chains Predetermined; only a plain transceiver
on an `other` chain cannot. Under the old rule a zkSync transceiver could
never be born accepting the governor's home, and a grade is write-once.

Tests: every derivation pair against an explicit table, and a zkSync
transceiver born against the grade the configuration gives its home;
both fail under the old rule. Provenance's NatSpec, message-flow.md, and
the adding-a-chain guide state the rule the same way.

Fixes #46
@pegahcarter
pegahcarter merged commit 15281d3 into main Oct 6, 2026
1 check passed
@pegahcarter
pegahcarter deleted the fix/grade-rule branch October 6, 2026 08:15
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.

ChainConfig.gradeOf grades parity chains Unique from zkSync and Tron registries

2 participants