Skip to content

Update EIP-8141: align SIGPARAM copy operand order with CALLDATACOPY - #8

Draft
Marchhill wants to merge 1 commit into
sigparam-order-basefrom
sigparam-order-patch
Draft

Update EIP-8141: align SIGPARAM copy operand order with CALLDATACOPY#8
Marchhill wants to merge 1 commit into
sigparam-order-basefrom
sigparam-order-patch

Conversation

@Marchhill

Copy link
Copy Markdown
Owner

SIGPARAM's copy form (param == 0x04) lists its memOffset/dataOffset/length operands in the reverse of the CALLDATACOPY/CODECOPY/RETURNDATACOPY convention, and the reverse of the sibling FRAMEDATACOPY — which was aligned to that convention in ethereum#11938. This aligns SIGPARAM's copy operands with FRAMEDATACOPY/CALLDATACOPY (memOffset, dataOffset, length, top to bottom), removing the internal inconsistency.

The two orders differ observably for asymmetric operands (wrong pop order gives the wrong source/destination, hence wrong memory and state root), so aligning them removes a correctness footgun.

This is a normative change: an implementation following the current reversed order must flip its SIGPARAM copy handling. If instead the reversed order is intended, an explicit stack table documenting it would resolve the inconsistency the other way — but matching the established convention and the already-fixed FRAMEDATACOPY is the safer default.

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