format: resolve external-call invoke operands before the instruction - #303
Merged
Merged
Conversation
Contributor
|
#281 made instruction contexts postconditions, pointers included, but the invoke schema kept the sentence that placed pointers "at the instruction's trace step", and its CALL, DELEGATECALL and CREATE2 examples point at stack operands that those instructions consume. The invoke context stays on the call instruction: the invocation occurs when that instruction executes. The pointer fields of a `message` or `create` invocation (target, gas, value, input, salt) describe the operands of the marked instruction, so they resolve against the state immediately before it executes. The instruction schema names this as the one exception to the postcondition rule. Internal calls need no exception: the entry JUMPDEST leaves the stack unchanged. The external-call return example no longer leans on the pre-state reading: its pointers resolve after the marked instruction, as with any context. No schema keyword changes. No producer emits `message` or `create` invokes today, and no consumer resolves their pointers.
gnidan
force-pushed
the
architect-invoke-operands
branch
from
September 17, 2026 06:14
8d9f021 to
77b6a09
Compare
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.
#281 made instruction contexts postconditions, pointers included. ethdebug/format/program/context/function/invoke kept the sentence that placed pointers "at the instruction's trace step", and its CALL, DELEGATECALL and CREATE2 examples point at stack operands that those instructions consume, so the examples were wrong under the rule that the instruction schema states.
The invoke context stays on the call instruction, because the invocation occurs when that instruction executes. What changes is the stated reading of its pointer fields:
target,gas,value,inputandsaltof amessageorcreateinvocation describe the operands of the marked instruction, so they resolve against the machine state immediately before it executes. This is the same shape as DWARF call-site parameters, whose values are defined at the time of the call. ethdebug/format/program/instruction now names this as the one exception to the postcondition rule. Internal calls need no exception: the invoke sits on the callee's entry JUMPDEST, which leaves the stack unchanged.ExternalCallandContractCreationdefinitions state the operand rule; the example comments say "the state before the CALL executes" rather than "the pre-execution state visible in the trace step". The JUMPDEST guidance is reworded to stand under postconditions.contextdescription points at the exception.No schema keyword changes, and no example value changes. No producer emits
messageorcreateinvokes today (bugc emits internal calls only; solc emits no function contexts yet), and no consumer resolves these pointers (soldb reads onlyidentifier,declarationandactivation), so nothing in the reference implementation needs to follow.The spec changelog gets an Unreleased entry: no change for producers, and
required:for consumers, who resolve these operand pointers before the marked instruction. It also re-wraps one overlong line in the changelog intro.Fixes #302