ethereum / ethereum/execution-specs
Consider separating stateless components from `Block`
- 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
Assessment
This issue has not been assessed yet.