Skip to content

fix: drop remote signers when deployer keys are absent - #379

Closed
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
INFOSEC-677-ci-test-jobs-secrets-pt1
Closed

ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
INFOSEC-677-ci-test-jobs-secrets-pt1

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

What

  • hardhat.config.ts: on export, any remote network whose account list is not composed entirely of valid 32-byte keys gets accounts: []; fully configured networks keep their exact account lists. The in-process hardhat network's static local accounts are untouched.

Why

  • hardhat.config.ts interpolated deployer-key env vars straight into every network's accounts list, so hardhat's config validation rejected the "undefined" strings unless CI passed real deployer keys to the test step. This is why branch-push tests were given live deployer/Batcher-owner private keys (CWE-522, least-privilege failure — INFOSEC-677).
  • Tests run on the in-process hardhat network and need no remote signers, so they now pass with zero secrets. A network with missing keys fails closed with zero signers instead of signing with any substitute key; deploy jobs set every key their target networks need and are unaffected.

Test plan

  • npm run test with no deployer/explorer env vars set: 280 passing
  • npm run lint clean
  • Throwaway script through the real hardhat config loader: no keys → eth/hteth/tbsc/tzksyncera account lists [] while the hardhat network keeps its 10 static accounts; keys set → account lists preserved exactly; partially configured network (topeth) → []

Stack

This PR is part 1 of 2 in a stack. Review and merge in order:

  1. (this PR) hardhat config: fail closed without deployer keys (base: master) ← you are here
  2. #380 — CI: strip secrets from test jobs (base: INFOSEC-677-ci-test-jobs-secrets-pt1)

Ticket: INFOSEC-677

hardhat.config.ts interpolated deployer-key env vars straight
into every network's accounts list, so hardhat's config
validation rejected the "undefined" key strings unless CI
passed real deployer keys to the test step. That is why
branch-push tests were given live deployer/Batcher-owner
private keys (CWE-522, least-privilege failure).

Normalize the config on export instead: any remote network
whose account list is not composed entirely of valid 32-byte
keys gets no accounts at all. Tests run on the in-process
hardhat network (static local accounts) and need no remote
signers, so they now pass with no secrets (280 passing).
Deploy jobs set every key their target networks need and are
unaffected; a network with missing keys fails closed with zero
signers instead of signing with any substitute key.

Ticket: INFOSEC-677
Session-Id: c47168cb-4390-40bd-afdb-63ea17715cd1
Task-Id: 29537b41-b596-4b31-b76e-4b0bedddeb59
@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

INFOSEC-677

This branch had an error being deployed

1 failed deployment
dev — fadb2911 Deployed Oct 13, 2026 by ralph-bitgo[bot] via lint-and-test (18.x) #1952
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