Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminal total difficulty override setting #2587

Merged
merged 11 commits into from
Sep 9, 2021
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The merge is still actively in development. The exact specification has not been
* [Merge fork](specs/merge/fork.md)
* [Fork Choice changes](specs/merge/fork-choice.md)
* [Validator additions](specs/merge/validator.md)
* [Client settings](specs/merge/client_settings.md)

### Sharding

Expand All @@ -53,7 +54,7 @@ Sharding follows the merge, and is divided into three parts:
* Sharding base functionality - In early engineering phase
* [Beacon Chain changes](specs/sharding/beacon-chain.md)
* [P2P Network changes](specs/sharding/p2p-interface.md)
* Custody Game - Ready, dependent on sharding
* Custody Game - Ready, dependent on sharding
* [Beacon Chain changes](specs/custody_game/beacon-chain.md)
* [Validator custody work](specs/custody_game/validator.md)
* Data Availability Sampling - In active R&D
Expand Down
17 changes: 17 additions & 0 deletions specs/merge/client_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The Merge -- Client Settings

**Notice**: This document is a work-in-progress for researchers and implementers.

This document specifies configurable settings that merge clients are expected to ship with.
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved

### Override terminal total difficulty

To coordinate changes to [`terminal_total_difficulty`](fork-choice.md#transitionstore), clients
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved
should have a setting `--terminal-total-difficulty-override`.
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved

If `TransitionStore` has already been initialized, this just changes the value of
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved
`TransitionStore.terminal_total_difficulty`, otherwise it initializes `TransitionStore` with the specified
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved
`terminal_total_difficulty`.

By default, this setting is expected to not be used and `terminal_total_difficulty` will be set as defined
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved
[here](fork.md#initializing-transition-store).
7 changes: 5 additions & 2 deletions specs/merge/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ def upgrade_to_merge(pre: altair.BeaconState) -> BeaconState:
# Execution-layer
latest_execution_payload_header=ExecutionPayloadHeader(),
)

return post
```

### Initializing transition store

If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == MERGE_FORK_EPOCH`, a transition store is initialized to be further utilized by the transition process of the Merge.
If `state.slot % SLOTS_PER_EPOCH == 0`, `compute_epoch_at_slot(state.slot) == MERGE_FORK_EPOCH`, and the transition store has not already been initialized, a transition store is initialized to be further utilized by the transition process of the Merge.

Transition store initialization occurs after the state has been modified by corresponding `upgrade_to_merge` function.

Expand All @@ -127,3 +127,6 @@ def initialize_transition_store(state: BeaconState) -> TransitionStore:
pow_block = get_pow_block(state.eth1_data.block_hash)
return get_transition_store(pow_block)
```

Note that transition store can also be initialized at client startup by [overriding terminal total
lsankar4033 marked this conversation as resolved.
Show resolved Hide resolved
difficulty](client_settings.md#override-terminal-total-difficulty).