mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-21 23:08:12 +00:00
Introduce ExecutionAddress type
This commit is contained in:
parent
b7deef1629
commit
7d577ed422
2
setup.py
2
setup.py
@ -535,7 +535,7 @@ class NoopExecutionEngine(ExecutionEngine):
|
|||||||
parent_hash: Hash32,
|
parent_hash: Hash32,
|
||||||
timestamp: uint64,
|
timestamp: uint64,
|
||||||
random: Bytes32,
|
random: Bytes32,
|
||||||
feeRecipient: Bytes20) -> uint64:
|
feeRecipient: ExecutionAddress) -> uint64:
|
||||||
raise NotImplementedError("no default block production")
|
raise NotImplementedError("no default block production")
|
||||||
|
|
||||||
def get_payload(self: ExecutionEngine, payload_id: uint64) -> ExecutionPayload:
|
def get_payload(self: ExecutionEngine, payload_id: uint64) -> ExecutionPayload:
|
||||||
|
@ -54,6 +54,7 @@ This patch adds transaction execution to the beacon chain as part of the Merge f
|
|||||||
| - | - | - |
|
| - | - | - |
|
||||||
| `OpaqueTransaction` | `ByteList[MAX_BYTES_PER_OPAQUE_TRANSACTION]` | a [typed transaction envelope](https://eips.ethereum.org/EIPS/eip-2718#opaque-byte-array-rather-than-an-rlp-array) structured as `TransactionType \|\| TransactionPayload` |
|
| `OpaqueTransaction` | `ByteList[MAX_BYTES_PER_OPAQUE_TRANSACTION]` | a [typed transaction envelope](https://eips.ethereum.org/EIPS/eip-2718#opaque-byte-array-rather-than-an-rlp-array) structured as `TransactionType \|\| TransactionPayload` |
|
||||||
| `Transaction` | `Union[OpaqueTransaction]` | a transaction |
|
| `Transaction` | `Union[OpaqueTransaction]` | a transaction |
|
||||||
|
| `ExecutionAddress` | `Bytes20` | Address of account on the execution layer |
|
||||||
|
|
||||||
## Constants
|
## Constants
|
||||||
|
|
||||||
@ -159,7 +160,7 @@ class BeaconState(Container):
|
|||||||
class ExecutionPayload(Container):
|
class ExecutionPayload(Container):
|
||||||
# Execution block header fields
|
# Execution block header fields
|
||||||
parent_hash: Hash32
|
parent_hash: Hash32
|
||||||
coinbase: Bytes20 # 'beneficiary' in the yellow paper
|
coinbase: ExecutionAddress # 'beneficiary' in the yellow paper
|
||||||
state_root: Bytes32
|
state_root: Bytes32
|
||||||
receipt_root: Bytes32 # 'receipts root' in the yellow paper
|
receipt_root: Bytes32 # 'receipts root' in the yellow paper
|
||||||
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM]
|
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM]
|
||||||
@ -181,7 +182,7 @@ class ExecutionPayload(Container):
|
|||||||
class ExecutionPayloadHeader(Container):
|
class ExecutionPayloadHeader(Container):
|
||||||
# Execution block header fields
|
# Execution block header fields
|
||||||
parent_hash: Hash32
|
parent_hash: Hash32
|
||||||
coinbase: Bytes20
|
coinbase: ExecutionAddress
|
||||||
state_root: Bytes32
|
state_root: Bytes32
|
||||||
receipt_root: Bytes32
|
receipt_root: Bytes32
|
||||||
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM]
|
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM]
|
||||||
|
@ -53,7 +53,7 @@ def prepare_payload(self: ExecutionEngine,
|
|||||||
parent_hash: Hash32,
|
parent_hash: Hash32,
|
||||||
timestamp: uint64,
|
timestamp: uint64,
|
||||||
random: Bytes32,
|
random: Bytes32,
|
||||||
fee_recipient: Bytes20) -> uint64:
|
fee_recipient: ExecutionAddress) -> uint64:
|
||||||
"""
|
"""
|
||||||
Return ``payload_id`` that is used to obtain the execution payload in a subsequent ``get_payload`` call.
|
Return ``payload_id`` that is used to obtain the execution payload in a subsequent ``get_payload`` call.
|
||||||
"""
|
"""
|
||||||
@ -103,7 +103,7 @@ def get_pow_block_at_total_difficulty(total_difficulty: uint256, pow_chain: Sequ
|
|||||||
|
|
||||||
def prepare_execution_payload(state: BeaconState,
|
def prepare_execution_payload(state: BeaconState,
|
||||||
pow_chain: Sequence[PowBlock],
|
pow_chain: Sequence[PowBlock],
|
||||||
fee_recipient: Bytes20,
|
fee_recipient: ExecutionAddress,
|
||||||
execution_engine: ExecutionEngine) -> Optional[uint64]:
|
execution_engine: ExecutionEngine) -> Optional[uint64]:
|
||||||
if not is_merge_complete(state):
|
if not is_merge_complete(state):
|
||||||
terminal_pow_block = get_pow_block_at_total_difficulty(TERMINAL_TOTAL_DIFFICULTY, pow_chain)
|
terminal_pow_block = get_pow_block_at_total_difficulty(TERMINAL_TOTAL_DIFFICULTY, pow_chain)
|
||||||
|
@ -11,7 +11,7 @@ def build_empty_execution_payload(spec, state, randao_mix=None):
|
|||||||
|
|
||||||
payload = spec.ExecutionPayload(
|
payload = spec.ExecutionPayload(
|
||||||
parent_hash=latest.block_hash,
|
parent_hash=latest.block_hash,
|
||||||
coinbase=spec.Bytes20(),
|
coinbase=spec.ExecutionAddress(),
|
||||||
state_root=latest.state_root, # no changes to the state
|
state_root=latest.state_root, # no changes to the state
|
||||||
receipt_root=b"no receipts here" + b"\x00" * 16, # TODO: root of empty MPT may be better.
|
receipt_root=b"no receipts here" + b"\x00" * 16, # TODO: root of empty MPT may be better.
|
||||||
logs_bloom=spec.ByteVector[spec.BYTES_PER_LOGS_BLOOM](), # TODO: zeroed logs bloom for empty logs ok?
|
logs_bloom=spec.ByteVector[spec.BYTES_PER_LOGS_BLOOM](), # TODO: zeroed logs bloom for empty logs ok?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user