-
Notifications
You must be signed in to change notification settings - Fork 973
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
Apply new terminology to the merge spec #2319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specs/merge/beacon-chain.md
Outdated
|
||
if not is_transition_completed(state): | ||
assert body.application_payload == ApplicationPayload() | ||
assert body.execution_payload == ExecutionPayload() | ||
return | ||
|
||
if not is_transition_block(state, body): | ||
assert body.application_payload.parent_hash == state.latest_application_block_header.block_hash | ||
assert body.application_payload.number == state.latest_application_block_header.number + 1 | ||
|
||
application_state = get_application_state(state.latest_application_block_header.state_root) | ||
application_state_transition(application_state, body.application_payload) | ||
|
||
state.latest_application_block_header = ApplicationBlockHeader( | ||
block_hash=application_payload.block_hash, | ||
parent_hash=application_payload.parent_hash, | ||
coinbase=application_payload.coinbase, | ||
state_root=application_payload.state_root, | ||
number=application_payload.number, | ||
gas_limit=application_payload.gas_limit, | ||
gas_used=application_payload.gas_used, | ||
receipt_root=application_payload.receipt_root, | ||
logs_bloom=application_payload.logs_bloom, | ||
transactions_root=hash_tree_root(application_payload.transactions), | ||
assert body.execution_payload.parent_hash == state.latest_execution_payload_header.block_hash | ||
assert body.execution_payload.number == state.latest_execution_payload_header.number + 1 | ||
|
||
execution_state = get_execution_state(state.latest_execution_payload_header.state_root) | ||
execution_state_transition(execution_state, body.execution_payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
body.
was missing on L198. It would be less verbose with:
execution_payload = body.execution_payload
if not is_transition_completed(state):
assert execution_payload == ExecutionPayload()
return
if not is_transition_block(state, body):
assert execution_payload.parent_hash == state.latest_execution_payload_header.block_hash
assert execution_payload.number == state.latest_execution_payload_header.number + 1
execution_state = get_execution_state(state.latest_execution_payload_header.state_root)
execution_state_transition(execution_state, execution_payload)
specs/merge/beacon-chain.md
Outdated
``` | ||
|
||
#### `is_transition_block` | ||
|
||
```python | ||
def is_transition_block(state: BeaconState, block_body: BeaconBlockBody) -> boolean: | ||
return state.latest_application_block_header.block_hash == Bytes32() and block_body.application_payload.block_hash != Bytes32() | ||
return state.latest_execution_payload_header.block_hash == Bytes32() and block_body.execution_payload.block_hash != Bytes32() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter max-line length is 120 now.
Suggesting:
return state.latest_execution_payload_header.block_hash == Bytes32() and block_body.execution_payload.block_hash != Bytes32() | |
is_empty_latest_execution_payload_header_block_hash = state.latest_execution_payload_header.block_hash == Bytes32() | |
is_empty_execution_payload_block_hash = block_body.execution_payload.block_hash == Bytes32() | |
return is_empty_latest_execution_payload_header_block_hash and not is_empty_execution_payload_block_hash |
specs/merge/beacon-chain.md
Outdated
|
||
Let `application_state_transition(application_state: ApplicationState, application_payload: ApplicationPayload) -> None` be the transition function of ethereum application state. | ||
Let `execution_state_transition(execution_state: ExecutionState, execution_payload: ExecutionPayload) -> None` be the transition function of ethereum execution state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let `execution_state_transition(execution_state: ExecutionState, execution_payload: ExecutionPayload) -> None` be the transition function of ethereum execution state. | |
Let `execution_state_transition(execution_state: ExecutionState, execution_payload: ExecutionPayload) -> None` be the transition function of Ethereum execution state. |
@hwwhww I have addressed all the comments you've made, thanks! Also, fixed a bug in checking pre-conditions of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! one question about process_execution_payload
before the transition
Fixed now 👍 |
Updates the spec according to the new terminology.
There is a decision to rename
application-layer
toexecution-layer
to avoid potential confusion with the layer where smart contracts and apps built around them are living.There is an essay utilising new terms to give an idea of how they should be used
UPD
In addition, it renames
ExecutionBlockHeader
toExecutionPayloadHeader
to emphasize the difference between the payload header and pre-merge PoWBlockHeader
.