-
Notifications
You must be signed in to change notification settings - Fork 2
2026 02 18 audit #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
2026 02 18 audit #430
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
68d3956
Add edge case tests for LibParseStackTracker
thedavidmeister a60d67f
Add fuzzed round-trip tests and output overflow test
thedavidmeister b83f0ae
Fuzz too-few-inputs test and add paren nesting boundary tests
thedavidmeister 67b6e19
Require triage rigor for existing tests in AUDIT.md
thedavidmeister 6d5d031
Fuzz comment and hex literal error tests, document paren limit
thedavidmeister 1022437
Codify jidoka process in CLAUDE.md and mark triage findings FIXED
thedavidmeister 918f852
Prohibit fabricated self-narratives in process documentation
thedavidmeister f82c569
Add unsafeParse tests and mark A48-1 FIXED
thedavidmeister 525395f
Add TESTING.md with testing conventions
thedavidmeister 3ae7c4a
Add maxOutputs truncation test and document bytecode construction rule
thedavidmeister 6949934
Add newState initialization test and mark A12-5 FIXED
thedavidmeister 6ab4d0f
Add multi-output highwater advancement test and mark A12-6 FIXED
thedavidmeister a6e5883
Add selectLiteralParserByIndex direct test and update triage
thedavidmeister 73e812b
Add happy-path tests for parseDecimalFloatPacked and mark A34-1 FIXED
thedavidmeister 3a16974
Add RepeatLiteralTooLong and output value fuzz tests, mark A36-1 A36-…
thedavidmeister 66644c8
Add subParseLiteral rejection fuzz tests and mark A38-1 FIXED
thedavidmeister 3fb2b85
Add handleOperandDisallowedAlwaysOne tests and mark A39-1 FIXED
thedavidmeister 3b66223
Add DanglingSource revert test and mark A43-4 FIXED
thedavidmeister 35c7dcf
Add ParenInputOverflow revert test and mark A43-5 FIXED
thedavidmeister a674d30
Add highwater ParseStackOverflow test and mark A43-6 FIXED
thedavidmeister 5f42dfd
Add pushOpToSource direct unit tests and mark A43-7 FIXED
thedavidmeister 474c90e
Add endSource direct unit tests and mark A43-8 FIXED
thedavidmeister 9008cc9
Add buildBytecode direct unit tests and mark A43-9 FIXED
thedavidmeister c3e136f
Add UnknownWord direct test with mock sub-parser and mark A44-2 FIXED
thedavidmeister 5d183ed
Mark A44-3 FIXED — already covered by A38-1 testSubParseLiteralAllReject
thedavidmeister 7897151
Add parse2 direct tests for empty, parse error, and integrity error a…
thedavidmeister 3158b06
Add parsePragma1 deployer proxy tests and mark A47-2 FIXED
thedavidmeister 49db70d
Add namespace isolation fuzz tests and mark A50-1 FIXED
thedavidmeister ee5e748
Add zero-opcode source eval tests and mark A05-4 FIXED
thedavidmeister 22ac7cd
Add multiple source eval tests and mark A05-5 FIXED
thedavidmeister d5e5ce9
Add eval with matching non-zero inputs fuzz test and mark A05-6 FIXED
thedavidmeister cb7e0e6
Add evalLoop multiple-of-8 opcode count edge case tests
thedavidmeister d44b4d6
Fuzz extern address in LibExtern encode/decode roundtrip test
thedavidmeister 7a09fc1
Add standalone decode tests for LibExtern dispatch and call
thedavidmeister 6cc2a9a
Add fuzz test for LibExternOpContextCallingContract.subParser
thedavidmeister 6825e95
Add fuzz test for LibExternOpContextRainlen.subParser
thedavidmeister 67be772
Add fuzz test for LibExternOpContextSender.subParser
thedavidmeister 7a4c784
Add fuzz test for LibExternOpStackOperand.subParser
thedavidmeister aa5ba1e
Add stackMaxIndex peak tracking test for LibIntegrityCheck
thedavidmeister 3dd41ef
Add zero-source bytecode tests for integrity check
thedavidmeister 25975c3
Add multi-source bytecode integrity check tests
thedavidmeister e352c38
Move fingerprint from src to test library and add tests
thedavidmeister cc0514b
Add stackBottoms tests and mask stackTrace source indices to 16 bits
thedavidmeister 6cf7f75
Add pass 3 and pass 4 findings to triage
thedavidmeister 4eb5f26
Add NatSpec to InterpreterState, ParseState, math ops, and reference …
thedavidmeister 9c6c5db
Fix inaccurate NatSpec in stackTrace, eval2, exp2, and headroom
thedavidmeister a674638
Remove @notice tags from library and contract NatSpec
thedavidmeister 59f4ccd
Fix inaccurate operand handler NatSpec in LibParseOperand
thedavidmeister ffe38e6
Fix inaccurate NatSpec across eval, state, math, and parse libs
thedavidmeister 768e57f
Remove dead code, unused imports, and fix code quality issues
thedavidmeister 666710f
Fix code quality issues across bitwise, math, erc20, and concrete con…
thedavidmeister 11ad106
Dismiss 5 false positive Rust audit findings
thedavidmeister ae94a3e
Add missing @param/@return NatSpec tags to error files and opcode lib…
thedavidmeister d1d070b
Update triage for NatSpec fixes across error files and opcode libraries
thedavidmeister 7355aca
Address CodeRabbit review feedback on PR #430
thedavidmeister 2fad791
Add @param/@return NatSpec to hash, any, binary-equal, conditions, en…
thedavidmeister 44072a3
Add explicit @notice to all @title NatSpec blocks
thedavidmeister a1cdaba
Add explicit @notice to all @title NatSpec blocks in test files
thedavidmeister 76ba1e5
Add explicit @notice to function-level and error NatSpec blocks
thedavidmeister 9379a58
Add @param/@return NatSpec to all remaining opcode libraries
thedavidmeister cc6e325
Add @param/@return NatSpec to core libs, parse libs, extern ops, and …
thedavidmeister 8865768
Fix missing using directive for Float.eq in selectByIndex test
thedavidmeister d7f9baa
Exclude audit directory from CodeRabbit reviews
thedavidmeister bd92a9d
Exclude Claude and audit config files from CodeRabbit reviews
thedavidmeister 44f0748
Exclude TESTING.md from CodeRabbit reviews
thedavidmeister 1cb75f1
Fix pragma version mismatch in stackTrace test
thedavidmeister 34fe844
Update triage with 197 verified FIXED findings across passes 3 and 4
thedavidmeister 103fa61
Complete pass 3 NatSpec audit and add IDISPaiRegistry interface
thedavidmeister ee84095
Remove gh from nix flake dev shell
thedavidmeister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| reviews: | ||
| path_filters: | ||
| - "!audit/**" | ||
| - "!CLAUDE.md" | ||
| - "!AUDIT.md" | ||
| - "!TESTING.md" | ||
| - "!.claude/**" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Testing Conventions | ||
|
|
||
| ## Base Contracts | ||
|
|
||
| Test base contracts in `test/abstract/`: | ||
|
|
||
| - **`RainterpreterExpressionDeployerDeploymentTest`** — Full stack deployment. Exposes `I_PARSER`, `I_INTERPRETER`, `I_STORE`, `I_DEPLOYER`. | ||
| - **`OpTest`** — Opcode tests. Provides `opReferenceCheck()`, `checkHappy()`, `checkUnhappy()`. | ||
| - **`ParseTest`** — Parser tests. Provides `parseExternal()`. | ||
| - **`OperandTest`** — Operand handler tests. Provides `checkOperandParse()`. | ||
| - **`ParseLiteralTest`** — Literal parsing tests. Provides `checkLiteralBounds()`. | ||
|
|
||
| ## Fuzz Testing | ||
|
|
||
| - Use `bound()` to constrain fuzz inputs, not `vm.assume()`. `vm.assume()` wastes runs by discarding inputs. `vm.assume()` is acceptable when the rejection rate is low or `bound()` cannot express the constraint. | ||
| - When fuzzing over a non-contiguous set (e.g., non-hex bytes), `bound()` to the count of valid values, then map with arithmetic to skip excluded ranges. | ||
| - When a fuzz parameter affects expression structure, build rainlang dynamically. The fuzz variable must match what the rainlang produces. | ||
|
thedavidmeister marked this conversation as resolved.
|
||
|
|
||
| ## Library Internals | ||
|
|
||
| Internal library functions need an external wrapper in the test contract. Construct `ParseState` inside the wrapper so memory pointers are valid. Call via `this.externalFoo()`. | ||
|
|
||
| ## Revert Paths | ||
|
|
||
| Use `vm.expectRevert` with `abi.encodeWithSelector` and the custom error type. Call through `this.externalFoo()` for library functions or directly on `I_PARSER`/`I_INTERPRETER` for integration tests. | ||
|
|
||
| ## Bytecode Construction | ||
|
|
||
| Use the parse library to generate bytecode from rainlang when the test needs valid bytecode. Only hand-encode bytecode when the test intentionally needs invalid or malformed bytecode that the parser cannot produce. | ||
|
|
||
| ## Bytecode Inspection | ||
|
|
||
| Use `LibBytecode` from `rain.interpreter.interface/lib/bytecode/LibBytecode.sol`. Do not manually index into bytecode bytes. | ||
|
|
||
| ## Opcode Testing | ||
|
|
||
| Use `opReferenceCheck` to validate that `run` output matches a pure reference implementation and that `integrity` correctly declares inputs/outputs. | ||
|
|
||
| ## Boundary Tests | ||
|
|
||
| Always test both sides: the max valid value (should succeed) and one past it (should revert). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.