Commit 4ea147c
feat(scripts): require DKG_CONTRACT_ADDRESS in AddKeyperSet
The AddKeyperSet deployment script now reads the DKG contract address
with vm.envAddress("DKG_CONTRACT_ADDRESS") instead of the
vm.envOr(..., address(0)) fallback, and calls setDKGContract
unconditionally. This is the deployment-path complement to the
on-chain addKeyperSet validation added in ef231f8: a zero DKG address
would now revert DKGContractNotSet at the contract call, so failing
earlier at env-resolution time with Foundry's clear "environment
variable not found" message is strictly better than a silent
zero-address branch that always fails downstream.
Key decisions:
- Scope limited to AddKeyperSet.s.sol per the PRD/issue. The byte-
identical AddKeyperSet.gnosh.s.sol is left untouched; it is not on any
automated path (the e2e add-keyper-set mise-task always invokes
AddKeyperSet.s.sol regardless of deployment type), so hardening it is
a separate, out-of-scope follow-up.
- No new forge test: scripts are not unit-tested in this repo, and the
new revert-on-missing-env behavior is Foundry framework semantics
(vm.envAddress), not our logic.
Files changed:
- script/AddKeyperSet.s.sol
Verification: forge clean && forge build clean (only pre-existing
unsafe-typecast lints in scripts/benchmarks); forge test 133/133 pass.
The e2e add-keyper-set task already derives DKG_CONTRACT_ADDRESS from the
deployed DKGContract (both Deploy.service and Deploy.gnosh create one),
so the success path is preserved.
Notes: e2e suite (test-dkg-happy-path, test-dkg-offline-recovery) not
run -- mise is absent and its mise.run | sh bootstrap is blocked by the
sandbox classifier (Code-from-External), as in every prior commit in
this PRD area. The change is a one-line deployment-script edit with no
ABI/runtime impact on correctly-configured keyper sets, so the Go e2e
flows are unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ef231f8 commit 4ea147c
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
0 commit comments