ethereum / ethereum/execution-specs

Consider separating stateless components from `Block`

Open
#2,441 1 comment 0 reactions 0 assignees View on GitHub
stale zkEVM
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

## Problem

Currently the test fixtures we generate embed three new fields: executionWitness, StatelessInputBytes, StatelessOutputBytes.

This is not a component in a `Block` and is more akin to a sidecar structure.

## Suggeston solution

We could create new test fixtures that generate this sidecar structure, for example:

```python
class BlockchainStatelessBlock(CamelModel):
"""Witness data for a single block in a stateless fixture."""

block_hash: Hash
block_number: Number
execution_witness: ExecutionWitness | None = None
stateless_input_bytes: Bytes | None = None
stateless_output_bytes: Bytes | None = None

class BlockchainStatelessFixture(BaseFixture):
"""Companion fixture containing only stateless/witness data per block."""

format_name: ClassVar[str] = "blockchain_test_stateless"
description: ClassVar[str] = (
"Tests that generate a companion fixture with "
"stateless witness data per block."
)

fork: Fork = Field(..., alias="network")
blocks: List[BlockchainStatelessBlock]
transition_tool_cache_key: ClassVar[str] = "blockchain_test"

def get_fork(self) -> Fork | None:
"""Return fork of the fixture as a string."""
return self.fork

```

This would mean that clients that do not care about stateless fixtures will not need to modify their `Block` structure

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.