Repository navigation
fix(deploy): a zkSync or Tron registry grades parity chains Predetermined - #47
Conversation
There was a problem hiding this comment.
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
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
gradeOfto returnPredeterminedwhengradedis a parity chain andregistryChainis notother, elseUnique. - 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.solNatSpec,message-flow.md,deploy/README.md, and thegradeOfdoc 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.
…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
f5d42ef to
e411810
Compare

Stacked on #45. Fixes #46.
ChainConfig.gradeOfgavePredeterminedonly 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 chainsPredetermined. Only a plain transceiver on anotherchain (EVM without Arachnid's factory) sits off the shared address and can use no parity address (#33).Rule now:
gradedisPredeterminedfromregistryChainexactly whengradedis a parity chain andregistryChainis notother; a non-parity chain isUniquein 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 revertsNoCounterpartFor.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.