Skip to content

docs(LibRainDeploy): drop the return name from supportedNetworks' NatSpec - #124

Merged
thedavidmeister merged 3 commits into
mainfrom
2026-08-15-issue-50-supportednetworks-named-return
Aug 16, 2026
Merged

docs(LibRainDeploy): drop the return name from supportedNetworks' NatSpec#124
thedavidmeister merged 3 commits into
mainfrom
2026-08-15-issue-50-supportednetworks-named-return

Conversation

@thedavidmeister

@thedavidmeisterthedavidmeister commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Closes#50

The defect

supportedNetworks carried /// @return networks The list of supported network names. above function supportedNetworks() internal pure returns (string[] memory)
— an unnamed return. networks was therefore not a return-parameter name at
all: solc only checks an @return <name> against a declared name, so with none
declared it silently folded networks into the description text and the
generated docs read "networks The list of supported network names."

That is the whole finding. Issue 50 carries it twice — LIBDEPLOY-09
(dimension 4) and D3-08 (dimension 3), independently raised, same defect,
severity INFO both times.

The fix, and why this direction

There are exactly two ways to make the tag and the signature agree: add the name
to the signature, or remove it from the tag. This repo does not name return
values, so the name comes out of the tag.

 /// Returns the list of networks currently supported by Rain deployments.
