Skip to content

review: address PR #4000 review findings (deploy hardening + type-safety)#4016

Merged
lionakhnazarov merged 7 commits into
stack/testnet4-02-solidity-logicfrom
review/pr-4000-solidity-logic-fixes
Jun 4, 2026
Merged

review: address PR #4000 review findings (deploy hardening + type-safety)#4016
lionakhnazarov merged 7 commits into
stack/testnet4-02-solidity-logicfrom
review/pr-4000-solidity-logic-fixes

Conversation

@piotr-roslaniec
Copy link
Copy Markdown
Collaborator

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

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).

…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).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 805e8515-1f5a-45af-81f0-6f489b808e9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch review/pr-4000-solidity-logic-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

@lionakhnazarov lionakhnazarov merged commit 3f5e3c9 into stack/testnet4-02-solidity-logic Jun 4, 2026
31 checks passed
@lionakhnazarov lionakhnazarov deleted the review/pr-4000-solidity-logic-fixes branch June 4, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants