Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/vm: don't use iota for opcode definitions #23928

Merged
merged 1 commit into from Nov 23, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Nov 18, 2021

This cleans up a pet peeve I've had for years.

iota is useful when we don't really care what number something winds up with, we just want an enum-like thing which has a certain ordering between elements.

Opcodes, however, are externally defined. It's IMO wrong to assign them by using iota, as if we don't really care what number CALL maps to internally.

Aside from that, having it directly defined as in this PR makes it easier to check a particular opcode-to-byte with eyes alone, without relying on IDE magic to infer the actual number for you.

@karalabe karalabe added this to the 1.10.13 milestone Nov 23, 2021
Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe merged commit 50e07a1 into ethereum:master Nov 23, 2021
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Nov 23, 2021
core/vm: don't use iota for opcode definitions
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 23, 2024
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 26, 2024
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 27, 2024
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 27, 2024
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants