Skip to content

Commit d805bab

Browse files
committed
resolve merge conflicts
2 parents af10b48 + 6c8faf5 commit d805bab

File tree

164 files changed

+2171
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+2171
-398
lines changed

.flake8

Lines changed: 0 additions & 32 deletions
This file was deleted.

lists/evm/proposed-opcodes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ unshipped EIPs, even withdrawn and non-viable proposals.
77
| EIP | Opcode | Name | Description |
88
|------------------------------------------------------------------------|--------|--------------------|------------------------------------------------------------------------------|
99
| [101](https://eips.ethereum.org/EIPS/eip-101) | 0x5C | tx.gas | primordial account-abstraction support |
10-
| [141](https://eips.ethereum.org/EIPS/eip-141) | 0xFE | INVALID/ ABORT | Designated invalid opcode. <br />(Adopted in practice, Not formally adopted) |
10+
| [141](https://eips.ethereum.org/EIPS/eip-141) | 0xFE | INVALID/ABORT | Designated invalid opcode. <br />(Adopted in practice, Not formally adopted) |
1111
| [615](https://eips.ethereum.org/EIPS/eip-615) | 0xB0 | JUMPTO | static jump |
1212
| [615](https://eips.ethereum.org/EIPS/eip-615) | 0xB1 | JUMPIF | static conditional jump |
1313
| [615](https://eips.ethereum.org/EIPS/eip-615) | 0xB2 | JUMPV | static jump table |
@@ -51,8 +51,8 @@ unshipped EIPs, even withdrawn and non-viable proposals.
5151
| [3508](https://eips.ethereum.org/EIPS/eip-3508) | 0x49 | ORIGINDATACOPY | Bulk load transaction calldata |
5252
| [3520](https://eips.ethereum.org/EIPS/eip-3520) | 0x4A | ENTRYPOINT | To address of transaction |
5353
| [4200](https://eips.ethereum.org/EIPS/eip-4200) | 0xE0 | RJUMP | relative jump |
54-
| [4200](https://eips.ethereum.org/EIPS/eip-4200) | 0xE1 | RJUMI | relative conditional jump |
55-
| [4200](https://eips.ethereum.org/EIPS/eip-4200) | 0xE2 | RJUMV | relative jump table |
54+
| [4200](https://eips.ethereum.org/EIPS/eip-4200) | 0xE1 | RJUMPI | relative conditional jump |
55+
| [4200](https://eips.ethereum.org/EIPS/eip-4200) | 0xE2 | RJUMPV | relative jump table |
5656
| [4520](https://eips.ethereum.org/EIPS/eip-4520) | 0xEB | - | Reserve for multi-byte opcodes |
5757
| [4520](https://eips.ethereum.org/EIPS/eip-4520) | 0xEC | - | Reserve for multi-byte opcodes |
5858
| [4750](https://eips.ethereum.org/EIPS/eip-4750) | 0xE3 | CALLF | EOF Subroutine Call |

network-upgrades/mainnet-upgrades/cancun.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Execution layer changes included in the Network Upgrade.
55

66
* [EIP-1153: Transient storage opcodes](https://eips.ethereum.org/EIPS/eip-1153)
7-
* [EIP-4788: Beacon block root in the EVM ](https://eips.ethereum.org/EIPS/eip-4788)
7+
* [EIP-4788: Beacon block root in the EVM](https://eips.ethereum.org/EIPS/eip-4788)
88
* [EIP-4844: Shard Blob Transactions](https://eips.ethereum.org/EIPS/eip-4844)
99
* [EIP-5656: MCOPY - Memory copying instruction](https://eips.ethereum.org/EIPS/eip-5656)
1010
* [EIP-6780: SELFDESTRUCT only in same transaction](https://eips.ethereum.org/EIPS/eip-6780)

network-upgrades/mainnet-upgrades/dao-fork.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,4 @@ Blocks with block numbers in the range [1_920_000, 1_920_009] **MUST** have `0x6
199199

200200
## Copyright
201201

202-
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
202+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

pyproject.toml

Lines changed: 120 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,11 @@ fill = [
286286
]
287287

288288
lint = [
289-
"isort==5.13.2",
289+
"codespell==2.4.1",
290290
"mypy==1.17.0",
291-
"black==23.12.0",
292-
"flake8==6.1.0",
293-
"flake8-bugbear==23.12.2",
294-
"flake8-docstrings==1.7.0",
295-
"flake8-spellcheck==0.28.0",
296-
"flake8-unused-arguments==0.0.13",
291+
"ruff==0.11.8",
297292
"vulture==2.14.0",
298293
]
299-
300294
tools = [
301295
"platformdirs>=4.2,<5",
302296
]
@@ -309,7 +303,6 @@ optimized = [
309303
"ethash>=1.1.0,<2",
310304
]
311305

312-
313306
[tool.setuptools.dynamic]
314307
version = { attr = "ethereum.__version__" }
315308

@@ -332,14 +325,6 @@ ethereum-spec-fill = "cli.pytest_commands.fill:fill"
332325
"ethereum_spec_tools.docc:BeforeNode" = "ethereum_spec_tools.docc:render_before_after"
333326
"ethereum_spec_tools.docc:AfterNode" = "ethereum_spec_tools.docc:render_before_after"
334327

335-
[tool.isort]
336-
profile = "black"
337-
multi_line_output = 3
338-
line_length = 79
339-
340-
[tool.black]
341-
line-length = 79
342-
343328
[tool.pytest.ini_options]
344329
markers = [
345330
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
@@ -362,7 +347,6 @@ context = [
362347
"docc.search.context",
363348
"docc.html.context",
364349
]
365-
366350
discovery = [
367351
"docc.search.discover",
368352
"docc.html.discover",
@@ -371,15 +355,13 @@ discovery = [
371355
"docc.listing.discover",
372356
"docc.files.discover",
373357
]
374-
375358
build = [
376359
"docc.search.build",
377360
"ethereum_spec_tools.docc.build",
378361
"docc.files.build",
379362
"docc.listing.build",
380363
"docc.resources.build",
381364
]
382-
383365
transform = [
384366
"docc.python.transform",
385367
"docc.verbatim.transform",
@@ -401,7 +383,6 @@ excluded_references = [
401383
paths = [
402384
"src",
403385
]
404-
405386
excluded_paths = [
406387
"src/ethereum_optimized",
407388
"src/ethereum_spec_tools",
@@ -421,3 +402,121 @@ files = [
421402
[tool.docc.output]
422403
path = "docs"
423404
extension = ".html"
405+
406+
[tool.vulture]
407+
exclude = ["tests/fixtures/", "eest_tests/"]
408+
ignore_names = ["pytest_*"]
409+
410+
[tool.ruff]
411+
extend-exclude = [
412+
".cache/",
413+
".git/",
414+
".pytest_cache/",
415+
".ruff_cache/",
416+
".tox/",
417+
".venv/",
418+
".vscode/",
419+
"tests/fixtures/*",
420+
"tests/json_infra/fixtures/*",
421+
"eest_tests/*",
422+
"vulture_whitelist.py",
423+
]
424+
line-length = 79
425+
426+
[tool.ruff.lint]
427+
select = [
428+
"E", # pycodestyle errors
429+
"F", # Pyflakes
430+
"B", # flake8-bugbear
431+
"W", # pycodestyle warnings
432+
"I", # isort
433+
"A", # flake8-builtins
434+
"N", # pep8-naming
435+
"ARG", # flake8-unused-arguments
436+
]
437+
fixable = [
438+
"E", # pycodestyle errors
439+
"F", # Pyflakes
440+
"B", # flake8-bugbear
441+
"W", # pycodestyle warnings
442+
"I", # isort
443+
"D", # pydocstyle
444+
]
445+
ignore = [
446+
# Common to STEEL
447+
"D205", # Missing blank line after summary
448+
"D203", # 1 blank line required before class docstring
449+
"D212", # Multi-line docstring summary should start at the first line
450+
"D415", # First line should end with a ".", "?", or "!"
451+
452+
# Specific to EELS
453+
"D107", # Missing docstring in __init__
454+
"D200", # One-line docstring should fit on one line with quotes
455+
"D205", # 1 blank line required between summary and description
456+
"D400", # First line should end with a period
457+
"D401", # First line should be in imperative mood ("Do", not "Does")
458+
"D410", # Missing blank line after last section (Args, Returns, Raises)
459+
"D411", # Missing blank line before last section
460+
"D412", # No blank lines between sections
461+
"D413", # Missing blank line after last section (same as 410)
462+
"D414", # Section should end with a period
463+
"D416", # Section names should be in the correct order
464+
"E203", # Whitespace before ':'
465+
]
466+
467+
[tool.ruff.lint.per-file-ignores]
468+
"tests/*" = [
469+
"D100", # Missing docstring in public module
470+
"D101", # Missing docstring in public class
471+
"D103", # Missing docstring in public function
472+
"D104", # Missing docstring in public package
473+
"E501", # Line too long
474+
]
475+
"src/ethereum_spec_tools/evm_tools/loaders/fork_loader.py" = [
476+
"N802" # Property names do not need to be lowercase
477+
]
478+
"src/ethereum_spec_tools/lint/*" = [
479+
"N802" # Special linting code absolved of function naming reqs
480+
]
481+
"src/ethereum/crypto/*" = [
482+
"N806", # Special crypto code absolved of variable naming reqs
483+
"N802" # Special crypto code absolved of function naming reqs
484+
]
485+
"src/ethereum_spec_tools/evm_tools/t8n/evm_trace/eip3155.py" = [
486+
"N815" # The traces must use camel case in JSON property names
487+
]
488+
"src/ethereum_spec_tools/evm_tools/t8n/evm_trace.py" = [
489+
"N815" # The traces must use camel case in JSON property names
490+
]
491+
492+
[tool.ruff.lint.mccabe]
493+
# Set the maximum allowed cyclomatic complexity. C901 default is 10.
494+
max-complexity = 7
495+
496+
[tool.codespell]
497+
builtin = "clear,code,usage" # Built-in dictionaries to use
498+
skip = [ # Don't check these files/folders
499+
".git/*",
500+
".tox/*",
501+
".venv/*",
502+
"build/*",
503+
"dist/*",
504+
"*.pyc",
505+
"ethereum_execution.egg-info/*",
506+
"*.coverage*",
507+
"__pycache__",
508+
".ruff_cache",
509+
"fixtures.*",
510+
"tests/fixtures",
511+
"tests/json_infra/fixtures",
512+
"eest_tests",
513+
"src/ethereum_spec_tools/evm_tools/t8n" # Temporary while being re-written
514+
]
515+
count = true # Display counts of errors
516+
check-hidden = false # Don't check hidden files (starting with .)
517+
518+
[tool.uv]
519+
required-version = ">=0.7.0"
520+
521+
[tool.uv.sources]
522+
"ethereum-spec-evm-resolver" = { git = "https://github.com/spencer-tb/ethereum-spec-evm-resolver", rev = "aec6a628b8d0f1c791a8378c5417a089566135ac" }

src/ethereum/arrow_glacier/bloom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ def add_to_bloom(bloom: bytearray, bloom_entry: Bytes) -> None:
4242
bloom_entry :
4343
An entry which is to be added to bloom filter.
4444
"""
45-
hash = keccak256(bloom_entry)
45+
hashed = keccak256(bloom_entry)
4646

4747
for idx in (0, 2, 4):
4848
# Obtain the least significant 11 bits from the pair of bytes
4949
# (16 bits), and set this bit in bloom bytearray.
5050
# The obtained bit is 0-indexed in the bloom filter from the least
5151
# significant bit to the most significant bit.
52-
bit_to_set = Uint.from_be_bytes(hash[idx : idx + 2]) & Uint(0x07FF)
52+
bit_to_set = Uint.from_be_bytes(hashed[idx : idx + 2]) & Uint(0x07FF)
5353
# Below is the index of the bit in the bytearray (where 0-indexed
5454
# byte is the most significant byte)
5555
bit_index = 0x07FF - int(bit_to_set)

src/ethereum/arrow_glacier/fork_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Introduction
1010
------------
1111
12-
Types re-used throughout the specification, which are specific to Ethereum.
12+
Types reused throughout the specification, which are specific to Ethereum.
1313
"""
1414

1515
from dataclasses import dataclass

src/ethereum/arrow_glacier/trie.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
#
4848
# keccak256(RLP(b''))
4949
# ==
50-
# 56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421 # noqa: E501,SC10
50+
# 56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421 # noqa: E501
5151
#
5252
# also:
5353
#
5454
# keccak256(RLP(()))
5555
# ==
56-
# 1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 # noqa: E501,SC10
56+
# 1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 # noqa: E501
5757
#
5858
# which is the sha3Uncles hash in block header with no uncles
5959
EMPTY_TRIE_ROOT = Root(

src/ethereum/arrow_glacier/vm/gas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def calculate_memory_gas_cost(size_in_bytes: Uint) -> Uint:
139139
total_gas_cost = linear_cost + quadratic_cost
140140
try:
141141
return total_gas_cost
142-
except ValueError:
143-
raise OutOfGasError
142+
except ValueError as e:
143+
raise OutOfGasError from e
144144

145145

146146
def calculate_gas_extend_memory(

src/ethereum/arrow_glacier/vm/instructions/block.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def block_hash(evm: Evm) -> None:
4646
# Default hash to 0, if the block of interest is not yet on the chain
4747
# (including the block which has the current executing transaction),
4848
# or if the block's age is more than 256.
49-
hash = b"\x00"
49+
current_block_hash = b"\x00"
5050
else:
51-
hash = evm.message.block_env.block_hashes[
51+
current_block_hash = evm.message.block_env.block_hashes[
5252
-(current_block_number - block_number)
5353
]
5454

55-
push(evm.stack, U256.from_be_bytes(hash))
55+
push(evm.stack, U256.from_be_bytes(current_block_hash))
5656

5757
# PROGRAM COUNTER
5858
evm.pc += Uint(1)

0 commit comments

Comments
 (0)