Skip to content

verify: point Sourcify at Rome's own instance, and sweep a network's deployments - #303

Merged
anil-rome merged 1 commit into
masterfrom
verify-sourcify
Jul 27, 2026
Merged

verify: point Sourcify at Rome's own instance, and sweep a network's deployments#303
anil-rome merged 1 commit into
masterfrom
verify-sourcify

Conversation

@anil-rome

Copy link
Copy Markdown
Contributor

hardhat verify was submitting to sourcify.dev, which answers "Chain 200010 not found" — it has never heard of these chains. Setting verify.sourcify.apiUrl to Rome's own instance is the whole fix. Etherscan and Blockscout are switched off rather than left to fail on every run, since no Rome chain is listed on either.

Proven against live deployments

Five contracts that were unverified on Hadrian now verify with one command each:

BatchReader
PythPullAdapterImpl
SwitchboardV3AdapterImpl
CachedPythAdapterImpl
CachedFeedAdapter ✅ — needs --contract, a test harness in the tree shares its bytecode

Before: HHE80002 … sourcify.dev … "Chain 200010 not found". After: ✅ Contract verified successfully on Sourcify, and the verifier's read endpoint flips 404 → 200.

The sweep, and why it classifies instead of counting failures

scripts/verify-deployments.sh <network> walks every address in deployments/<network>.json, skips what is already verified, and names what it could not do:

of 50 addresses in the manifest:
  already verified 9 · newly verified 0 · need a human 1 · drifted 8 · not this project's 32
  • not this project's (32) — no solc metadata or no bytecode: precompile handles and foreign contracts. The manifest is full of them, and counting them as gaps would make the summary useless.
  • need a human (1) — a constructor takes arguments the manifest does not record.
  • drifted (8) — bytecode matches nothing in current source. This is the bucket that matters: those addresses can never be verified now, because the source that produced them has moved on. It is the argument for verifying at deploy time, which the companion CI change does.

Advisory by design — exits 0, so it can run after a deploy without ever failing one.

Two things I got wrong while building it

  • mapfile — macOS ships bash 3.2, which does not have it. A script that only runs on the CI runner is one nobody can check locally, so it uses a read loop.
  • The already-verified pre-check had no retry, so a single timeout reclassified a verified contract as a gap and the counts moved between runs. It retries once; the summary is now stable across consecutive runs.

package-lock.json is deliberately untouched — installing on macOS strips libc entries that a Linux install adds, and shipping that would churn CI installs.

Companion: contract-deploys wires this into the five deploy workflows.

…deployments

`hardhat verify` was submitting to sourcify.dev, which answers "Chain 200010 not
found" because it has never heard of these chains. Setting verify.sourcify.apiUrl to
Rome's own instance is the whole fix; Etherscan and Blockscout are switched off
rather than left to fail on every run, since no Rome chain is listed on either.

Proven against live deployments rather than in the abstract — five contracts that
were unverified on Hadrian now verify with one command each: BatchReader,
PythPullAdapterImpl, SwitchboardV3AdapterImpl, CachedPythAdapterImpl, and
CachedFeedAdapter (that one needs --contract, because a test harness in the tree
shares its bytecode).

scripts/verify-deployments.sh sweeps every address in deployments/<network>.json,
skips what is already verified, and classifies what it cannot do rather than
reporting a bare failure count:

  · needs --contract              bytecode matches several contracts
  · needs --constructor-args-path constructor takes arguments, and the values are
                                  not in the manifest
  · not this project's            no solc metadata or no bytecode — a precompile
                                  handle or a foreign contract, of which the
                                  manifest holds 32
  · drifted                       bytecode matches nothing in current source

That last bucket is the reason to verify at deploy time: on Hadrian eight addresses
are in it, and no amount of care later will verify them, because today's source no
longer produces that bytecode.

Advisory by design — exits 0 so a deploy is never failed by a verification quirk.
A read loop rather than mapfile, because macOS ships bash 3.2 and a script that only
runs on CI is one nobody can check locally; and the already-verified pre-check
retries once, or a single timeout moves the counts between runs.
@anil-rome
anil-rome merged commit a48ad33 into master Jul 27, 2026
9 checks passed
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.

1 participant