Apply suggestions from code review

This commit is contained in:
Jonny Rhea 2026-03-03 09:26:28 -06:00 committed by GitHub
parent 095326d6e0
commit 70a7ec6a23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -947,6 +947,7 @@ func opSelfdestruct6780(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, erro
} }
// decodeSingle decodes the immediate operand of a backward-compatible DUPN or SWAPN instruction (EIP-8024) // decodeSingle decodes the immediate operand of a backward-compatible DUPN or SWAPN instruction (EIP-8024)
// https://eips.ethereum.org/EIPS/eip-8024
func decodeSingle(x byte) int { func decodeSingle(x byte) int {
// Depths 1-16 are already covered by the legacy opcodes. The forbidden byte range [91, 127] removes // Depths 1-16 are already covered by the legacy opcodes. The forbidden byte range [91, 127] removes
// 37 values from the 256 possible immediates, leaving 219 usable values, so this encoding covers depths // 37 values from the 256 possible immediates, leaving 219 usable values, so this encoding covers depths
@ -959,6 +960,7 @@ func decodeSingle(x byte) int {
// instruction (EIP-8024) into stack indices (n, m) where 1 <= n < m // instruction (EIP-8024) into stack indices (n, m) where 1 <= n < m
// and n + m <= 30. The forbidden byte range [82, 127] removes 46 values from // and n + m <= 30. The forbidden byte range [82, 127] removes 46 values from
// the 256 possible immediates, leaving exactly 210 usable bytes. // the 256 possible immediates, leaving exactly 210 usable bytes.
// https://eips.ethereum.org/EIPS/eip-8024
func decodePair(x byte) (int, int) { func decodePair(x byte) (int, int) {
// XOR with 143 remaps the forbidden bytes [82, 127] to an unused corner // XOR with 143 remaps the forbidden bytes [82, 127] to an unused corner
// of the 16x16 grid below. // of the 16x16 grid below.