- /// @return networks The list of supported network names.+ /// @return The list of supported network names.
function supportedNetworks() internal pure returns (string[] memory) {

One comment line against main. The signature, the local
string[] memory networks and the explicit return networks; are all
untouched.

This is the form the same file already uses 39 lines up:
zoltuAddress (src/lib/LibRainDeploy.sol:210-211) documents its unnamed return
as /// @return The address the creation code deploys to. Issue 50's own text
names that as the correct handling of an unnamed return — it cites zoltuAddress
as the file's example of getting this right, not as the outlier.

What an unnamed return buys, and what naming it would have cost. solc warns
"unnamed return variable can remain unassigned" on a path that reaches the
closing brace without a return. A named return has no such warning: it silently
returns the type's zero value. That is not hypothetical in this repo —
#103 exists because
suiteNames()'s named return was assigned only inside a loop, so an empty input
returned "" with nothing to flag it. Its remedy is a bare names = ""; seed
whose own QA records the mutant as SURVIVED: a line no test can kill,
because the path it protects is unreachable from anywhere the tests can stand.
The org rule is that a named return must be locally provable; keeping the
return unnamed here means there is nothing to prove, and the compiler keeps
doing the proving on every future edit to this body.

Naming the return would also have deleted return networks; — the statement
that makes the function's exit value visible at the point of exit — in exchange
for nothing a caller can observe.

Note on this branch's history

The first commit on this branch (9fa7433) applied the fix in the other
direction: it named the return and dropped the local and the explicit return.
That direction was rejected — we do not name return values — so 03b2a23
reverts that code edit and fixes the docstring instead. The branch's net diff
against main is the single comment line shown above; the two commits are
retained rather than force-rewritten so the rejected direction stays on the
record.

QA

  • Discriminating tests: none, and none is possible. The change is one
    NatSpec comment. It produces byte-identical bytecode, is invisible at every
    call site (src/abstract/RainDeployBroadcast.sol,
    src/abstract/RainDeployVerifyChain.sol and the test sites all consume the
    returned array positionally), and no test can observe a comment. A test that
    could fail on base would mean this was a behaviour change, which it is not.
    Stating that plainly rather than inventing a test.
  • Mutations applied: none, for the same reason — there is no line of code in
    this diff to mutate. The function body is unchanged from main, so its
    existing coverage (testSupportedNetworks, test/src/lib/LibRainDeploy.t.sol,
    pinning length 5 and every element against the library constants) applies to
    it unmodified and was neither weakened nor duplicated.
  • Oracle: independent of this diff. (a) solc's own rule — an @return <name>
    is checked only against a declared return-parameter name, so an unnamed
    return makes the tag's first word description text, which is exactly what the
    issue reports. (b) The file's own correct instance of the unnamed form,
    zoltuAddress at 210-211, which is the shape this change copies. (c) The
    user's standing ruling that return values are not named in this org, which is
    what selects between the two otherwise-equivalent repairs.
  • Category check: issue 50 asks for one thing — make the NatSpec and the
    signature agree — under two finding IDs with the same proposed fix. Both are
    closed. The issue's proposed diff is deliberately not applied, because it
    picks the named-return direction; the defect it identifies is fixed the other
    way. Every other @return in the file was re-read while doing this and each
    one already agrees with its signature (isStartBlock 112/113,
    findDeployBlock 157/159, deployZoltu 222/223, deployToNetworks 418/419,
    deployAndBroadcast 510/511 all name a declared return; zoltuAddress
    210/211 documents an unnamed one with no name), so no adjacent NatSpec was
    touched.

Verification

  • main merged in (not rebased); no conflicts.
  • nix develop -c forge fmt --check — clean, exit 0.
  • nix develop -c forge test with all five RPC endpoints set — 251 passed, 0
    failed, 0 skipped
    across 18 suites, fork tests included. Exit 0.

🤖 Generated with Claude Code

…already documents
The `@return networks` tag sat above a signature whose return was unnamed, so
`networks` was never a return-parameter name — solc had nothing to check it
against and folded it into the description text. The name already existed in
the body as a local, built and returned explicitly, so it was present
everywhere except where it is checkable.
Naming the return closes that gap. The body is a single straight-line block
assigning `networks` on the only path to the function end, so the named return
is locally provable and the explicit `return networks;` is redundant. This
matches the form the rest of the file already uses.
Returned value and compiled behaviour are unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeisterthedavidmeister self-assigned this Aug 15, 2026
@coderabbitai

coderabbitaiBot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, you've reached your PR review limit, so we couldn't start this review.

Next review available in:47 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cee272e7-6e7e-4d63-8d6a-78a5e8ec14e6

📥 Commits

Reviewing files that changed from the base of the PR and between 369cfe9 and 03b2a23.

📒 Files selected for processing (1)
  • src/lib/LibRainDeploy.sol

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thedavidmeister

Copy link
Copy Markdown
ContributorAuthor

@coderabbitai review

@coderabbitai

coderabbitaiBot commented Aug 15, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

thedavidmeisterand others added 2 commits August 16, 2026 13:15
…atSpec
`/// @return networks` sat above `returns (string[] memory)` — unnamed — so
`networks` was never a return-parameter name, solc had nothing to check it
against, and the word was folded into the description text. Two forms close
that gap: name the return, or drop the name from the tag.
Drop it. `zoltuAddress` (src/lib/LibRainDeploy.sol:210-211) already documents
its unnamed return as `/// @return The address the creation code deploys to.`,
and issue 50's own text calls that form correct. This repo does not name return
values: an unnamed return keeps solc's "unnamed return variable can remain
unassigned" diagnostic, which naming it gives up — see
#103, where the remedy for a
named return's silent default is a line no test can kill.
The signature, the local `string[] memory networks` and the explicit
`return networks;` are unchanged. This reverts the code edit made earlier on
this branch and fixes the docstring instead; the net change against `main` is
one comment line.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeisterthedavidmeister changed the title docs(LibRainDeploy): name the supportedNetworks return its NatSpec already documentsdocs(LibRainDeploy): drop the return name from supportedNetworks' NatSpecAug 16, 2026
@thedavidmeister

Copy link
Copy Markdown
ContributorAuthor

Reviewed 03b2a23: ready — the fix now points the
other way, and the net change against main is one comment line.

What changed since the last head

9fa7433 had named the return (returns (string[] memory networks)) and
deleted the local declaration and the explicit return networks;. That
direction is rejected: this repo does not name return values.03b2a23
reverts that code edit and repairs the docstring instead. The two commits are
kept rather than force-rewritten so the rejected direction stays on the record.

git diff origin/main at this head, in full:

--- a/src/lib/LibRainDeploy.sol+++ b/src/lib/LibRainDeploy.sol@@ -246,7 +246,7 @@ library LibRainDeploy {
}
/// Returns the list of networks currently supported by Rain deployments.
- /// @return networks The list of supported network names.+ /// @return The list of supported network names.
function supportedNetworks() internal pure returns (string[] memory) {
string[] memory networks = new string[](5);
networks[0] = ARBITRUM_ONE;

1 file changed, 1 insertion(+), 1 deletion(-). The signature, the local
string[] memory networks and the explicit return networks; are byte-identical
to main.

Why this closes #50 rather than dodging it

Both findings on that issue — LIBDEPLOY-09 (dimension 4) and D3-08
(dimension 3) — report one thing: solc checks an @return <name> only against a
declared return-parameter name, so with the return unnamed, networks was
never a name at all and was folded into the description text. Removing the word
makes the tag agree with the signature exactly as surely as adding it to the
signature would have. The tag now reads as documentation of an unnamed return,
which is what the function has.

It is also the form the same file already uses, 39 lines up:
src/lib/LibRainDeploy.sol:210-211, zoltuAddress, documents its unnamed
return as /// @return The address the creation code deploys to. Issue 50's own
text cites zoltuAddress as the file's example of getting this right. The
issue's proposed diff picks the other repair; the defect it identifies is
fixed, the diff it suggests is not applied, and that is deliberate.

Checked the rest of the file's @return tags while here — isStartBlock
(112/113), findDeployBlock (157/159), deployZoltu (222/223),
deployToNetworks (418/419), deployAndBroadcast (510/511) each name a
declared return, and zoltuAddress (210/211) documents an unnamed one with no
name. No other mismatch, so no adjacent NatSpec touched. grep for
@return networks across src/, test/, script/ and the markdown returns
nothing.

The point of keeping it unnamed

solc emits "Unnamed return variable can remain unassigned" for a body that can
reach its closing brace without a return. A named return has no equivalent
diagnostic — it silently returns the type's zero value. That is not theoretical
here: #103 exists because
suiteNames()'s named return was assigned only inside a loop, so an empty input
returned "" with nothing to flag it, and its remedy is a bare names = "";
seed that PR's own QA records as a SURVIVED mutant — a line no test can
kill, because the path it guards is unreachable from anywhere a test can stand.
Leaving supportedNetworks unnamed means there is nothing to prove, and the
compiler keeps proving it on every future edit to this body.

QA

  • Discriminating tests: none, and none is possible — stating that rather
    than inventing one. The diff is a single NatSpec comment. Bytecode is
    byte-identical, and every caller (src/abstract/RainDeployBroadcast.sol,
    src/abstract/RainDeployVerifyChain.sol, and the test sites) consumes the
    array positionally, so there is nothing a test could observe. A test that
    failed on base would mean this was a behaviour change, which it is not.
  • Mutations: none applied, because this diff contains no line of code to
    mutate — the function body is unchanged from main. Its existing coverage,
    testSupportedNetworks (test/src/lib/LibRainDeploy.t.sol, pins length 5 and
    each element against the library constants) plus
    testSupportedNetworksAreFullyConfigured, applies unmodified and was neither
    weakened nor duplicated. Both are [PASS] in the run below.
  • Oracle: independent of the diff. (a) solc's rule on when an @return
    name is checkable. (b) zoltuAddress at 210-211, the file's existing correct
    unnamed form. (c) the standing ruling that return values are not named, which
    is what selects between two otherwise-equivalent repairs.

Verification at this head

  • origin/main merged in, not rebased — no conflicts. Branch is 0 behind.
  • nix develop -c forge test with all five RPC endpoints set — 251 passed, 0
    failed, 0 skipped
    across 18 suites, fork tests included, exit 0.
    testSupportedNetworks (gas 7901) and testSupportedNetworksAreFullyConfigured
    (gas 41963) both [PASS].
  • nix develop -c forge fmt --check — clean, exit 0.
  • nix develop -c slither .. analyzed (49 contracts with 100 detectors), 0 result(s) found, exit 0.
  • nix develop -c rainix-sol-single-contract — exit 0.

The last three were run locally because CI could not reach them (see below).

The one red, and why it is not this PR

rainix / static / static fails at
rainlanguage/rainix/.github/actions/agent-context-cap@main:

ERROR: this repo loads 24227 bytes of agent context at the start of every
session — 20131 over the 4096-byte cap.
24227 CLAUDE.md

That step runs before slither, forge fmt --check and
rainix-sol-single-contract, so all three are skipped, not failed.

main's own tip 369cfe9 fails on exactly the same step in exactly the same
job — verified against run 31949244742, where static is the only failing job
and agent-context-cap its only failing step. It is a repo-wide condition this
branch inherited through the merge, it is about CLAUDE.md's size, and this
PR's entire diff is one comment line in a .sol file. Cutting 20kB from
CLAUDE.md is separate work, not this PR's scope.

All three steps that red masks were run locally instead, so nothing goes
unchecked: forge fmt --check, slither . (0 results) and
rainix-sol-single-contract all exit 0. rainix / test / test and
rainix / legal / legal are green on CI. No unresolved review threads
(checked via the GraphQL reviewThreads query, not the check status —
CodeRabbit reports pass here only because it was rate limited and produced no
review).

@thedavidmeister
thedavidmeister merged commit 2616216 into mainAug 16, 2026
3 of 4 checks passed
Sign up for freeto 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.

supportedNetworks documents a return name its signature does not declare

2 participants

@thedavidmeister@claude