Repository navigation
Conversation
|
Contributor
|
| Branch | sourcify-output-checks |
| Testbed | ci |
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
🚨 2 Alerts
🐰 View full continuous benchmarking report in Bencher
nebasuke
added this pull request to stack #2201
September 25, 2026 12:59
nebasuke
force-pushed
the
sourcify-output-checks
branch
2 times, most recently
from
October 9, 2026 15:58
ce5c468 to
545c48b
Compare
nebasuke
force-pushed
the
sourcify-output-checks
branch
3 times, most recently
from
October 9, 2026 18:29
8375d35 to
56b619c
Compare
This was referenced Oct 9, 2026
Contributor
Sourcify corpus run for bc4e122
Known issues
Deliberate deviations (9725 contracts)
Checks skipped:
Gate: passed. |
nebasuke
force-pushed
the
sourcify-output-checks
branch
from
October 9, 2026 20:01
2c330e0 to
ba297dd
Compare
Every corpus record carries the storage layout the verifying solc produced for its deployed contract. `storage_layout` compares each item's label, slot and offset with it and `storage_types` the type spelling against solc's label, kept apart because the spelling is the softer of the two: over the whole corpus not one slot, offset or label differs, while 699 contracts spell a function type as `function` (#2196). The record names only the target file, so the target is its single concrete contract or library, or the one solc's layout names; `target_contract`, which the next corpus release will carry, wins when present. Checks a record cannot run are counted with their reason.
The report counts a bucket's contracts by its failures, one per contract and code as the diagnostics produce them. The storage check emitted one failure per mismatching variable, so the #2196 bucket read 699 contracts for 582, and the rule that small issue entries must list their contracts counted variables.
`storage_types` now follows each item's type through both tables at once (array bases, mapping keys and values, struct members) and compares label, numberOfBytes and encoding, instead of the item's type label alone. The two tables key types differently, so they are paired by walking, not by name. The same checks run on `transientStorageLayout`. The #2196 entry goes:
solc reports `numberOfBytes` of a `uint256[2**255]` storage gap as 0, the slot count times 32 wrapped to 256 bits; saturating it flagged seven corpus contracts that Slang lays out exactly as solc does.
Pairs Slang's ABI JSON with solc's `abi` by type, name and input types, then compares each pair field by field (down through parameters and components) and the order of the pairs, since Slang orders the ABI as solc does. Unpaired entries are `missing` or `extra`. A fixture compiled with solc 0.8.30 covers every entry type, overloads, a library error and event, a struct parameter and getters.
`below = "0.8.20"` limits an entry to contracts compiled with an older solc, so a deliberate divergence from a solc bug fixed in a later release still fails the gate on contracts from that release on.
A library event can share its signature with the contract's own, and solc before 0.8.20 lists only the contract's. Pairing the first same-keyed entry turned the extra event into a field mismatch on the real one (44 contracts in the census: input names, `indexed`, `internalType`).
solc 0.8.20 fixed its ABI to list the events a contract emits but does not define, and reworked event collection so same-named events follow declaration order. Slang has both at every version: deliberate below 0.8.20, so the gate still catches either from 0.8.20 on. Four missing errors follow from #2194's import cycles.
nebasuke
force-pushed
the
sourcify-output-checks
branch
from
October 9, 2026 23:33
ba297dd to
bc4e122
Compare
This branch has not been deployed
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.
Claude summary`.
New title (
gh pr edit 2199 --title):feat(testing): check the ABI and storage layouts against solc's artifactsClaude summary
Checks Slang's outputs against what the verifying solc produced. Every corpus record carries solc's
abi,storageLayoutand, from 0.8.27,transientStorageLayoutfor its deployed contract, so theoracle needs no solc binary and the checks add seconds to a run.
ABI (
abi). Slang's ABI JSON (#2136) is paired with solc's entry by entry, by type, name andinput types, an exactly equal entry first. A pair must match field by field, down through
parameters and tuple components (
[*].stateMutability,[*].inputs.internalType, …), and thepairs must come in solc's order, which Slang reproduces: type, then name, then selector for
overloaded functions and declaration position for events and errors. Unpaired entries are
missingor
extra; theorderfailure names the first two entries out of place.Storage (
storage_layout,storage_types, and their transient twins). The layout checkcompares each variable's label, slot and offset with solc's list, in order. The types check walks
each variable's type through #2215's types table and solc's side by side, through array bases,
mapping keys and values and struct members, comparing label,
numberOfBytes(modulo 2^256, as solccounts a
uint256[2**255]gap) and encoding. The two tables key types differently (TypeIdagainstsolc's
t_...names), so they are paired by walking, not by name.Which contract. The record names the target file. The target is the record's
target_contractwhen it has one, else the file's single concrete contract or library, else thecontract solc's storage layout names. Records still ambiguous (18,524) skip the output checks with
a counted reason; the next corpus release carries
target_contractfor all of them.Counted per contract. A contract's mismatches become one failure per code with a count, as its
diagnostics do, so bucket sizes and the rule that small issue entries list their contracts count
contracts, not variables or entries.
Version-bounded entries. An expected failure can carry
below = "0.8.20"and then covers onlycontracts compiled with an older solc. solc 0.8.20 fixed its ABI to list the events a contract
emits but does not define (its changelog files it under Bugfixes) and, with the same rework, ordered
same-named events by declaration instead of most derived contract first. Slang has both at every
version: two deliberate entries below 0.8.20, so either difference still fails the gate from 0.8.20
on.
Fixtures.
testdata/corpusgains two records compiled with solc 0.8.30: every entry type,overloads, a library error and event, a struct parameter and getters for the ABI; structs,
fixed and dynamic arrays, nested mappings, a recursive struct,
bytes/string, an enum, auser-defined value type, a contract and a function type, a 2^255-slot gap and transient variables
for storage.
Not here:
evm.methodIdentifiers(library functions hash struct names that the ABI spells astuple, so only solc's own output can be the oracle; it comes with the next corpus release), andNatSpec.
Numbers
Whole corpus (2,326,676 contracts), locally, this branch's head:
abiextraand 1,164order(6 contracts have both), all below 0.8.20 and deliberate; 4missingunder #2194storage_layout/storage_typestransient_storage_layout/transient_storage_typesThe gate passes with
--stale-check.