Repository navigation
Conversation
Tests mark themselves mock-only by opening with vm.skip(livePrecompiles), but the criteria lived only in per-test comments. Document them on the livePrecompiles flag: a test is mock-only when it writes storage at a fixed precompile address, asserts a mock slot the Rust implementation lacks, or needs a state that only mock storage writes can build. Also say to branch on livePrecompiles when a behavior can be checked in both worlds, and to gate tests that wait on a base/base change behind an environment flag, so those skips stay visible in base/base's live precompile CI, which leaves mock-only skips out of its skipped count. Amp-Thread-ID: https://ampcode.com/threads/T-f04cecba-e4dc-42c5-94de-8846dbf5444c Co-authored-by: Julian Meyer <julian.meyer@coinbase.com>
Interface Coverage✅ All interface functions have test coverage. |
📊 Forge Coverage (
|
| File | Lines | Stmts | Branches | Funcs |
|---|---|---|---|---|
| 🟡 B20FactoryLib.sol | 97.70% | 98.00% | 100.00% | 95.00% |
| 🔴 test/lib/ForceFeeder.sol | 0.00% | 0.00% | 100.00% | 0.00% |
| 🔴 test/lib/PrecompileProbe.sol | 0.00% | 0.00% | 0.00% | 0.00% |
| 🟢 MockActivationRegistry.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockActivationRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20.sol | 100.00% | 99.68% | 100.00% | 100.00% |
| 🟢 MockB20Asset.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟡 MockB20Factory.sol | 98.96% | 99.10% | 100.00% | 100.00% |
| 🟢 MockB20Stablecoin.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20Storage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockBaseTime.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟡 MockPolicyRegistry.sol | 100.00% | 99.58% | 97.78% | 100.00% |
| 🟢 MockPolicyRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| Total | 97.14% | 97.51% | 98.21% | 97.07% |
Full report: download artifact. To browse locally: make coverage (runs forge coverage + genhtml + opens the HTML report).
❌ Fork tests did not completeNo completed, non-empty suite was recorded. Check the workflow logs for build, setup, or execution errors. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A test marks itself mock-only by opening with
vm.skip(livePrecompiles), but nothing says when that's allowed: the reasons live only in per-test comments. This PR documents the criteria on thelivePrecompilesflag intest/lib/BaseTest.sol, and adds a row pointing to them inLIVE_PRECOMPILE_TESTING.md. A test is mock-only when it:vm.store: cannot use precompile ... as an argument;MockB20Storage.initializedSlot(); orIt also says to branch on
livePrecompileswhen a behavior can be checked in both worlds. A test waiting on a base/base change should be gated behind an environment flag, likePOLICY_DISPATCH_FIX, instead of this guard. base/base's live-precompile CI now leaves mock-only skips out of its skipped count (base/base#6154), so misusing the guard would hide the test there.How the current skips fit
I removed every
vm.skip(livePrecompiles)and ran the tests against the live precompiles (base-anvil at541626fd, Denim, base-std7321d891):vm.storeon the PolicyRegistry precompile addresscounterOverflowtests,createPolicy_revertOrder,pendingPolicyAdminstorage poisonMockB20SlotHelpersinitializedSlotfails.adminCountSlot_disjointpasses, but it only compares library constantstransferFromandtransferFromWithMemotestsskipsExecutorPolicyfails withPolicyForbids, which confirms itB20FactoryNonPayableThe two
B20FactoryNonPayableskips don't meet the criteria. base/base#3362 has merged, and both tests pass on Beryl and Denim. I left them alone to keep this PR to documentation; removing them is the follow-up.Verification
forge fmt --check test/lib/BaseTest.solandforge buildpass, and thePolicyRegistryCreatePolicyTestandMockB20SlotHelpersTestsuites pass in reference mode. The change is comments and docs only.