Rename SECONDS_SINCE_MERGE_FORK -> TARGET_SECONDS_TO_MERGE

This commit is contained in:
Mikhail Kalinin 2021-06-08 17:16:52 +06:00
parent 3a6a565a8f
commit 038edb5b34
1 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ Warning: this configuration is not definitive.
| `MERGE_FORK_VERSION` | `Version('0x02000000')` |
| `MERGE_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
| `MIN_ANCHOR_POW_BLOCK_DIFFICULTY` | **TBD** |
| `SECONDS_SINCE_MERGE_FORK` | `uint64(7 * 86400)` = (604,800) |
| `TARGET_SECONDS_TO_MERGE` | `uint64(7 * 86400)` = (604,800) |
## Fork to Merge
@ -103,11 +103,11 @@ Transition store initialization occurs after the state has been modified by corr
def compute_transition_total_difficulty(anchor_pow_block: PowBlock) -> uint256:
seconds_per_voting_period = EPOCHS_PER_ETH1_VOTING_PERIOD * SLOTS_PER_EPOCH * SECONDS_PER_SLOT
pow_blocks_per_voting_period = seconds_per_voting_period // SECONDS_PER_ETH1_BLOCK
pow_blocks_since_merge_fork = SECONDS_SINCE_MERGE_FORK // SECONDS_PER_ETH1_BLOCK
pow_blocks_to_transition = ETH1_FOLLOW_DISTANCE + pow_blocks_per_voting_period + pow_blocks_since_merge_fork
pow_blocks_to_merge = TARGET_SECONDS_TO_MERGE // SECONDS_PER_ETH1_BLOCK
pow_blocks_after_anchor_block = ETH1_FOLLOW_DISTANCE + pow_blocks_per_voting_period + pow_blocks_to_merge
anchor_difficulty = max(MIN_ANCHOR_POW_BLOCK_DIFFICULTY, anchor_pow_block.difficulty)
return anchor_pow_block.total_difficulty + anchor_difficulty * pow_blocks_to_transition
return anchor_pow_block.total_difficulty + anchor_difficulty * pow_blocks_after_anchor_block
def get_transition_store(anchor_pow_block: PowBlock) -> TransitionStore: