Repository navigation
fix(deploy): make published scripts compatible with ethers v5/v6 and replay - #186
Open
mswilkison wants to merge 2 commits into
Open
mswilkison wants to merge 2 commits into
mswilkison wants to merge 2 commits into
Conversation
mswilkison
marked this pull request as ready for review
September 8, 2026 19:51
This was referenced Sep 8, 2026
piotr-roslaniec
added a commit
to threshold-network/keep-core
that referenced
this pull request
Oct 7, 2026
…5/v6 and replay (#4320) Published deploy scripts execute inside the consumer's Hardhat runtime. Ethers v6 consumers currently fail on v5-only APIs, and replaying copied deployments can repeat approvals, ownership transfers, or proxy deployment. This change keeps both producers on ethers v5 while making their exports work on either runtime. It uses deployment records for addresses, hardhat-deploy confirmation waits and ABI reads, preserves existing deployments/governance, and skips completed state changes. Reused RandomBeacon and WalletRegistryGovernance deployments still reach verification, so failed Etherscan or Tenderly requests can be retried without new transactions. Matching governance deployment records retain their original constructor arguments and metadata. It also covers the Allowlist/V2 scripts, packages their weights data, and moves verification utilities outside the directory Hardhat treats as executable deploy scripts. The new consumer CI matrix installs both npm tarballs into independent v5 and v6 projects. It exercises verification-tagged waits, Chaosnet, the V2 upgrade and Allowlist initialization, then clears the migration journal and replays against the same chain. It checks unchanged account nonces and addresses, governance recovery, injected verification failures and retries before and after governance transfer, and approval ABI/read variants including JSON and human-readable fragments. Approval transaction errors remain visible; an unreadable status alone cannot establish that approval succeeded. Validation: both packages build, prepack and pass their full lint commands; both consumer lanes pass; the six existing verification-helper tests pass. Explorer services are stubbed, while deployment transactions and confirmation waits run on a real local Hardhat network. Addresses #4319. Package publication, downstream pin bumps and removal of tbtc-v2 overrides remain release follow-ups. The sibling Threshold package fix is threshold-network/solidity-contracts#186. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for selecting custom Allowlist weight files on non-mainnet networks. - Added isolated deployment checks for ethers 5 and 6, covering replay, recovery, approvals, authorizations, and ownership. - **Bug Fixes** - Deployment scripts now avoid repeating completed deployments, approvals, authorizations, and ownership changes. - Improved deployment confirmation handling and verification retries. - Added safeguards against mismatched governance and proxy ownership. - **Documentation** - Added guidance for running deployment checks and configuring Allowlist weights. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.
Consumers replay this package's published deployment scripts after copying existing deployment records. Today that can repeat the 4.5B T transfer, call an already-used initializer, or grant a timelock role after the deployer has relinquished administration. The mainnet proxy path also depends on ethers v5-only contract and Interface APIs.
Use on-chain balances, governance and role membership to skip completed work; fund only the vending-machine shortfall and fail if the deployer cannot cover it. Reuse TokenStaking records, recover an interrupted initialization, and save mainnet proxy addresses/ABI through hardhat-deploy using the consumer's HRE. Make the mainnet governance and proxy-admin handoffs replay-safe too. The producer remains on its existing ethers v5 dependencies.
The CI producer follows
.nvmrcwhen available (including #182's Node 22 toolchain) and otherwise retains Node 18 for the legacy lockfile. The new CI consumer matrix installs the actual prepacked tarball on ethers v5 and v6 (hardhat-ethers 3 / upgrades 2.5.1). Each lane runs both direct and mainnet-style proxy deployment on fresh local chains, then replays with distinct deployer/council accounts and asserts unchanged account nonces and deployment addresses. It also checks partial/excess funding, insufficient funds, initializer recovery, saved ABI and ownership handoffs.Validation: locked producer build and prepack, lint, formatting checks, and all four consumer scenarios pass locally. The full Solidity suite passed in CI. The producer integrated with #182 was also built and prepacked on Node 22; all four packed consumer scenarios passed on ethers 5.8.0 and 6.17.0. Workflow formatting and actionlint pass. No live network or npm publication is involved.
Addresses #184; sibling fix: threshold-network/keep-core#4320. Publishing the package, updating keep-core pins, and removing tbtc-v2's overrides remain release follow-ups.