verify: point Sourcify at Rome's own instance, and sweep a network's deployments - #303
Merged
Conversation
…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.
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.
hardhat verifywas submitting to sourcify.dev, which answers "Chain 200010 not found" — it has never heard of these chains. Settingverify.sourcify.apiUrlto 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:
BatchReaderPythPullAdapterImplSwitchboardV3AdapterImplCachedPythAdapterImplCachedFeedAdapter--contract, a test harness in the tree shares its bytecodeBefore:
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 indeployments/<network>.json, skips what is already verified, and names what it could not do: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.package-lock.jsonis deliberately untouched — installing on macOS stripslibcentries that a Linux install adds, and shipping that would churn CI installs.Companion: contract-deploys wires this into the five deploy workflows.