Merge pull request #2684 from ethereum/merge-txs

Remove Union from ExecutionPayload transaction type
This commit is contained in:
Danny Ryan 2021-10-20 08:59:25 -06:00 committed by GitHub
commit a20f6f7b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 7 deletions

View File

@ -1,3 +1,16 @@
# Mainnet preset - The Merge # 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

View File

@ -1,3 +1,16 @@
# Minimal preset - The Merge # 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

View File

@ -497,7 +497,7 @@ class MergeSpecBuilder(AltairSpecBuilder):
return super().imports(preset_name) + f''' return super().imports(preset_name) + f'''
from typing import Protocol from typing import Protocol
from eth2spec.altair import {preset_name} as altair 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 @classmethod
@ -543,7 +543,7 @@ EXECUTION_ENGINE = NoopExecutionEngine()"""
@classmethod @classmethod
def hardcoded_custom_type_dep_constants(cls) -> str: def hardcoded_custom_type_dep_constants(cls) -> str:
constants = { constants = {
'MAX_BYTES_PER_OPAQUE_TRANSACTION': 'uint64(2**20)', 'MAX_BYTES_PER_TRANSACTION': 'uint64(2**20)',
} }
return {**super().hardcoded_custom_type_dep_constants(), **constants} return {**super().hardcoded_custom_type_dep_constants(), **constants}

View File

@ -50,8 +50,7 @@ This patch adds transaction execution to the beacon chain as part of the Merge f
| Name | SSZ equivalent | Description | | 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` | `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|
| `Transaction` | `Union[OpaqueTransaction]` | a transaction |
| `ExecutionAddress` | `Bytes20` | Address of account on the execution layer | | `ExecutionAddress` | `Bytes20` | Address of account on the execution layer |
## Constants ## Constants
@ -60,7 +59,7 @@ This patch adds transaction execution to the beacon chain as part of the Merge f
| Name | Value | | 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) | | `MAX_TRANSACTIONS_PER_PAYLOAD` | `uint64(2**14)` (= 16,384) |
| `BYTES_PER_LOGS_BLOOM` | `uint64(2**8)` (= 256) | | `BYTES_PER_LOGS_BLOOM` | `uint64(2**8)` (= 256) |
| `GAS_LIMIT_DENOMINATOR` | `uint64(2**10)` (= 1,024) | | `GAS_LIMIT_DENOMINATOR` | `uint64(2**10)` (= 1,024) |