feat: add local_compilation mode for explorer-unverified contracts#192
Closed
arwer13 wants to merge 2 commits into
Closed
feat: add local_compilation mode for explorer-unverified contracts#192arwer13 wants to merge 2 commits into
arwer13 wants to merge 2 commits into
Conversation
Contracts without explorer-verified source can now be checked at the bytecode level: local_compilation.inputs maps an address to a local solc standard-JSON input (source manifest + compiler settings), and local_compilation.compiler pins the solc build. Source contents are still fetched from the pinned GitHub commit, and the source diff is skipped for these addresses since there is nothing explorer-side to diff against. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- load explorer token only when an in-scope (post-filter) contract needs it - reject local_compilation.inputs addresses missing from contracts - validate YAML unquoted hex keys under local_compilation.inputs - record skipped source stats for local contracts and show them in summary - warn when allowed_diffs.source rules are inert for local contracts - handle null settings in local solc input gracefully
tamtamchik
requested changes
Jul 16, 2026
tamtamchik
left a comment
Member
There was a problem hiding this comment.
The issue is that if you have sources to create an identical bytecode, you can put it to etherscan / blockscout / sourcify as verified. So I don't think this PR is actually worth to be included.
Contributor
|
Closing as the use case seems to be too exotic. |
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.
Contracts without explorer-verified source can now be checked at the bytecode level: local_compilation.inputs maps an address to a local solc standard-JSON input (source manifest + compiler settings), and local_compilation.compiler pins the solc build. Source contents are still fetched from the pinned GitHub commit, and the source diff is skipped for these addresses since there is nothing explorer-side to diff against.
Relation to
feat/local-compilation-modeThis PR implements the same feature as in
feat/local-compilation-modeand keeps its configschema verbatim (
local_compilation: {compiler, inputs}), so any config writtenfor either branch works with both. We propose landing this implementation because:
Rebased on current
main. The earlier branch forked ~82 commits back,before the
allowed_diffsmachinery and relatedprocess_configrefactors,and no longer applies cleanly. This one is written against today's
mainandcomposes with allowlists, caching, and the summary/suggestion output.
Local contracts reuse the explorer normalization path. The payload is built
via the existing
_build_contract_payload/_attach_contract_metadatahelpersinstead of by hand, so EVM-version normalization and library re-keying to the
definition file (required for correct solc linking) apply to local inputs
exactly as they do to explorer bundles.
More guardrails. All-local configs need no explorer hostname/chain-id/token
at all; unknown addresses in
local_compilation.inputsare flagged; a configwhose local contracts would get zero verification (bytecode comparison off)
warns; the skipped source diff is logged per contract rather than silent;
malformed/empty solc inputs are rejected with clear errors.
Docs and tests included. README section (schema + why a full-bytecode match
incl. the CBOR metadata tail is sound evidence for guessed settings), CLAUDE.md
schema note, and tests covering error paths (malformed JSON, empty sources,
absolute/relative input paths).