Repository navigation
test(random-beacon): remove Waffle before Hardhat 3 - #4305
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
…able PR #4305 introduced @nomicfoundation/hardhat-chai-matchers and @nomicfoundation/hardhat-network-helpers, both Hardhat 2-only, but the gates table didn't list either as a future Hardhat 3 migration gate. Add both to their respective rows.
|
Independent verification (multi-agent review, not a CI run) of the Waffle -> Hardhat Chai Matchers migration: Ran
Result: byte-for-byte identical on both -- 191 passing, 10 failing, same 10 suites (BeaconDkgValidator, RandomBeacon.Authorization/Callback/GroupCreation/Parameters/Relay/Rewards, RandomBeaconGovernance, ReimbursementPool, System e2e), same root cause on every failure: This is strong evidence the matcher/fixture-loader swap is behavior-preserving for everything this sandbox can execute, and that the 10 failures are a pre-existing environment gap (this sandbox can't resolve/stub NuCypherToken) rather than a regression from this PR. It does not reproduce the full "955 tests pass" claim -- this sandbox lacks whatever this repo's CI provides to satisfy that deploy script (likely network/RPC config unrelated to Waffle). Recommend running the full suite once in an environment matching CI (or landing #4217 so CI can run directly on this branch) before this lands, since a plugin-registration defect in the matcher swap would only be observable at runtime, not via this diff/typecheck. Full multi-lens review: 2 confirmed P2 findings (this one, now addressed by the parity run above; and a migration-doc gates-table gap, fixed in ec43371), 6 findings raised and independently refuted after adversarial validation. |
|
Follow-up to the verification above: closed the remaining assertion-strength gap empirically.
This confirms the new matcher still enforces exact-string revert-reason strictness rather than silently degrading -- the one thing static review alone couldn't rule out. |
|
Correction + stronger evidence on the two comments above: Count correction: I wrote "2 confirmed P2 findings ... 6 findings raised and independently refuted" in the first comment. Post-report review reclassified one of the six refuted findings (the Stronger mutation evidence: the earlier mutation spot-check used an unrelated wrong string, which fails under both the old and new assertion library and so didn't actually isolate anything. Redid it properly with a strict prefix of the real revert message on
That's the precise strictness change this migration makes: a truncated/prefix revert-reason expectation that would have silently passed under Waffle now correctly fails. Mutation reverted in both worktrees immediately after observing the result; working tree confirmed clean before anything further was committed. |
|
Important scoping correction to the parity/mutation evidence above — it covers less of the diff than it may have read as covering. Of the 15 test files this PR's diff touches, only 6 ( That specifically includes So: the 191/191 zero-drift result and the prefix-mutation proof ( |
…ffle # Conflicts: # solidity/docs/hardhat-3-migration.md # solidity/random-beacon/hardhat.config.ts # solidity/random-beacon/package.json # solidity/random-beacon/test/BeaconDkgValidator.test.ts # solidity/random-beacon/test/RandomBeacon.GroupCreation.test.ts # solidity/random-beacon/yarn.lock
Random Beacon now uses Hardhat Chai Matchers 1.x and Hardhat Network Helpers 1.x on its current Hardhat 2 / ethers v5 stack. Tests use
loadFixtureandethers.provider; Waffle, its Ganache dependency tree, and the now-unused ethereumjs-abi resolution are removed. The existing deployment fixtures and test assertions are retained.This advances #4209 and #4213. It also adds
solidity/docs/hardhat-3-migration.mdto record the investigation and remaining gates for #4295: the public deployment export chain, proposed dual publication, compatible helper/plugin versions, cross-package script loading, artifact compatibility, and the rollout/validation order. The three tracking issues remain open: ethers v6, the remaining plugin migrations, and the coordinated Hardhat 3/Rocketh conversion are still required.Stacked on #4304, following the TypeChain/strict/ES2020/types/plugin/lint preparation in #4297–#4304. Coordinate the runtime prerequisite #4205 and CI branch support #4217 with the stack. The maintained deployment-v1 update remains the independent #4294.
Validation on Node 24.11.1: all 955 beacon tests pass with the replacement fixture and assertion libraries; strict typechecking, export compilation, and full lint pass. No tests are removed or newly skipped. The final rebuilt contract artifacts still match all 159 baseline ABIs and executable runtimes after stripping Solidity metadata. ECDSA's 673 tests (44 existing pending), strict checks, export builds, and fresh TypeChain generation passed on the prerequisite stack.