Fix previous fork version

This commit is contained in:
Hsiao-Wei Wang 2023-04-06 20:08:23 +08:00
parent 11842c9e2a
commit d78c7ada03
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 4 additions and 2 deletions

View File

@ -159,6 +159,8 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, sync_aggregate=
state = post_spec.upgrade_to_capella(state) state = post_spec.upgrade_to_capella(state)
elif post_spec.fork == DENEB: elif post_spec.fork == DENEB:
state = post_spec.upgrade_to_deneb(state) state = post_spec.upgrade_to_deneb(state)
elif post_spec.fork == EIP6110:
state = post_spec.upgrade_to_eip6110(state)
assert state.fork.epoch == fork_epoch assert state.fork.epoch == fork_epoch
@ -175,7 +177,7 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, sync_aggregate=
assert state.fork.previous_version == post_spec.config.CAPELLA_FORK_VERSION assert state.fork.previous_version == post_spec.config.CAPELLA_FORK_VERSION
assert state.fork.current_version == post_spec.config.DENEB_FORK_VERSION assert state.fork.current_version == post_spec.config.DENEB_FORK_VERSION
elif post_spec.fork == EIP6110: elif post_spec.fork == EIP6110:
assert state.fork.previous_version == post_spec.config.CAPELLA_FORK_VERSION assert state.fork.previous_version == post_spec.config.DENEB_FORK_VERSION
assert state.fork.current_version == post_spec.config.EIP6110_FORK_VERSION assert state.fork.current_version == post_spec.config.EIP6110_FORK_VERSION
if with_block: if with_block:

View File

@ -84,7 +84,7 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
previous_version = spec.config.CAPELLA_FORK_VERSION previous_version = spec.config.CAPELLA_FORK_VERSION
current_version = spec.config.DENEB_FORK_VERSION current_version = spec.config.DENEB_FORK_VERSION
elif spec.fork == EIP6110: elif spec.fork == EIP6110:
previous_version = spec.config.CAPELLA_FORK_VERSION previous_version = spec.config.DENEB_FORK_VERSION
current_version = spec.config.EIP6110_FORK_VERSION current_version = spec.config.EIP6110_FORK_VERSION
state = spec.BeaconState( state = spec.BeaconState(