mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-20 22:38:11 +00:00
avoid altair fork version collision, update test prep, fix genesis state creator bug
This commit is contained in:
parent
a69ad6c2db
commit
4a82a375ae
@ -35,7 +35,8 @@ DOMAIN_SYNC_COMMITTEE: 0x07000000
|
||||
|
||||
# Fork
|
||||
# ---------------------------------------------------------------
|
||||
ALTAIR_FORK_VERSION: 0x01000000
|
||||
# Highest byte set to 0x01 to avoid collisions with mainnet versioning
|
||||
ALTAIR_FORK_VERSION: 0x01000001
|
||||
# [customized]
|
||||
ALTAIR_FORK_SLOT: 0
|
||||
|
||||
|
@ -97,8 +97,7 @@ def with_custom_state(balances_fn: Callable[[Any], Sequence[int]],
|
||||
|
||||
def entry(*args, spec: Spec, phases: SpecForks, **kw):
|
||||
# make a key for the state
|
||||
# genesis fork version separates configs during test-generation runtime.
|
||||
key = (spec.fork, spec.GENESIS_FORK_VERSION, spec.__file__, balances_fn, threshold_fn)
|
||||
key = (spec.fork, spec.CONFIG_NAME, spec.__file__, balances_fn, threshold_fn)
|
||||
global _custom_state_cache_dict
|
||||
if key not in _custom_state_cache_dict:
|
||||
state = _prepare_state(balances_fn, threshold_fn, spec, phases)
|
||||
|
@ -28,6 +28,11 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
|
||||
deposit_count=len(validator_balances),
|
||||
block_hash=eth1_block_hash,
|
||||
),
|
||||
fork=spec.Fork(
|
||||
previous_version=spec.GENESIS_FORK_VERSION,
|
||||
current_version=spec.GENESIS_FORK_VERSION,
|
||||
epoch=spec.GENESIS_EPOCH,
|
||||
),
|
||||
latest_block_header=spec.BeaconBlockHeader(body_root=spec.hash_tree_root(spec.BeaconBlockBody())),
|
||||
randao_mixes=[eth1_block_hash] * spec.EPOCHS_PER_HISTORICAL_VECTOR,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user