Skip to content

chore(deployments): add Sepolia deployment artifacts#4001

Open
lionakhnazarov wants to merge 14 commits into
stack/testnet4-02-solidity-logicfrom
stack/testnet4-03-deployment-artifacts
Open

chore(deployments): add Sepolia deployment artifacts#4001
lionakhnazarov wants to merge 14 commits into
stack/testnet4-02-solidity-logicfrom
stack/testnet4-03-deployment-artifacts

Conversation

@lionakhnazarov
Copy link
Copy Markdown
Collaborator

@lionakhnazarov lionakhnazarov commented May 25, 2026

Stack Context

This is PR 3/4 in the reorganization stack.
Base: #4000 (stack/testnet4-02-solidity-logic)
Next: #4002

What Changed

1) Added generated Sepolia deployment snapshots (ECDSA)

  • Added full deployment artifacts under:
    • solidity/ecdsa/deployments/sepolia/.chainId
    • solidity/ecdsa/deployments/sepolia/.migrations.json
    • solidity/ecdsa/deployments/sepolia/*.json (Allowlist, BLS, Beacon*, Ecdsa*, RandomBeacon*, ReimbursementPool, T, TokenStaking, WalletRegistry*)

2) Added generated Sepolia deployment snapshots (Random Beacon)

  • Added full deployment artifacts under:
    • solidity/random-beacon/deployments/sepolia/.chainId
    • solidity/random-beacon/deployments/sepolia/*.json (BLS, Beacon*, RandomBeacon*, ReimbursementPool, T, TokenStaking)

3) Repo hygiene

  • Removed legacy export artifact: solidity/random-beacon/export.json
  • Gitignored Yarn Berry runtime state (.yarn/install-state.gz) in solidity/random-beacon to match the ecdsa package.
  • Gitignored gasReporterOutput.json in both solidity/ecdsa and solidity/random-beacon (regenerated on every test run, not a source artifact).

Why This Slice Exists

This PR intentionally isolates generated/deployment snapshot churn so logic review stays focused in adjacent PRs.

Out of Scope

  • Deploy/runtime logic changes.
  • Go runtime/network mapping changes.

Test Plan

  • Regenerated artifact set matches expected deployment outputs.
  • No non-generated behavior changes are introduced in this PR.

@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: 473c1177-a9e0-44f4-8661-bf5719262586

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 stack/testnet4-03-deployment-artifacts

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

@piotr-roslaniec piotr-roslaniec force-pushed the stack/testnet4-03-deployment-artifacts branch from 9ade31f to 5b40e26 Compare June 4, 2026 13:04
lionakhnazarov added a commit that referenced this pull request Jun 4, 2026
…4014)

## Context

Follow-up to PR #4001. Carries the gitignore-only hygiene commits that
previously rode on top of #4001's Sepolia artifacts so #4001 can stay
scoped to the deployment-snapshot work it advertises.

Subsequent commits on this branch will apply the deploy/config fixes
raised in review of #4001 (etherscan mainnet guard, HardhatUserConfig
typing, Sepolia named-accounts documentation, etc.) so logic deltas land
here rather than in the artifacts PR.

## What Changed

- gitignore \`gasReporterOutput.json\` in both \`solidity/ecdsa\` and
\`solidity/random-beacon\` (regenerated each test run).
- gitignore Yarn Berry runtime state (\`.yarn/install-state.gz\`,
\`.yarn/cache/\`, \`.yarn/build-state.yml\`) in
\`solidity/random-beacon\` to match the ecdsa package.

## Test Plan

- [ ] \`yarn install\` in both packages does not surface new untracked
files under the gitignored paths.
lionakhnazarov and others added 14 commits June 5, 2026 12:19
…apshots

Adds refreshed deployment JSON artifacts and gas outputs for ecdsa/random-beacon and removes stale random-beacon export snapshot to keep generated outputs in sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
hardhat-gas-reporter regenerates this file on every test run, producing
noisy diffs whenever gas costs shift. Both packages already ignore
`cache/` and `build/`; align by ignoring the gas-reporter output too
and untracking the existing files.
The .yarn/install-state.gz file is regenerated by every `yarn install`
and adds ~1.2 MB of binary churn to the repo. Mirror the ecdsa package
convention by ignoring Yarn Berry runtime state and untracking the
file.
…ation

The committed export/deploy/*.js files mirror @keep-network/random-beacon's
published export/deploy output. Without a regeneration command pinned in
the repo, the JS bundle can drift from the sibling .ts source. Add a README
spelling out origin (random-beacon's `yarn prepack`), copy step, and why
the directory exists at all (resolution-order workaround for the gitignored
sibling export/).
…pplication

ifaceHasFunction() already checks the ABI before the call, so the
subsequent msg.includes("No method named") branch in the catch was
unreachable defensive code coupled to ethers' error wording. Removing
both the catch wrapper in 07_approve_wallet_registry.ts and the matching
block in random-beacon's 05_approve_random_beacon_in_token_staking.ts
(plus the bundled JS mirror under ecdsa/external/random-beacon-export/).

Any genuine revert from approveApplication will now propagate, which
is the correct behavior for a deploy step.
…nfig

Switch @nomicfoundation/hardhat-verify from a conditional require() to a
static import so its type augmentation reaches HardhatUserConfig. Restore
the `: HardhatUserConfig` annotation on the config object so structural
errors in networks.*, external.*, solidity.compilers[] etc. surface at
compile time again.

DISABLE_HARDHAT_VERIFY still gates the `etherscan: { apiKey }` config
block and any verify calls inside deploy scripts; the plugin's task
registration alone is a no-op when unused.
verifyOnEtherscanOrContinue swallowed every error with no network guard,
so a mainnet bytecode-mismatch (a genuine signal that the deployed
bytecode does not match the artifact) would be silently logged and the
deploy would continue as if verification had succeeded. The wrapper in
03_deploy_wallet_registry.ts around hre.tenderly.verify had the same
shape.

Both call sites now propagate the error when hre.network.name ===
"mainnet" and only swallow on testnets / local networks where explorer
flakiness is expected. Operators who want to skip mainnet verification
intentionally can still set DISABLE_HARDHAT_VERIFY=true at the deploy-
script level.

Add unit tests covering both branches (sepolia / hardhat / development
swallow, mainnet rethrow) so future tweaks to the helper preserve the
mainnet guard.
The Sepolia hardhat config sets external.deployments.sepolia to [] so the
npm @threshold-network/solidity-contracts artifacts (which carry tx hashes
some RPCs cannot resolve) are not loaded. The committed deployments/sepolia/
snapshot is now the sole source of upstream contracts (T, TokenStaking,
RandomBeacon, RandomBeaconGovernance, ReimbursementPool).

Add a script that runs first (00_log_*) listing every pre-resolved
deployment, and asserts on Sepolia that the expected upstream contracts
are present. Missing snapshots now fail with a clear error pointing at
the missing names instead of an opaque "deployments.get returned
undefined" several steps into the deploy.
…nnet

skipIfAlreadyDeployed is false on every non-mainnet network so
hardhat-deploy can replace EcdsaDkgValidator when bytecode changes
(e.g. groupSize 100 → 3). The risk: WalletRegistry stores the
validator address in its constructor args, so a fresh validator deploy
without a matching WalletRegistry redeploy leaves WR pointing at the
previous on-chain validator.

Log a clear WARN line with the previous address whenever we replace an
existing deployment, so the operator sees the divergence before the
deploy proceeds. The full-redeploy script does redeploy WR, but ad-hoc
runs (or partial re-runs) won't, and this is the loudest place to
surface that.
…solve_reimbursement_pool

The previous silent return on hardhat/development networks pushed the
failure surface to downstream scripts that call deployments.get("TokenStaking")
and produced a less informative error. Both yarn test and yarn deploy:test
already set USE_EXTERNAL_DEPLOY=true so the threshold-network /
random-beacon external deploys provide these contracts on local networks.
The only case the silent return covered was `yarn deploy` against
hardhat without USE_EXTERNAL_DEPLOY, which would have failed downstream
anyway.

Throw now with a message that names the network and points the operator
at the expected source (USE_EXTERNAL_DEPLOY for local, deployments/sepolia
for Sepolia, ./external/mainnet for mainnet).
…mainnet

Sepolia legitimately collapses deployer, governance, chaosnetOwner, and
esdm to the same account index because the testnet stack is operated
from a single funded key. The risk: pattern-copying this to mainnet
would compromise the separation between the deploy key and governance
(on mainnet, governance / chaosnetOwner / esdm share the Threshold
Council multisig, but the deployer key must remain a distinct,
non-Council address).

Document the single-key Sepolia model directly above the namedAccounts
config so readers understand the divergence, and add a mainnet-only
guard in 00_log_external_deployments.ts that refuses the deploy if the
deployer address collides with any of the governance roles.
…uired

Default values on test-fixture options silently route new or refactored
test files down whichever code path was the most recent default; the
previous flip (TokenStaking → Allowlist) is exactly the failure mode the
fixture should help catch, not hide. Remove the default and require
every caller to be explicit about which authorization path it exercises.

Updates the nine implicit `walletRegistryFixture()` call sites to
`walletRegistryFixture({ useAllowlist: true })` preserving their
existing behavior. The single explicit `{ useAllowlist: false }` caller
in WalletRegistry.Upgrade.test.ts is unchanged.
Auto-fixed string-quote style (template literals without interpolation
back to plain double-quoted strings) and replaced two for-of loops in
00_log_external_deployments.ts with .forEach() / .filter() to satisfy
the no-restricted-syntax rule. The etherscanVerification test that
iterated over network names is split into two separate it() blocks
because no-restricted-syntax + no-await-in-loop forbid the for-of /
await pattern in tests.

No behavior change.
…4014)

## Context

Follow-up to PR #4001. Carries the gitignore-only hygiene commits that
previously rode on top of #4001's Sepolia artifacts so #4001 can stay
scoped to the deployment-snapshot work it advertises.

Subsequent commits on this branch will apply the deploy/config fixes
raised in review of #4001 (etherscan mainnet guard, HardhatUserConfig
typing, Sepolia named-accounts documentation, etc.) so logic deltas land
here rather than in the artifacts PR.

## What Changed

- gitignore \`gasReporterOutput.json\` in both \`solidity/ecdsa\` and
\`solidity/random-beacon\` (regenerated each test run).
- gitignore Yarn Berry runtime state (\`.yarn/install-state.gz\`,
\`.yarn/cache/\`, \`.yarn/build-state.yml\`) in
\`solidity/random-beacon\` to match the ecdsa package.

## Test Plan

- [ ] \`yarn install\` in both packages does not surface new untracked
files under the gitignored paths.
@lionakhnazarov lionakhnazarov force-pushed the stack/testnet4-03-deployment-artifacts branch from 3b156d8 to 979333c Compare June 5, 2026 11:33
Copy link
Copy Markdown
Member

@lrsaturnino lrsaturnino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants