Skip to content

feat(EthVmInstructions): implement ADD and SUB with local laws - #418

Open
alexanderlhicks wants to merge 1 commit into
feat/vm-stopfrom
feat/vm-arithmetic
Open

alexanderlhicks wants to merge 1 commit into
feat/vm-stopfrom
feat/vm-arithmetic

Conversation

@alexanderlhicks

Copy link
Copy Markdown
Owner

Implement ADD and SUB with twelve ordinary local laws. Both pop before charging:
empty underflow keeps the original frame, singleton underflow retains its first
pop, and OOG retains both pops. Success wraps top plus/minus next, charges only the
selected configured opcode price and advances PC, preserving the other complete
frame/meter fields and world. Public Stack laws prove room for the result push.

Depends on #416 (feat/vm-stop). Source: pinned EELS
src/ethereum/forks/amsterdam/vm/instructions/arithmetic.py:25–49,52–76 at
59c1473ddfba341babaeca1c97a50e996f639a0b.

The eight generic case equations require Monad alone and retain literal underlying
pure. Four Id accounting/progress laws admit every raw selected Nat price, including
zero; strict progress requires only local positivity. Source agreement specializes
the selected price to 3. Native/interpreted controls compare 82 complete frames;
60 genuine source calls cover price3, with 22 other-price cases explicitly Lean-only.
Strict parser regressions run normally and under -O.

All 165 required commands passed in author, ROOT and two independent review lanes
on tree 11f55084de57f14468417f2c060203b0ffa1329b. Daemon recovery preserved genuine passing prefixes
and ran only unfinished suffixes in isolated caches; unknown original outer exits
were uncredited. ROOT audited 31,785 declarations with zero findings
and replayed 547 modules. Both fresh independent reviews are CLEAN; ROOT evaluation
preceded commit. No guest/EEST execution is claimed.

EthVmInstructions §§3/4/5/7/10, generated GAPS, COMPOSITION and REVIEW own the
updated contracts/source-test rows and remaining boundaries; facades, Lake target,
CONTRIBUTING and core CI include the controls. No provider, pin, dependency, decision
or settlement policy changes. Source-world/trace/reachability, dispatch/step and
composed execution/fuel/resource/guest gates remain open.

Generated with Codex.

Retain ordered destructive-pop failures and complete frame/world values;
charge independent configured prices and prove push availability. Supply
eight generic case laws and four Id accounting/conditional progress laws.
Add full native/interpreted/source controls and strict parser regressions.

All 165 required commands pass in four isolated lanes using authenticated
original prefixes and fresh recovery suffixes; two independent reviews CLEAN.
ROOT evaluation precedes this exact-tree commit; broader VM gates stay open.

Co-Authored-By: Codex <noreply@openai.com>

@alexanderlhicks alexanderlhicks left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 3b2e82836bc5855c9e36bbc3f631593024723ab4 (tree 11f55084de57f14468417f2c060203b0ffa1329b): CLEAN_SCOPED_WORK_ITEM for the new ADD/SUB slice. Whole-head cleanliness remains false while the inherited documentation finding below is open.

The handlers preserve the pinned order: first pop, second pop, independently selected execution charge, wrapping arithmetic, push and exact Nat PC successor. Empty-stack, singleton and out-of-gas branches retain their complete residual frames. The eight generic case laws keep the complete world and literal underlying Monad pure; four Id laws establish exact selected-price accounting and strict progress with its positive-price premise. No additional generic effect law is assumed.

All 165 literal CONTRIBUTING §6.3 commands passed in each of three fresh isolated checkouts. Each lane audited 31,785 declarations with zero findings and replayed all 547 kernel modules. Both independent final reports, original closed command streams, all 27 producer outputs per lane, source identities and byte-compared own-cache archives were authenticated. The 82 complete native/interpreted controls cover operand order, wrapping, partial failures, zero/large raw prices, full stacks, huge PC and all frame/meter fields. Runtime world observations remain sampled sentinels; arbitrary whole-world preservation belongs to the ordinary laws.

A separate current A phase passed authenticated preflight and 60 original pinned ADD/SUB calls in normal isolated Python: 30 per opcode at the source price of three. Root read and authenticated its original waits/streams, current 82-row native/interpreted captures, full phase manifest, complete 26-field source Evm observations, all nine related Lean frame fields, caught failures, the 1,121-file pin inventory and loaded runtime/dependency identities. The other 22 raw-price cases remain Lean/mathematical controls. A’s full checklist finished before its reference recorder encountered an uninitialized Git submodule; that failed source attempt made zero calls. A corrected recorder then ran only the unfinished source phase and final sealing, preserving every completed check and producer. This phase reused A's own previously authenticated frozen #416 reference environment and raw locked numeric/RLP wheels, with its recorded before/after identity checks; it started new source processes and repeated no STOP calls. Root and B ran no additional original-source phase. Other dependencies retain the recorded installed-RECORD/locked-version and trusted-startup limits. These are direct-body observations with running/output/error preserved; interpreter settlement and source-world/dispatch/guest agreement remain outside their scope.

The material #408 documentation finding remains open. Oversized single-node raw-decoder probes exceed guest SSZ admission and do not establish the promoted guest divergence. The local arithmetic laws do not rely on that claim; this scoped verdict does not waive it.

Independent source audits retain their original chronology and auxiliary corrections. Local uv 0.8.17 differs from CI's 0.13.6; literal uv/Python 3.12 commands were retained without a claim of environment equivalence. Current-main integration, guest/EEST, resource, cost, security and readiness results remain separate. This review made no tracked edits, fixes, commits, pushes or merges.

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