Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verkle: parent state root field renaming #934

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/configs/evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ pectra-devnet-3:
verkle:
impl: geth
repo: gballet/go-ethereum
ref: kaustinen-with-shapella
ref: jsign-ew-parent-state-root
spencer-tb marked this conversation as resolved.
Show resolved Hide resolved
evm-bin: evm
4 changes: 2 additions & 2 deletions src/ethereum_test_specs/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,11 @@ def generate_block_data(
transition_tool_output.alloc = previous_alloc
# TODO: hack for now, replace with actual witness output once available from t8n
if transition_tool_output.result.verkle_conversion_ended:
witness_parent_root = transition_tool_output.result.parent_root
witness_parent_root = transition_tool_output.result.parent_state_root
transition_tool_output.witness = Witness(
verkle_proof=transition_tool_output.result.verkle_proof,
state_diff=transition_tool_output.result.state_diff,
parent_root=witness_parent_root,
parent_state_root=witness_parent_root,
)
else:
transition_tool_output.witness = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ def test_witness_validation(witness_data):
== 0x647ED3C87A4F764421EA2F5BFC73195812F6B7DD15AC2B8D295730C1DEDE1EDF
)
assert witness.state_diff.root[0].suffix_diffs[0].new_value is None
assert witness.parent_root == (
assert witness.parent_state_root == (
0x5B5FDFEDD6A0E932DA408AC7D772A36513D1EEE9B9926E52620C43A433AAD7
)
18 changes: 5 additions & 13 deletions src/ethereum_test_types/verkle/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Witness(CamelModel):

state_diff: StateDiff
verkle_proof: VerkleProof
parent_root: Hash
parent_state_root: Hash


class VerkleTree(RootModel[Dict[Hash, Hash]]):
Expand Down Expand Up @@ -181,9 +181,7 @@ def __init__(self, fork: Fork) -> None:
"""
Initializes a WitnessCheck instance.
"""
assert (
fork >= Verkle
), "WitnessCheck is only supported for Verkle fork and later"
assert fork >= Verkle, "WitnessCheck is only supported for Verkle fork and later"
self.account_entries: List[
Tuple[Address, WitnessCheck.AccountHeaderEntry, Optional[Hash]]
] = []
Expand Down Expand Up @@ -259,21 +257,15 @@ def add_account_codehash(self, address: Address, codehash: Optional[Hash]) -> No
"""
Adds the code hash witness for the given address.
"""
self.account_entries.append(
(address, WitnessCheck.AccountHeaderEntry.CODEHASH, codehash)
)
self.account_entries.append((address, WitnessCheck.AccountHeaderEntry.CODEHASH, codehash))

def add_storage_slot(
self, address: Address, storage_slot: int, value: Optional[Hash]
) -> None:
def add_storage_slot(self, address: Address, storage_slot: int, value: Optional[Hash]) -> None:
"""
Adds the storage slot witness for the given address and storage slot.
"""
self.storage_slots.append((address, storage_slot, value))

def add_code_chunk(
self, address: Address, chunk_number: int, value: Optional[Hash]
) -> None:
def add_code_chunk(self, address: Address, chunk_number: int, value: Optional[Hash]) -> None:
"""
Adds the code chunk witness for the given address and chunk number.
"""
Expand Down
Loading