From 8a27a7cb5d3c252c7393c3facb1420c211a3bd22 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 19 Oct 2021 15:46:18 -0600 Subject: [PATCH 1/2] remove union type for eecution-payload txs --- setup.py | 4 ++-- specs/merge/beacon-chain.md | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index e414d2721..4524df2ca 100644 --- a/setup.py +++ b/setup.py @@ -497,7 +497,7 @@ class MergeSpecBuilder(AltairSpecBuilder): return super().imports(preset_name) + f''' from typing import Protocol from eth2spec.altair import {preset_name} as altair -from eth2spec.utils.ssz.ssz_typing import Bytes8, Bytes20, ByteList, ByteVector, uint256, Union +from eth2spec.utils.ssz.ssz_typing import Bytes8, Bytes20, ByteList, ByteVector, uint256 ''' @classmethod @@ -543,7 +543,7 @@ EXECUTION_ENGINE = NoopExecutionEngine()""" @classmethod def hardcoded_custom_type_dep_constants(cls) -> str: constants = { - 'MAX_BYTES_PER_OPAQUE_TRANSACTION': 'uint64(2**20)', + 'MAX_BYTES_PER_TRANSACTION': 'uint64(2**20)', } return {**super().hardcoded_custom_type_dep_constants(), **constants} diff --git a/specs/merge/beacon-chain.md b/specs/merge/beacon-chain.md index 2e1fd88fb..8fafb0720 100644 --- a/specs/merge/beacon-chain.md +++ b/specs/merge/beacon-chain.md @@ -50,8 +50,7 @@ This patch adds transaction execution to the beacon chain as part of the Merge f | Name | SSZ equivalent | Description | | - | - | - | -| `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` | `ByteList[MAX_BYTES_PER_TRANSACTION]` | either a [typed transaction envelope](https://eips.ethereum.org/EIPS/eip-2718#opaque-byte-array-rather-than-an-rlp-array) or a legacy transaction| | `ExecutionAddress` | `Bytes20` | Address of account on the execution layer | ## Constants @@ -60,7 +59,7 @@ This patch adds transaction execution to the beacon chain as part of the Merge f | Name | Value | | - | - | -| `MAX_BYTES_PER_OPAQUE_TRANSACTION` | `uint64(2**20)` (= 1,048,576) | +| `MAX_BYTES_PER_TRANSACTION` | `uint64(2**20)` (= 1,048,576) | | `MAX_TRANSACTIONS_PER_PAYLOAD` | `uint64(2**14)` (= 16,384) | | `BYTES_PER_LOGS_BLOOM` | `uint64(2**8)` (= 256) | | `GAS_LIMIT_DENOMINATOR` | `uint64(2**10)` (= 1,024) | From c6af7b3228001b283fcc66d030d0babc5c7ad758 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 19 Oct 2021 15:46:41 -0600 Subject: [PATCH 2/2] add merge execution values to preset yaml files --- presets/mainnet/merge.yaml | 15 ++++++++++++++- presets/minimal/merge.yaml | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/presets/mainnet/merge.yaml b/presets/mainnet/merge.yaml index 97f07c7f0..66f7abe28 100644 --- a/presets/mainnet/merge.yaml +++ b/presets/mainnet/merge.yaml @@ -1,3 +1,16 @@ # Mainnet preset - The Merge -# No presets here. +# Execution +# --------------------------------------------------------------- +# 2**20 (= 1,048,576) +MAX_BYTES_PER_TRANSACTION: 1048576 +# 2**14 (= 16,384) +MAX_TRANSACTIONS_PER_PAYLOAD: 16384 +# 2**8 (= 256) +BYTES_PER_LOGS_BLOOM: 256 +# 2**10 (= 1,024) +GAS_LIMIT_DENOMINATOR: 1024 +# 5,000 +MIN_GAS_LIMIT: 5000 +# 2**5 (= 32) +MAX_EXTRA_DATA_BYTES: 32 diff --git a/presets/minimal/merge.yaml b/presets/minimal/merge.yaml index 88aa86c09..d9b5640dd 100644 --- a/presets/minimal/merge.yaml +++ b/presets/minimal/merge.yaml @@ -1,3 +1,16 @@ # Minimal preset - The Merge -# No presets here. +# Execution +# --------------------------------------------------------------- +# 2**20 (= 1,048,576) +MAX_BYTES_PER_TRANSACTION: 1048576 +# 2**14 (= 16,384) +MAX_TRANSACTIONS_PER_PAYLOAD: 16384 +# 2**8 (= 256) +BYTES_PER_LOGS_BLOOM: 256 +# 2**10 (= 1,024) +GAS_LIMIT_DENOMINATOR: 1024 +# 5,000 +MIN_GAS_LIMIT: 5000 +# 2**5 (= 32) +MAX_EXTRA_DATA_BYTES: 32