Skip to content

docs: fix #40 and #43, and correct stale claims across the docs - #45

Merged
pegahcarter merged 6 commits into
mainfrom
docs/tighten-claims
Oct 6, 2026
Merged

pegahcarter merged 6 commits into
mainfrom
docs/tighten-claims

Conversation

@pegahcarter

@pegahcarter pegahcarter commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #40. Fixes #43.

#40, the provenance bar. The bar is checked in TransceiverBase._counterpartOn, so it applies to every message a transceiver sends to or accepts from a chain: a bootstrap, a receiver report, an inbound delivery. The bootstrap NatSpec, spec C19, and message-flow.md now say so. Adds the test the issue asked for, ReceiverReport.t.sol test_aReportToAHomeBelowTheBarIsRefused; disabling the bar check makes it fail.

#43, sendId. R1, the §3 override table, and OutboundBase._sendMessage's @return now say a native binding returns zero once the message is away and never its provider's own id; a binding over an ERC-7786 gateway passes that gateway's sendId on and completes or refuses a non-zero one.

Read-through. Every doc read in full and checked against the code; each claim below was wrong or stale:

  • Spec: a route is a chain's ERC-7930 identifier (Terms, R5.1, checklist); P9 names each binding's real quote (Wormhole uses Core messageFee plus Executor quoteExecution, not the deprecated Relayer); only LayerZero, CCIP, and Hyperlane price per byte (R2.3); native receivers funnel through _onMessageFrom (R3); provider setup runs before the reentrancy guard is initialized (R6.3, and ReceiverBase's NatSpec); C1/C2 state what the tests assert; C27 cited a test that no longer exists; fork tests are C11 and C29 to C31; §4.6 renumbered.
  • message-flow.md: a bare commit is 288 bytes, not 320; the inheritance diagram put ReceiverBase under OutboundBase; the registry accepts an Unknown grade and a bar of Unknown passes it.
  • encoding.md: test/vectors/ is planned, not built; three quotations no longer matched the code they cite.
  • provider-research.md: LzTransmitter calls __OAppSender_init; internal phase labels dropped; the OP Stack per-pair rationale notes its reversal (OP Stack: one registry record per provider name allows one paired L2 per chain #41).
  • todo.md: OP Stack: one registry record per provider name allows one paired L2 per chain #41 listed; all five providers' default gas named.
  • README: only CrossProxyDeployer (and forge's copy of WormholeMessage) come from Arachnid's factory, accounts from their transceiver; the N × N source is deploy/.
  • "msig" becomes "governor" in docs and NatSpec, matching the config's governorOwner. Test identifiers keep their names.

src/ changes are comments only; the deployed bytecode of all 73 src contracts is identical with and without them. 703 tests; fmt, both lint profiles, and the size check pass.

Not in this PR: the read-through found a bug in ChainConfig.gradeOf (#46), fixed separately.

The bar is checked in TransceiverBase._counterpartOn, so it applies to
every message a transceiver sends to or accepts from a chain, not only
the first: a bootstrap, a receiver report, and an inbound delivery. The
bootstrap NatSpec, spec C19, and message-flow.md said otherwise. Adds the
missing test: a report to a home graded below the bar is refused, and
the account creation reverts with it.

Fixes #40
R1, the spec's override table, and OutboundBase._sendMessage's NatSpec
said a binding returns "the gateway's sendId". That holds for a binding
over an ERC-7786 gateway (§9), but read for a native binding it means the
provider's own id, which ProviderSendSpec forbids and no binding returns.
They now say zero once the message is away, and keep the gateway case
separate.

Fixes #43
… guard order

The config field is governorOwner and the docs say governor; NatSpec said
msig. ReceiverBase said a binding configures its provider after the
reentrancy guard, but bindings configure before __ReceiverBase_init,
which initializes the guard. Comment-only: deployed bytecode of every
src contract is unchanged.
- Terms: a route is a chain's ERC-7930 identifier; provider ids live in
  ProviderChainId. R5.1 and the checklist no longer describe routes as
  provider-width codec values.
- P9 names each binding's actual quote (Wormhole: Core messageFee plus the
  Executor's quoteExecution, not the deprecated Relayer); Axelar dropped.
- R2.3: only LayerZero, CCIP, and Hyperlane price per byte.
- R3 table: native receivers funnel through _onMessageFrom.
- R6.3: provider setup runs before the reentrancy guard is initialized.
- R8.4 and §6: the shared deploy asserts the record; one source for N x N.
- §8: C1 and C2 state what the shared tests assert; C27 cites tests that
  exist; fork tests are C11 and C29 to C31; test/vectors is not built.
- §4.6 renumbered to 4.5; msig becomes governor.
- message-flow: a bare commit is 288 bytes, not 320; the inheritance
  diagram no longer puts ReceiverBase under OutboundBase; Unknown is
  accepted by the registry and passes a bar of Unknown.
- encoding: test/vectors is planned, not built; quotations match the
  code they cite.
- research: LzTransmitter calls __OAppSender_init; phase labels dropped;
  the OP Stack per-pair rationale notes its reversal (#41).
- todo: #41 listed; every provider's default gas named.
- README: only CrossProxyDeployer comes from Arachnid's factory; the N x N
  source is deploy/; msig becomes governor; OP Stack notes #41.
@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

🟢 Approval recommended

Changes are documentation, source comments (bytecode-identical), and one additive test that I verified compiles against the real APIs and correctly exercises the provenance bar, with all spot-checked doc claims and cross-references confirmed accurate.

Review effort: Balanced
Findings: None

What changed in this PR

This PR corrects stale or inaccurate documentation across the repo and closes two documentation issues. It fixes #40 (the provenance bar gates every message a transceiver sends to or accepts from a chain — bootstrap, receiver report, and inbound delivery — not just the first bootstrap) and #43 (a native binding's _sendMessage returns zero, ERC-7786's "sent", never the provider's own message id). It also sweeps the docs for stale claims (route definition, P9 quote functions, the inheritance diagram, encoding byte counts, planned-vs-built test/vectors/, OP Stack #41 caveats) and renames "msig" to "governor" in docs and source NatSpec to match the config's governorOwner. The only non-comment code change is one additive test.

Changes:

  • Corrects #40 and #43 across provider-spec.md, message-flow.md, and NatSpec; adds ReceiverReport.t.sol::test_aReportToAHomeBelowTheBarIsRefused.
  • Updates many stale doc claims (quotes, byte counts, section renumbering 4.6→4.5, C27/C19 test citations, test/vectors/ as planned).
  • Renames "msig" → "governor" in docs and src/ comments (bytecode unchanged).
File Description
contracts/​evm/​test/​ReceiverReport.t.sol New test proving a report to a home graded below the bar reverts and creates no account (verified correct, mirrors _wire).
contracts/​evm/​src/​messaging/​transceiver/​TransceiverBase.sol NatSpec: bar applies to every send/accept via _counterpartOn; msig→governor.
contracts/​evm/​src/​messaging/​outbound/​OutboundBase.sol _sendMessage @return clarifies zero/native-id semantics.
contracts/​evm/​src/​messaging/​inbound/​ReceiverBase.sol NatSpec on provider setup ordering relative to the guard/payload.
contracts/​evm/​src/​messaging/​Roles.sol, outbound/​TransmitterBase.sol msig→governor NatSpec wording.
docs/​provider-spec.md R1/R5.1/R6.3/R8.4, §3/§4.5, C1/C2/C19/C27, P9, checklist corrections.
docs/​message-flow.md 288-byte commit, inheritance diagram, Unknown-grade and bar wording.
docs/​encoding.md Marks test/vectors/ as planned; refreshes three code quotations.
docs/​provider-research.md __OAppSender_init, Core+Executor quote, OP Stack #41 notes, dropped phase labels.
docs/​todo.md Adds #41, names all five providers' default gas.
README.md Arachnid/CrossProxyDeployer wording, governor, 703 tests.

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

@pegahcarter
pegahcarter merged commit 12519e3 into main Oct 6, 2026
1 check passed
@pegahcarter
pegahcarter deleted the docs/tighten-claims branch October 6, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants