Remove the unused stub constants
This commit is contained in:
parent
e235aa8296
commit
f1f082fbe7
|
@ -13,7 +13,6 @@
|
|||
- [Constants](#constants)
|
||||
- [Execution](#execution)
|
||||
- [Configuration](#configuration)
|
||||
- [Genesis testing settings](#genesis-testing-settings)
|
||||
- [Transition settings](#transition-settings)
|
||||
- [Containers](#containers)
|
||||
- [Extended containers](#extended-containers)
|
||||
|
@ -71,15 +70,6 @@ This patch adds transaction execution to the beacon chain as part of the Merge f
|
|||
|
||||
## Configuration
|
||||
|
||||
### Genesis testing settings
|
||||
|
||||
*Note*: These configuration settings do not apply to the mainnet and are utilized only by pure Merge testing.
|
||||
|
||||
| Name | Value |
|
||||
| - | - |
|
||||
| `GENESIS_GAS_LIMIT` | `uint64(30000000)` (= 30,000,000) |
|
||||
| `GENESIS_BASE_FEE_PER_GAS` | `Bytes32('0x00ca9a3b00000000000000000000000000000000000000000000000000000000')` (= 1,000,000,000) |
|
||||
|
||||
### Transition settings
|
||||
|
||||
| Name | Value |
|
||||
|
|
|
@ -20,6 +20,25 @@ def build_mock_validator(spec, i: int, balance: int):
|
|||
)
|
||||
|
||||
|
||||
def get_sample_genesis_execution_payload_header(spec,
|
||||
eth1_block_hash=None):
|
||||
if eth1_block_hash is None:
|
||||
eth1_block_hash = b'\x55' * 32
|
||||
return spec.ExecutionPayloadHeader(
|
||||
parent_hash=b'\x30' * 32,
|
||||
coinbase=b'\x42' * 20,
|
||||
state_root=b'\x20' * 32,
|
||||
receipt_root=b'\x20' * 32,
|
||||
logs_bloom=b'\x35' * spec.BYTES_PER_LOGS_BLOOM,
|
||||
random=eth1_block_hash,
|
||||
block_number=0,
|
||||
gas_limit=30000000,
|
||||
base_fee_per_gas=spec.Bytes32('0x00ca9a3b00000000000000000000000000000000000000000000000000000000'),
|
||||
block_hash=eth1_block_hash,
|
||||
transactions_root=spec.Root(b'\x56' * 32),
|
||||
)
|
||||
|
||||
|
||||
def create_genesis_state(spec, validator_balances, activation_threshold):
|
||||
deposit_root = b'\x42' * 32
|
||||
|
||||
|
@ -76,9 +95,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
|
|||
|
||||
if spec.fork not in FORKS_BEFORE_MERGE:
|
||||
# Initialize the execution payload header (with block number and genesis time set to 0)
|
||||
state.latest_execution_payload_header.block_hash = eth1_block_hash
|
||||
state.latest_execution_payload_header.random = eth1_block_hash
|
||||
state.latest_execution_payload_header.gas_limit = spec.GENESIS_GAS_LIMIT
|
||||
state.latest_execution_payload_header.base_fee_per_gas = spec.GENESIS_BASE_FEE_PER_GAS
|
||||
state.latest_execution_payload_header = get_sample_genesis_execution_payload_header(
|
||||
spec,
|
||||
eth1_block_hash=eth1_block_hash,
|
||||
)
|
||||
|
||||
return state
|
||||
|
|
|
@ -10,6 +10,9 @@ from eth2spec.test.helpers.constants import MINIMAL
|
|||
from eth2spec.test.helpers.deposits import (
|
||||
prepare_full_genesis_deposits,
|
||||
)
|
||||
from eth2spec.test.helpers.genesis import (
|
||||
get_sample_genesis_execution_payload_header,
|
||||
)
|
||||
|
||||
|
||||
def eth1_init_data(eth1_block_hash, eth1_timestamp):
|
||||
|
@ -104,20 +107,7 @@ def test_initialize_post_transition(spec):
|
|||
|
||||
# initialize beacon_state *with* an execution_payload_header
|
||||
yield 'execution_payload_header', 'meta', True
|
||||
genesis_execution_payload_header = spec.ExecutionPayloadHeader(
|
||||
parent_hash=b'\x30' * 32,
|
||||
coinbase=b'\x42' * 20,
|
||||
state_root=b'\x20' * 32,
|
||||
receipt_root=b'\x20' * 32,
|
||||
logs_bloom=b'\x35' * spec.BYTES_PER_LOGS_BLOOM,
|
||||
random=b'\x55' * 32,
|
||||
block_number=0,
|
||||
gas_limit=30000000,
|
||||
base_fee_per_gas=b'\x10' * 32,
|
||||
block_hash=b'\x99' * 32,
|
||||
transactions_root=spec.Root(b'\x56' * 32),
|
||||
|
||||
)
|
||||
genesis_execution_payload_header = get_sample_genesis_execution_payload_header(spec)
|
||||
state = spec.initialize_beacon_state_from_eth1(
|
||||
eth1_block_hash,
|
||||
eth1_timestamp,
|
||||
|
|
Loading…
Reference in New Issue