You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three reviewers found this independently, from three different artifacts:
the published 0.1.11 zip (twice) and a vendored 0.1.6 at /home/gildlab/code/rain-deploy-15a/dependencies/rain-sol-codegen-0.1.6.
.soldeerignore is a second, hand-maintained definition of "what this library
is", disjoint from the source graph forge build compiles. Nothing checks the
two agree, so the published artifact can be broken or incomplete with a green
main.
.soldeerignore excludes /test but not /script or src/generated. script/Build.sol:8 imports {CodeGennable} from "../test/concrete/CodeGennable.sol". The published zip contains script/Build.sol and src/generated/CodeGennable.sol, and no test/. The
shipped script/Build.sol therefore cannot compile in any consumer. No CI step
ever builds the filtered tree, so this has been true across releases with no red.
Nothing breaks today because foundry only compiles dependency files something
imports — but the repo's only worked example of the library, the thing a
consumer copies, cannot be compiled from the package.
The latent import is the symptom; the shape is what lands next. Add src/lib/LibNewThing.sol imported by LibCodeGen.sol, and add any .soldeerignore pattern that happens to match it (the file already mixes
anchored /audit with unanchored .github, so pattern edits are easy to get
wrong) — the package publishes without it, every consumer's forge build breaks
on the next soldeer install, and this repo's own CI stays green because the
local tree is complete.
Proposed fix
Two halves:
Compile the package as published, in CI, on every push — a job that unpacks
what .soldeerignore would ship into a scratch project and builds it, failing
on any unresolved import.
Remove the inconsistency now: either move CodeGennable to src/concrete/CodeGennable.sol (its generated counterpart src/generated/CodeGennable.sol already ships) and update the imports in script/Build.sol, test/lib/LibFs.buildFileForContract.t.sol:8 and test/lib/LibCodeGen.bytecodeHashConstantString.t.sol:8 (both test/src/lib/
after Move every .t.sol into the test/src/lib mirror tree #56) — or add /script to .soldeerignore, which drops the example from the package
altogether.
Audit scope: whole-repo, commit 7aa85a4
Dimension 6 (hazard surface) · severity medium
Where
.soldeerignore:1-20script/Build.sol:8.github/workflows/package-release.yaml:1-11Problem
Three reviewers found this independently, from three different artifacts:
the published
0.1.11zip (twice) and a vendored0.1.6at/home/gildlab/code/rain-deploy-15a/dependencies/rain-sol-codegen-0.1.6..soldeerignoreis a second, hand-maintained definition of "what this libraryis", disjoint from the source graph
forge buildcompiles. Nothing checks thetwo agree, so the published artifact can be broken or incomplete with a green
main.
.soldeerignoreexcludes/testbut not/scriptorsrc/generated.script/Build.sol:8imports{CodeGennable} from "../test/concrete/CodeGennable.sol". The published zip containsscript/Build.solandsrc/generated/CodeGennable.sol, and notest/. Theshipped
script/Build.soltherefore cannot compile in any consumer. No CI stepever builds the filtered tree, so this has been true across releases with no red.
Nothing breaks today because foundry only compiles dependency files something
imports — but the repo's only worked example of the library, the thing a
consumer copies, cannot be compiled from the package.
The latent import is the symptom; the shape is what lands next. Add
src/lib/LibNewThing.solimported byLibCodeGen.sol, and add any.soldeerignorepattern that happens to match it (the file already mixesanchored
/auditwith unanchored.github, so pattern edits are easy to getwrong) — the package publishes without it, every consumer's
forge buildbreakson the next
soldeer install, and this repo's own CI stays green because thelocal tree is complete.
Proposed fix
Two halves:
what
.soldeerignorewould ship into a scratch project and builds it, failingon any unresolved import.
CodeGennabletosrc/concrete/CodeGennable.sol(its generated counterpartsrc/generated/CodeGennable.solalready ships) and update the imports inscript/Build.sol,test/lib/LibFs.buildFileForContract.t.sol:8andtest/lib/LibCodeGen.bytecodeHashConstantString.t.sol:8(bothtest/src/lib/after Move every .t.sol into the test/src/lib mirror tree #56) — or add
/scriptto.soldeerignore, which drops the example from the packagealtogether.