Repository navigation
feat(satin): follow the Satin specification for SLOTNUM, Oracle hints and the oracle service, KeylessDeploy recognition and activation blocks - #417
Draft
RealiCZ wants to merge 232 commits into
Conversation
…authority growth test pins the node's answer
…om the parent timestamp
# Conflicts: # docs/spec/upgrades/satin.md
…est runs all of it
…w for a value transfer
…z property now reads it
…onformance case pins
…conformance case pins
…sa-eest-wave-2-keyless
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.
Summary
Stacked on #409 (
cz/feat/satin-w10). Changes that make the Satin engine follow the published Satin specification where it did not yet, in three batches:SLOTNUM, Oracle hints and the oracle service, KeylessDeploy recognition, and the activation-block rules, and makes CI run the whole byte-price grid and the long fuzz run on every pull request;The follow-ups from each batch's two reviews are in this branch.
The branch also makes CI gate on Mega EEST, the conformance suite both Satin implementations share, takes main's faster mutation CI (#419), and deletes the tests the suite now duplicates.
Behaviour changes (Satin only)
Earlier specs run on the released legacy engine and are not touched.
First batch
SLOTNUMpushes zero, whatever slot number the block environment carries; the read stays a volatile read, marked and refusable as before. The value no longer depends on a field the node supplies, so a stateless validator needs no slot number.SATIN-BASE-005,SATIN-WIT-010sendHintis admitted, forwarded and counted like any other: only the value condition is dropped from the admission gate. A call with no gas is still dropped; a value call's gas includes its stipend, and a transaction's own call is judged on its first frame's whole gas.SATIN-ORCL-006,SATIN-ICPT-003SATIN-ORCL-005,SATIN-BASE-008(bytes, uint256); a call whose arguments do not decode runs the contract's bytecode and is charged no overhead. The arguments are decoded once and passed along.SATIN-ICPT-006,SATIN-KEY-005MegaBlockExecutionCtx::newtakes the parent timestamp as a requiredOption<u64>; the two caller-set flags and their setters are gone, andDefaultis removed.mega-evmeand the state-test runner pass the real parent timestamp.SATIN-ACT-010,SATIN-BASE-006Second batch
SLOADcharges nothing before the read: it loads the slot, asks the service where it is asked, and marks the read at the compute before the opcode, then charges the 2,100 as one charge, so gas detention judges its crossing on the whole of it. A read that then runs out of gas or crosses keeps its mark. Any otherSLOADkeeps its two charges in the same order as before.SATIN-DET-003,SATIN-ORCL-004,SATIN-WIT-012,SATIN-DET-018VolatileDataAccessDisabledon the gas it held when the opcode was reached, also below the opcode's static gas or what its body would charge. Opcodes volatile whatever their operands are refused before their operands are checked; an account, call,SELFDESTRUCTor Oracle read keeps the all-operands check and is then refused before its body. A call target's one-hop delegate is resolved for the check as a required read: its database errors are surfaced and nothing is warmed. To refuse below the static gas, the wrapped opcodes charge their static gas themselves (the instruction table carries zero for them).SATIN-MAC-003,SATIN-MAC-004,SATIN-MAC-007,SATIN-VAL-010SATIN-PCMP-007,SATIN-DET-023,SATIN-DET-024SATIN-WIT-003,SATIN-WIT-011,SATIN-PBLK-003,SATIN-BASE-010SATIN-BLK-003,SATIN-BLK-006,SATIN-BLK-007,SATIN-BLK-011,SATIN-BLK-013SATIN-AUTH-001,SATIN-AUTH-005,SATIN-WIT-004Third batch
SELFDESTRUCT's new beneficiary, 20,000 for aCREATE's or a keyless creation's account. Gas detention keeps excluding what regular gas paid for state and history, also after it is given back. KeylessDeploy'sgasUsedis the net spend across both pools. A first frame's halt returns only the reservoir-paid part of the charges made before it. The change is in the revm fork, behind a configuration switch whose default keeps upstream EIP-8037 behaviour; only Satin's configuration turns it on (the neutral configuration keeps it off), and the fork pin moves to it.SATIN-HIST-012,SATIN-POOL-008,SATIN-POOL-012,SATIN-POOL-014,SATIN-POOL-015,SATIN-POOL-024,SATIN-STATE-012,SATIN-SD-005,SATIN-DET-009,SATIN-KEY-005,SATIN-KEY-015,SATIN-TAKE-002–011SATIN-HIST-016,SATIN-HIST-022,SATIN-MST-008,SATIN-MST-010,SATIN-DEP-001,SATIN-DEP-005,SATIN-TAKE-012MegaHardforks::sequencer_registry_bootstrap) and a schedule that activates Satin without them, or with a zero one, is refused byvalidate_schedule;MegaContext::new_with_system_addressbuilds a context that reads nothing for the address.SATIN-SYSC-003,SATIN-REG-002,SATIN-REG-004,SATIN-REG-008,SATIN-REG-009,SATIN-ACT-004,SATIN-ACT-005,SATIN-ACT-012,SATIN-PBLK-003,SATIN-WIT-008VolatileDataAccessDisabled(10), or is stopped by gas detention when the surcharge crosses. The value transfer and the refused delegate's access are not paid. Every direct refusal stays free. The up-front delegate lookup is gone.SATIN-MAC-003,SATIN-MAC-004,SATIN-MAC-007,SATIN-DET-018,SATIN-OUT-008,SATIN-STOP-020,SATIN-PCMP-008,SATIN-WIT-012untouched_call_gas,untouched_create_gas,synthetic_frame_resultandsynthetic_call_resulttake the configuration.Tests and CI
MemoryDatabase) applies EIP-161 on commit: a touched empty account is removed, as revm'sStatedoes; the EIP-7702 authority test now pins the committed answer exactly.price-grid.ymlruns the whole grid on every pull request, andfuzz.ymlruns the long fuzz (release and debug) and the price-monotonicity check on every pull request. Ascheduletrigger fires only on the default branch andworkflow_dispatchneeds the workflow on the default branch, so neither ran on this line before.slotnum-pushes-zero, lists the twelve Amsterdameip7843_slotnumentriesSLOTNUMpushing zero changes, with the state roots Satin produces.The Mega EEST gate
scripts/mega_eest.shruns every gating case of the pinned Mega EEST commit (scripts/mega_eest.env) on this tree, plain and instrumented. The suite's revm adapter is built against this checkout, with this tree's[patch]blocks and lock, so a pull request that moves the revm fork is tested with its own fork. The script runs only the binaries this build produced.scripts/mega_eest.env, or changes the repository without declaring the move. The deliberately wrong expectation decides only when every gating case passes..github/workflows/mega-eest.ymlruns the script on every pull request and push tosatin, andMega EEST gaterequires a full run on a default-branch pin. It becomes a required check once an administrator adds it to the branch rule.Tests the conformance suite duplicates
crates/mega-evm/srcloses coverage against the remaining tests plus the suite's run, and every mutant the deleted tests killed is still killed by a remaining test or by the suite on the mutated tree.990447bc(1,196 cases, quarantine empty; three changed cases declared): the completed fill wave, its ninth batch and a follow-up that sends Oracle hints from a nonzero memory offset and ordinary transactions from an absent sender, with a consumer that also runs every case requiring gas pools uninspected, so the engine's default execution loop is checked too. The gate now checks the suite's deliberately wrong controls in every mode, matched by their indexed file, in both of their forms (a recorded failing path, or a recorded error message), and rejects a report whose own mode field disagrees with the run.Outcomes
An outcome differential against #409's head over the pinned execution-spec fixtures (main
v5.4.0, glamsterdam devnetv8.1.0; equivalence mode, Satin mode and tightened limits; 19,465 Osaka and 15,754 Amsterdam transactions) differs only where intended:SLOTNUMentries, in equivalence and Satin mode;modexpRandomInputtransactions per run, a direct call to ModExp with an over-bound input and less gas than its formula price, whose halt reason changes from a precompile error to out-of-gas (go-ethereum's answer); gas, state and logs are equal;For the third batch, against the second batch's head over the same fixtures:
sstore_combinationsandtest_create_deposit_oog). A loop that watchesGASstops earlier, because give-backs no longer refill regular gas.The execution-spec gate passes with the counts pinned. The Mega EEST suite at
990447bcpasses in full on this branch (1,196 cases, plain and instrumented, gas-pool cases also uninspected); its quarantine is empty.Verification (local)
At this branch's head:
cargo sort, clippy with-D warnings, all-target andno_stdchecks;forge test, the docs lint;-D warnings, MSRV 1.94.0;Review
Each batch had two independent reviews; both approve, with no open high-impact finding.
First batch follow-ups:
sendHintand for the non-canonical argument encodings KeylessDeploy recognizes;Second batch follow-ups:
Third batch follow-ups:
The Mega EEST gate had two independent reviews over four rounds; both approve. Their findings are fixed in this branch: a failure before the suite's verdict credited as a mutation kill, a stale adapter binary, empty mode lists, unchecked pin provenance and case changes, re-sharded follow-up runs, and cut-off shard records.
The orders the first batch's reviews found unstated were added to the specification in RealiCZ/mega-evm-satin-spec#3; the Satin implementation on evm2 behaves the same way.
Not in this PR
The remaining alignment item follows in a later batch: the removal of Oracle read records from the outcome.