Skip to content

Commit de664a3

Browse files
committed
include tests dir in linting, update some noqas for ruff
1 parent 5e02b74 commit de664a3

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

TODO.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# TODO
2+
3+
- [x] Update the [EIP-170](./eip-170.md) contract code size limit of 24KB (`0x6000` bytes) to 48KB (`0xc000` bytes).
4+
- [x] Update the [EIP-3860](./eip-3860.md) contract initcode size limit of 48KB (`0xc000` bytes) to 96KB (`0x18000` bytes).
5+
- [x] The cost for `EXTCODESIZE` is updated to acknowlege the potential for two database reads: once for the account (making it warm) and second for code size if bytecode is marked as cold. Bytecode will not be marked as warm as only codesize is read. In addition to the current pricing scheme defined under [EIP-2929](./eip-2929.md), the instruction will also be subject to the `COLD_SLOAD_COST=2100` if code is cold.
6+
- [x] `EXTCODESIZE` is charged `COLD_SLOAD_COST` if code is cold
7+
- [x] Bytecode not marked as warm if only codesize is read
8+
Confirm w/ Sam or Mario
9+
- [x] Introduce a new cold/warm state for contract code, update corresponding gas costs.
10+
Modify the opcodes so that flat `COLD_SLOAD_COST=2100` and dynamic `EXCESS_CODE_COST= ceil32(excess_code_size(len(code))) * GAS_CODE_LOAD_WORD_COST // 32` gas are added to the access cost if the code is cold. When the code is an [EIP-7702](./eip-7702.md) delegation to another account, if target account code is cold add additional gas should be accounted. Warming of the contract code is subjected to the journaling and can be reverted similar to other state warming in [EIP-2930](./eip-2930.md). Opcodes:
11+
- [x] COLD_SLOAD_COST increased to 2100
12+
- [x] EXCESS_CODE_COST gas added to cold access cost
13+
- [x] Warming is "journaled" like in EIP-2930?
14+
- [x] When code is delegated to another account that is cold, add COLD_SLOAD_COST
15+
- system.py
16+
- `CALL` (349)
17+
- `CALLCODE` (441)
18+
- `DELEGATECALL` (589)
19+
- `STATICCALL` (663)
20+
- environment.py
21+
- `EXTCODECOPY` (364)
22+
- [] If a large contract is the entry point of a transaction, the cost calculated in (2) is charged before the execution and contract code is marked as warm. This fee is not calculated towards the initial gas fee. In case of out-of-gas halt, execution will stop and the balance will not be transferred.
23+
- [] Cold account and code (Contract not in access list nor accessed prior in the txn)
24+
Add COLD_SLOAD_COST=2100, EXCESS_CODE_COST, and COLD_ACCOUNT_ACCESS_COST=2600
25+
- [] Warm account and cold code (Already accessed balance, storage, or included in access list (EIP-2930))
26+
Add COLD_SLOAD_COST=2100, EXCESS_CODE_COST, and WARM_STORAGE_READ_COST=100
27+
- [] Warm account and code (Already accessed account code)
28+
Add WARM_STORAGE_READ_COST=100
29+
30+

tests/test_trace.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ def test_modify_evm_trace() -> None:
1010
trace2: Optional[ethereum.trace.TraceEvent] = None
1111

1212
def tracer1(
13-
evm: object, # noqa: U100
13+
evm: object, # noqa: U100, ARG001
1414
event: ethereum.trace.TraceEvent,
15-
trace_memory: bool = False, # noqa: U100
16-
trace_stack: bool = True, # noqa: U100
17-
trace_return_data: bool = False, # noqa: U100
15+
trace_memory: bool = False, # noqa: U100, ARG001
16+
trace_stack: bool = True, # noqa: U100, ARG001
17+
trace_return_data: bool = False, # noqa: U100, ARG001
1818
) -> None:
1919
nonlocal trace1
2020
trace1 = event
2121

2222
def tracer2(
23-
evm: object, # noqa: U100
23+
evm: object, # noqa: U100, ARG001
2424
event: ethereum.trace.TraceEvent,
25-
trace_memory: bool = False, # noqa: U100
26-
trace_stack: bool = True, # noqa: U100
27-
trace_return_data: bool = False, # noqa: U100
25+
trace_memory: bool = False, # noqa: U100, ARG001
26+
trace_stack: bool = True, # noqa: U100, ARG001
27+
trace_return_data: bool = False, # noqa: U100, ARG001
2828
) -> None:
2929
nonlocal trace2
3030
trace2 = event

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ commands =
1212
# isort src tests --check --diff --skip-glob "tests/fixtures/*"
1313
# black src tests --check --diff --exclude "tests/fixtures/*"
1414
# flake8 src tests
15-
ruff check src
15+
ruff check src tests
1616
mypy src tests --exclude "tests/fixtures/*" --namespace-packages
1717
ethereum-spec-lint
1818
vulture src tests vulture_whitelist.py --exclude "*/tests/fixtures/*" --ignore-names "pytest_*"

0 commit comments

Comments
 (0)