feat(solidity): improve Sepolia deploy behavior and wallet registry flows#4000
Open
lionakhnazarov wants to merge 10 commits into
Open
feat(solidity): improve Sepolia deploy behavior and wallet registry flows#4000lionakhnazarov wants to merge 10 commits into
lionakhnazarov wants to merge 10 commits into
Conversation
Isolates CI and dependency-management groundwork needed for testnet4/Sepolia work so follow-up PRs can focus on runtime and deployment behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced May 25, 2026
…andom-beacon Adjusts hardhat/deploy scripts, WalletRegistry behavior/tests, and external random-beacon export deploy scripts so Sepolia deployment and verification paths match the new stack expectations. Co-authored-by: Cursor <cursoragent@cursor.com>
cef3185 to
e1bca45
Compare
8e4fea1 to
23b83ce
Compare
…ator Invert mainnet-only denylist to explicit allowlist (hardhat, development, sepolia). Future production-like networks added downstream now default to the safe behavior (preserve existing deployment) instead of silently overwriting deployments/<network>/EcdsaDkgValidator.json.
Add README explaining that 05_approve_random_beacon_in_token_staking.js intentionally diverges from its tsc-compiled siblings to carry an ifaceHasFunction precheck for Threshold TokenStaking. A blind regeneration from upstream would silently drop the precheck and reintroduce a hard failure on networks without approveApplication.
The conditional etherscan spread inside the object literal forced removal of the HardhatUserConfig annotation. Assign etherscan via a post-declaration if-block instead so the annotation (and type-checking) is preserved without relying on TS 4.9 'satisfies' (this package is on TS 4.5).
Sepolia maps deployer/governance/chaosnetOwner/esdm all to account index 0 because the testnet deploy uses a single key from ACCOUNTS_PRIVATE_KEYS. Add a header comment so readers don't expect role-separation branches (e.g. initialize-wallet-owner.ts's owner-vs-governance fork) to fire on Sepolia.
The second WalletRegistry.governance() read immediately before execute() is a deliberate recheck against concurrent transferGovernance on shared networks (sepolia/mainnet); annotate so it isn't mistaken for dead code.
Add verifyOnTenderlyOrContinue mirroring verifyOnEtherscanOrContinue and wrap tenderly.verify in all four deploy scripts (01, 02, 03, 09). Before this, only 03 swallowed Tenderly errors; a Tenderly outage during deploy would fail 01/02/09 while 03 kept going. Now all four behave the same.
hardhat-deploy walks deploy/ and requires() every file; a Markdown sibling there crashes deployments.fixture() in tests. Move the regeneration-policy README one level up to external/random-beacon-export/README.md (still discoverable, no longer in the require path).
|
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: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
40e522f to
e1bca45
Compare
…ety) (#4016) ## Context Follow-up to #4000 addressing valid findings from the multi-agent review. Stacks **on top of** `stack/testnet4-02-solidity-logic`; merge after #4000. ## Findings addressed | # | Fix | Commit | |---|-----|--------| | 3 | Allowlist redeploy-safe networks for `EcdsaDkgValidator` (was: mainnet-only denylist) | \`fix(ecdsa/deploy): allowlist redeploy-safe networks\` | | 5 | README documenting vendored `random-beacon-export` regeneration policy (`05_*.js` diverges intentionally) | \`docs(ecdsa/deploy): document vendored random-beacon-export format policy\` | | 7 | Restore \`HardhatUserConfig\` type annotation (TS 4.5 compatible, no \`satisfies\`) | \`fix(ecdsa/hardhat): restore HardhatUserConfig type annotation\` | | 8 | \`verifyOnTenderlyOrContinue\` helper applied to all 4 deploy scripts (was: only 03 swallowed errors) | \`fix(ecdsa/deploy): apply tenderly verify-or-continue helper everywhere\` | | 9 | Comment explaining sepolia named-account role collapse | \`docs(ecdsa/hardhat): note sepolia named-account role collapse\` | | 10 | Comment marking the second \`WalletRegistry.governance()\` read as a deliberate TOCTOU recheck | \`docs(ecdsa/tasks): explain TOCTOU recheck of WR.governance()\` | | extra | Move \`README.md\` out of \`deploy/\` (hardhat-deploy walks the dir and \`require()\`s every file) | \`fix(ecdsa/deploy): move README out of deploy/ dir\` | ## Findings rejected after review - **PR body wording on `WalletRegistry.sol`** (NatSpec-only) — best handled by editing PR #4000's body directly, not as a code commit here. - **Skip-suite disclosure** — same: belongs in PR #4000's body. - \`#4\` (gate \`00_resolve_*\` on env var) — would break \`deployments.fixture()\` in tests (\`yarn test\` runs the hardhat network which needs the skip). - \`#6\` (drop \`approveApplication\` try/catch) — deliberate runtime backstop for forked/aliased networks where artifact ABI ≠ on-chain. ## Test Plan Verified locally with \`FORKING_URL\` unset: - \`cd solidity/ecdsa && yarn test\` → **644 passing, 44 pending, 0 failing** - \`cd solidity/random-beacon && yarn test\` → **535 passing, 397 pending, 0 failing** The 44 + 397 pending are the pre-existing \`describe.skip(...)\` suites (legacy Keep TokenStaking ABI unavailable in current Threshold build).
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.
Stack Context
This is PR 2/4 in the reorganization stack.
Base: #3999 (
stack/testnet4-01-ci-yarn)Next: #4001
What Changed
1) ECDSA deploy/runtime logic
solidity/ecdsa/contracts/WalletRegistry.solsolidity/ecdsa/deploy/00_resolve_reimbursement_pool.tssolidity/ecdsa/deploy/00_resolve_token_staking.tssolidity/ecdsa/deploy/01_deploy_ecdsa_sortition_pool.tssolidity/ecdsa/deploy/02_deploy_dkg_validator.tssolidity/ecdsa/deploy/03_deploy_wallet_registry.tssolidity/ecdsa/deploy/07_approve_wallet_registry.tssolidity/ecdsa/deploy/09_deploy_wallet_registry_governance.tssolidity/ecdsa/deploy/etherscanVerification.tssolidity/ecdsa/hardhat.config.tssolidity/ecdsa/tasks/initialize-wallet-owner.ts2) ECDSA test/fixture/type updates
solidity/ecdsa/test/WalletRegistry.Authorization.test.tssolidity/ecdsa/test/WalletRegistry.CustomErrors.test.tssolidity/ecdsa/test/WalletRegistry.Rewards.test.tssolidity/ecdsa/test/WalletRegistry.Slashing.test.tssolidity/ecdsa/test/WalletRegistry.Upgrade.test.tssolidity/ecdsa/test/WalletRegistry.WalletCreation.test.tssolidity/ecdsa/test/WalletRegistryGovernance.test.tssolidity/ecdsa/test/fixtures/index.tssolidity/ecdsa/test/utils/operators.tssolidity/ecdsa/types/TokenStaking.extensions.d.tssolidity/ecdsa/types/chai.d.ts3) Random beacon deploy/config/test alignment
solidity/random-beacon/deploy/05_approve_random_beacon_in_token_staking.tssolidity/random-beacon/hardhat.config.tssolidity/random-beacon/test/RandomBeacon.Authorization.test.tssolidity/random-beacon/test/RandomBeacon.Callback.test.tssolidity/random-beacon/test/RandomBeacon.GroupCreation.test.tssolidity/random-beacon/test/RandomBeacon.Relay.test.tssolidity/random-beacon/test/RandomBeacon.Rewards.test.tssolidity/random-beacon/test/system/e2e.test.tssolidity/random-beacon/test/fixtures/index.tssolidity/random-beacon/test/utils/operators.tssolidity/random-beacon/types/TokenStaking.extensions.d.ts4) Embedded export deploy scripts for ECDSA external random-beacon export
solidity/ecdsa/external/random-beacon-export/deploy/01_*.js ... 09_*.jsOut of Scope
deployments/sepoliaJSON snapshots (handled in chore(deployments): add Sepolia deployment artifacts #4001).Test Plan
cd solidity/ecdsa && yarn testcd solidity/random-beacon && yarn test