From 969985842247a327f01d52e12259d83cee43ff3c Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Thu, 20 Jan 2022 08:30:33 +0000 Subject: [PATCH] rename MERGE_FORK_VERSION to BELLATRIX_FORK_VERSION --- beacon_chain/consensus_object_pools/blockchain_dag.nim | 4 ++-- beacon_chain/rpc/rest_config_api.nim | 4 ++-- beacon_chain/spec/beaconstate.nim | 2 +- beacon_chain/spec/eth2_apis/rest_types.nim | 2 +- beacon_chain/spec/forks.nim | 6 +++--- beacon_chain/spec/presets.nim | 6 +++--- ncli/resttest-rules.json | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index a8246bf74..ab58e6870 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -522,8 +522,8 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB, ) let forkVersions = - [cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION, cfg.MERGE_FORK_VERSION, - cfg.SHARDING_FORK_VERSION] + [cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION, + cfg.BELLATRIX_FORK_VERSION, cfg.SHARDING_FORK_VERSION] for i in 0 ..< forkVersions.len: for j in i+1 ..< forkVersions.len: doAssert forkVersions[i] != forkVersions[j] diff --git a/beacon_chain/rpc/rest_config_api.nim b/beacon_chain/rpc/rest_config_api.nim index 7ba9efa6e..8fd9da89c 100644 --- a/beacon_chain/rpc/rest_config_api.nim +++ b/beacon_chain/rpc/rest_config_api.nim @@ -125,8 +125,8 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) = "0x" & $node.dag.cfg.ALTAIR_FORK_VERSION, ALTAIR_FORK_EPOCH: Base10.toString(uint64(node.dag.cfg.ALTAIR_FORK_EPOCH)), - MERGE_FORK_VERSION: - "0x" & $node.dag.cfg.MERGE_FORK_VERSION, + BELLATRIX_FORK_VERSION: + "0x" & $node.dag.cfg.BELLATRIX_FORK_VERSION, MERGE_FORK_EPOCH: Base10.toString(uint64(node.dag.cfg.MERGE_FORK_EPOCH)), SHARDING_FORK_VERSION: diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index ad82b0065..926d8265f 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -870,7 +870,7 @@ func upgrade_to_bellatrix*(cfg: RuntimeConfig, pre: altair.BeaconState): slot: pre.slot, fork: Fork( previous_version: pre.fork.current_version, - current_version: cfg.MERGE_FORK_VERSION, + current_version: cfg.BELLATRIX_FORK_VERSION, epoch: epoch, ), diff --git a/beacon_chain/spec/eth2_apis/rest_types.nim b/beacon_chain/spec/eth2_apis/rest_types.nim index 955bf7440..bb32d6e47 100644 --- a/beacon_chain/spec/eth2_apis/rest_types.nim +++ b/beacon_chain/spec/eth2_apis/rest_types.nim @@ -286,7 +286,7 @@ type GENESIS_DELAY*: uint64 ALTAIR_FORK_VERSION*: Version ALTAIR_FORK_EPOCH*: uint64 - MERGE_FORK_VERSION*: Version + BELLATRIX_FORK_VERSION*: Version MERGE_FORK_EPOCH*: uint64 SHARDING_FORK_VERSION*: Version SHARDING_FORK_EPOCH*: uint64 diff --git a/beacon_chain/spec/forks.nim b/beacon_chain/spec/forks.nim index a93e5253c..8cf19d7cd 100644 --- a/beacon_chain/spec/forks.nim +++ b/beacon_chain/spec/forks.nim @@ -401,7 +401,7 @@ func mergeFork*(cfg: RuntimeConfig): Fork = # previous fork version would be the GENESIS_FORK_VERSION Fork( previous_version: cfg.ALTAIR_FORK_VERSION, - current_version: cfg.MERGE_FORK_VERSION, + current_version: cfg.BELLATRIX_FORK_VERSION, epoch: cfg.MERGE_FORK_EPOCH) proc forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork = @@ -412,7 +412,7 @@ proc forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork = proc forkVersionAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Version = case cfg.stateForkAtEpoch(epoch) - of BeaconStateFork.Bellatrix: cfg.MERGE_FORK_VERSION + of BeaconStateFork.Bellatrix: cfg.BELLATRIX_FORK_VERSION of BeaconStateFork.Altair: cfg.ALTAIR_FORK_VERSION of BeaconStateFork.Phase0: cfg.GENESIS_FORK_VERSION @@ -519,7 +519,7 @@ func init*(T: type ForkDigests, altair: compute_fork_digest(cfg.ALTAIR_FORK_VERSION, genesisValidatorsRoot), bellatrix: - compute_fork_digest(cfg.MERGE_FORK_VERSION, genesisValidatorsRoot), + compute_fork_digest(cfg.BELLATRIX_FORK_VERSION, genesisValidatorsRoot), sharding: compute_fork_digest(cfg.SHARDING_FORK_VERSION, genesisValidatorsRoot), ) diff --git a/beacon_chain/spec/presets.nim b/beacon_chain/spec/presets.nim index 14062c1ca..a4aaa36bf 100644 --- a/beacon_chain/spec/presets.nim +++ b/beacon_chain/spec/presets.nim @@ -50,7 +50,7 @@ type ALTAIR_FORK_EPOCH*: Epoch # Merge - MERGE_FORK_VERSION*: Version + BELLATRIX_FORK_VERSION*: Version MERGE_FORK_EPOCH*: Epoch # Sharding @@ -193,7 +193,7 @@ when const_preset == "mainnet": ALTAIR_FORK_VERSION: Version [byte 0x01, 0x00, 0x00, 0x00], ALTAIR_FORK_EPOCH: Epoch(74240), # Oct 27, 2021, 10:56:23am UTC # Merge - MERGE_FORK_VERSION: Version [byte 0x02, 0x00, 0x00, 0x00], + BELLATRIX_FORK_VERSION: Version [byte 0x02, 0x00, 0x00, 0x00], MERGE_FORK_EPOCH: Epoch(uint64.high), # Sharding SHARDING_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x00], @@ -282,7 +282,7 @@ elif const_preset == "minimal": ALTAIR_FORK_VERSION: Version [byte 0x01, 0x00, 0x00, 0x01], ALTAIR_FORK_EPOCH: Epoch(uint64.high), # Merge - MERGE_FORK_VERSION: Version [byte 0x02, 0x00, 0x00, 0x01], + BELLATRIX_FORK_VERSION: Version [byte 0x02, 0x00, 0x00, 0x01], MERGE_FORK_EPOCH: Epoch(uint64.high), # Sharding SHARDING_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x01], diff --git a/ncli/resttest-rules.json b/ncli/resttest-rules.json index dbaaca703..5e12e6907 100644 --- a/ncli/resttest-rules.json +++ b/ncli/resttest-rules.json @@ -2646,7 +2646,7 @@ "response": { "status": {"operator": "equals", "value": "200"}, "headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}], - "body": [{"operator": "jstructcmps", "start": ["data"], "value": {"CONFIG_NAME":"","MAX_COMMITTEES_PER_SLOT":"","TARGET_COMMITTEE_SIZE":"","MAX_VALIDATORS_PER_COMMITTEE":"","SHUFFLE_ROUND_COUNT":"","HYSTERESIS_QUOTIENT":"","HYSTERESIS_DOWNWARD_MULTIPLIER":"","HYSTERESIS_UPWARD_MULTIPLIER":"","SAFE_SLOTS_TO_UPDATE_JUSTIFIED":"","MIN_DEPOSIT_AMOUNT":"","MAX_EFFECTIVE_BALANCE":"","EFFECTIVE_BALANCE_INCREMENT":"","MIN_ATTESTATION_INCLUSION_DELAY":"","SLOTS_PER_EPOCH":"","MIN_SEED_LOOKAHEAD":"","MAX_SEED_LOOKAHEAD":"","EPOCHS_PER_ETH1_VOTING_PERIOD":"","SLOTS_PER_HISTORICAL_ROOT":"","MIN_EPOCHS_TO_INACTIVITY_PENALTY":"","EPOCHS_PER_HISTORICAL_VECTOR":"","EPOCHS_PER_SLASHINGS_VECTOR":"","HISTORICAL_ROOTS_LIMIT":"","VALIDATOR_REGISTRY_LIMIT":"","BASE_REWARD_FACTOR":"","WHISTLEBLOWER_REWARD_QUOTIENT":"","PROPOSER_REWARD_QUOTIENT":"","INACTIVITY_PENALTY_QUOTIENT":"","MIN_SLASHING_PENALTY_QUOTIENT":"","PROPORTIONAL_SLASHING_MULTIPLIER":"","MAX_PROPOSER_SLASHINGS":"","MAX_ATTESTER_SLASHINGS":"","MAX_ATTESTATIONS":"","MAX_DEPOSITS":"","MAX_VOLUNTARY_EXITS":"","INACTIVITY_PENALTY_QUOTIENT_ALTAIR":"","MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR":"","PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR":"","SYNC_COMMITTEE_SIZE":"","EPOCHS_PER_SYNC_COMMITTEE_PERIOD":"","MIN_SYNC_COMMITTEE_PARTICIPANTS":"","PRESET_BASE":"","TERMINAL_TOTAL_DIFFICULTY":"","TERMINAL_BLOCK_HASH":"","MIN_GENESIS_ACTIVE_VALIDATOR_COUNT":"","MIN_GENESIS_TIME":"","GENESIS_FORK_VERSION":"","GENESIS_DELAY":"","ALTAIR_FORK_VERSION":"","ALTAIR_FORK_EPOCH":"","MERGE_FORK_VERSION":"","MERGE_FORK_EPOCH":"","SHARDING_FORK_VERSION":"","SHARDING_FORK_EPOCH":"","SECONDS_PER_SLOT":"","SECONDS_PER_ETH1_BLOCK":"","MIN_VALIDATOR_WITHDRAWABILITY_DELAY":"","SHARD_COMMITTEE_PERIOD":"","ETH1_FOLLOW_DISTANCE":"","INACTIVITY_SCORE_BIAS":"","INACTIVITY_SCORE_RECOVERY_RATE":"","EJECTION_BALANCE":"","MIN_PER_EPOCH_CHURN_LIMIT":"","CHURN_LIMIT_QUOTIENT":"","DEPOSIT_CHAIN_ID":"","DEPOSIT_NETWORK_ID":"","DEPOSIT_CONTRACT_ADDRESS":"","BLS_WITHDRAWAL_PREFIX":"","ETH1_ADDRESS_WITHDRAWAL_PREFIX":"","DOMAIN_BEACON_PROPOSER":"","DOMAIN_BEACON_ATTESTER":"","DOMAIN_RANDAO":"","DOMAIN_DEPOSIT":"","DOMAIN_VOLUNTARY_EXIT":"","DOMAIN_SELECTION_PROOF":"","DOMAIN_AGGREGATE_AND_PROOF":"","TIMELY_SOURCE_FLAG_INDEX":"","TIMELY_TARGET_FLAG_INDEX":"","TIMELY_HEAD_FLAG_INDEX":"","TIMELY_SOURCE_WEIGHT":"","TIMELY_TARGET_WEIGHT":"","TIMELY_HEAD_WEIGHT":"","SYNC_REWARD_WEIGHT":"","PROPOSER_WEIGHT":"","WEIGHT_DENOMINATOR":"","DOMAIN_SYNC_COMMITTEE":"","DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF":"","DOMAIN_CONTRIBUTION_AND_PROOF":"","TARGET_AGGREGATORS_PER_COMMITTEE":"","RANDOM_SUBNETS_PER_VALIDATOR":"","EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION":"","ATTESTATION_SUBNET_COUNT":"","TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE":"","SYNC_COMMITTEE_SUBNET_COUNT":""}}] + "body": [{"operator": "jstructcmps", "start": ["data"], "value": {"CONFIG_NAME":"","MAX_COMMITTEES_PER_SLOT":"","TARGET_COMMITTEE_SIZE":"","MAX_VALIDATORS_PER_COMMITTEE":"","SHUFFLE_ROUND_COUNT":"","HYSTERESIS_QUOTIENT":"","HYSTERESIS_DOWNWARD_MULTIPLIER":"","HYSTERESIS_UPWARD_MULTIPLIER":"","SAFE_SLOTS_TO_UPDATE_JUSTIFIED":"","MIN_DEPOSIT_AMOUNT":"","MAX_EFFECTIVE_BALANCE":"","EFFECTIVE_BALANCE_INCREMENT":"","MIN_ATTESTATION_INCLUSION_DELAY":"","SLOTS_PER_EPOCH":"","MIN_SEED_LOOKAHEAD":"","MAX_SEED_LOOKAHEAD":"","EPOCHS_PER_ETH1_VOTING_PERIOD":"","SLOTS_PER_HISTORICAL_ROOT":"","MIN_EPOCHS_TO_INACTIVITY_PENALTY":"","EPOCHS_PER_HISTORICAL_VECTOR":"","EPOCHS_PER_SLASHINGS_VECTOR":"","HISTORICAL_ROOTS_LIMIT":"","VALIDATOR_REGISTRY_LIMIT":"","BASE_REWARD_FACTOR":"","WHISTLEBLOWER_REWARD_QUOTIENT":"","PROPOSER_REWARD_QUOTIENT":"","INACTIVITY_PENALTY_QUOTIENT":"","MIN_SLASHING_PENALTY_QUOTIENT":"","PROPORTIONAL_SLASHING_MULTIPLIER":"","MAX_PROPOSER_SLASHINGS":"","MAX_ATTESTER_SLASHINGS":"","MAX_ATTESTATIONS":"","MAX_DEPOSITS":"","MAX_VOLUNTARY_EXITS":"","INACTIVITY_PENALTY_QUOTIENT_ALTAIR":"","MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR":"","PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR":"","SYNC_COMMITTEE_SIZE":"","EPOCHS_PER_SYNC_COMMITTEE_PERIOD":"","MIN_SYNC_COMMITTEE_PARTICIPANTS":"","PRESET_BASE":"","TERMINAL_TOTAL_DIFFICULTY":"","TERMINAL_BLOCK_HASH":"","MIN_GENESIS_ACTIVE_VALIDATOR_COUNT":"","MIN_GENESIS_TIME":"","GENESIS_FORK_VERSION":"","GENESIS_DELAY":"","ALTAIR_FORK_VERSION":"","ALTAIR_FORK_EPOCH":"","BELLATRIX_FORK_VERSION":"","MERGE_FORK_EPOCH":"","SHARDING_FORK_VERSION":"","SHARDING_FORK_EPOCH":"","SECONDS_PER_SLOT":"","SECONDS_PER_ETH1_BLOCK":"","MIN_VALIDATOR_WITHDRAWABILITY_DELAY":"","SHARD_COMMITTEE_PERIOD":"","ETH1_FOLLOW_DISTANCE":"","INACTIVITY_SCORE_BIAS":"","INACTIVITY_SCORE_RECOVERY_RATE":"","EJECTION_BALANCE":"","MIN_PER_EPOCH_CHURN_LIMIT":"","CHURN_LIMIT_QUOTIENT":"","DEPOSIT_CHAIN_ID":"","DEPOSIT_NETWORK_ID":"","DEPOSIT_CONTRACT_ADDRESS":"","BLS_WITHDRAWAL_PREFIX":"","ETH1_ADDRESS_WITHDRAWAL_PREFIX":"","DOMAIN_BEACON_PROPOSER":"","DOMAIN_BEACON_ATTESTER":"","DOMAIN_RANDAO":"","DOMAIN_DEPOSIT":"","DOMAIN_VOLUNTARY_EXIT":"","DOMAIN_SELECTION_PROOF":"","DOMAIN_AGGREGATE_AND_PROOF":"","TIMELY_SOURCE_FLAG_INDEX":"","TIMELY_TARGET_FLAG_INDEX":"","TIMELY_HEAD_FLAG_INDEX":"","TIMELY_SOURCE_WEIGHT":"","TIMELY_TARGET_WEIGHT":"","TIMELY_HEAD_WEIGHT":"","SYNC_REWARD_WEIGHT":"","PROPOSER_WEIGHT":"","WEIGHT_DENOMINATOR":"","DOMAIN_SYNC_COMMITTEE":"","DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF":"","DOMAIN_CONTRIBUTION_AND_PROOF":"","TARGET_AGGREGATORS_PER_COMMITTEE":"","RANDOM_SUBNETS_PER_VALIDATOR":"","EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION":"","ATTESTATION_SUBNET_COUNT":"","TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE":"","SYNC_COMMITTEE_SUBNET_COUNT":""}}] } }, {