remove PERSISTENT_COMMITTEE_PERIOD in favor of SHARD_COMMITTEE_PERIOD
This commit is contained in:
parent
5b3ed8a3e7
commit
38f29ba0a8
|
@ -94,8 +94,8 @@ EPOCHS_PER_ETH1_VOTING_PERIOD: 32
|
||||||
SLOTS_PER_HISTORICAL_ROOT: 8192
|
SLOTS_PER_HISTORICAL_ROOT: 8192
|
||||||
# 2**8 (= 256) epochs ~27 hours
|
# 2**8 (= 256) epochs ~27 hours
|
||||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
|
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
|
||||||
# 2**11 (= 2,048) epochs 9 days
|
# 2**8 (= 256) epochs ~27 hours
|
||||||
PERSISTENT_COMMITTEE_PERIOD: 2048
|
SHARD_COMMITTEE_PERIOD: 256
|
||||||
# 2**6 (= 64) epochs ~7 hours
|
# 2**6 (= 64) epochs ~7 hours
|
||||||
MAX_EPOCHS_PER_CROSSLINK: 64
|
MAX_EPOCHS_PER_CROSSLINK: 64
|
||||||
# 2**2 (= 4) epochs 25.6 minutes
|
# 2**2 (= 4) epochs 25.6 minutes
|
||||||
|
@ -175,8 +175,6 @@ ONLINE_PERIOD: 8
|
||||||
LIGHT_CLIENT_COMMITTEE_SIZE: 128
|
LIGHT_CLIENT_COMMITTEE_SIZE: 128
|
||||||
# 2**8 (= 256) | epochs | ~27 hours
|
# 2**8 (= 256) | epochs | ~27 hours
|
||||||
LIGHT_CLIENT_COMMITTEE_PERIOD: 256
|
LIGHT_CLIENT_COMMITTEE_PERIOD: 256
|
||||||
# 2**8 (= 256) | epochs | ~27 hours
|
|
||||||
SHARD_COMMITTEE_PERIOD: 256
|
|
||||||
# 2**18 (= 262,144)
|
# 2**18 (= 262,144)
|
||||||
SHARD_BLOCK_CHUNK_SIZE: 262144
|
SHARD_BLOCK_CHUNK_SIZE: 262144
|
||||||
# 2**2 (= 4)
|
# 2**2 (= 4)
|
||||||
|
|
|
@ -95,7 +95,7 @@ SLOTS_PER_HISTORICAL_ROOT: 64
|
||||||
# 2**8 (= 256) epochs
|
# 2**8 (= 256) epochs
|
||||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
|
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
|
||||||
# [customized] higher frequency of committee turnover and faster time to acceptable voluntary exit
|
# [customized] higher frequency of committee turnover and faster time to acceptable voluntary exit
|
||||||
PERSISTENT_COMMITTEE_PERIOD: 128
|
SHARD_COMMITTEE_PERIOD: 64
|
||||||
# [customized] fast catchup crosslinks
|
# [customized] fast catchup crosslinks
|
||||||
MAX_EPOCHS_PER_CROSSLINK: 4
|
MAX_EPOCHS_PER_CROSSLINK: 4
|
||||||
# 2**2 (= 4) epochs
|
# 2**2 (= 4) epochs
|
||||||
|
@ -178,8 +178,6 @@ ONLINE_PERIOD: 8
|
||||||
LIGHT_CLIENT_COMMITTEE_SIZE: 128
|
LIGHT_CLIENT_COMMITTEE_SIZE: 128
|
||||||
# 2**8 (= 256) | epochs
|
# 2**8 (= 256) | epochs
|
||||||
LIGHT_CLIENT_COMMITTEE_PERIOD: 256
|
LIGHT_CLIENT_COMMITTEE_PERIOD: 256
|
||||||
# 2**8 (= 256) | epochs
|
|
||||||
SHARD_COMMITTEE_PERIOD: 256
|
|
||||||
# 2**18 (= 262,144)
|
# 2**18 (= 262,144)
|
||||||
SHARD_BLOCK_CHUNK_SIZE: 262144
|
SHARD_BLOCK_CHUNK_SIZE: 262144
|
||||||
# 2**2 (= 4)
|
# 2**2 (= 4)
|
||||||
|
|
|
@ -223,7 +223,8 @@ The following values are (non-configurable) constants used throughout the specif
|
||||||
| `EPOCHS_PER_ETH1_VOTING_PERIOD` | `2**5` (= 32) | epochs | ~3.4 hours |
|
| `EPOCHS_PER_ETH1_VOTING_PERIOD` | `2**5` (= 32) | epochs | ~3.4 hours |
|
||||||
| `SLOTS_PER_HISTORICAL_ROOT` | `2**13` (= 8,192) | slots | ~27 hours |
|
| `SLOTS_PER_HISTORICAL_ROOT` | `2**13` (= 8,192) | slots | ~27 hours |
|
||||||
| `MIN_VALIDATOR_WITHDRAWABILITY_DELAY` | `2**8` (= 256) | epochs | ~27 hours |
|
| `MIN_VALIDATOR_WITHDRAWABILITY_DELAY` | `2**8` (= 256) | epochs | ~27 hours |
|
||||||
| `PERSISTENT_COMMITTEE_PERIOD` | `2**11` (= 2,048) | epochs | 9 days |
|
| `SHARD_COMMITTEE_PERIOD` | `Epoch(2**8)` (= 256) | epochs | ~27 hours |
|
||||||
|
|
||||||
|
|
||||||
### State list lengths
|
### State list lengths
|
||||||
|
|
||||||
|
@ -1688,7 +1689,7 @@ def process_voluntary_exit(state: BeaconState, signed_voluntary_exit: SignedVolu
|
||||||
# Exits must specify an epoch when they become valid; they are not valid before then
|
# Exits must specify an epoch when they become valid; they are not valid before then
|
||||||
assert get_current_epoch(state) >= voluntary_exit.epoch
|
assert get_current_epoch(state) >= voluntary_exit.epoch
|
||||||
# Verify the validator has been active long enough
|
# Verify the validator has been active long enough
|
||||||
assert get_current_epoch(state) >= validator.activation_epoch + PERSISTENT_COMMITTEE_PERIOD
|
assert get_current_epoch(state) >= validator.activation_epoch + SHARD_COMMITTEE_PERIOD
|
||||||
# Verify signature
|
# Verify signature
|
||||||
domain = get_domain(state, DOMAIN_VOLUNTARY_EXIT, voluntary_exit.epoch)
|
domain = get_domain(state, DOMAIN_VOLUNTARY_EXIT, voluntary_exit.epoch)
|
||||||
signing_root = compute_signing_root(voluntary_exit, domain)
|
signing_root = compute_signing_root(voluntary_exit, domain)
|
||||||
|
|
|
@ -100,7 +100,6 @@ Configuration is not namespaced. Instead it is strictly an extension;
|
||||||
| `ONLINE_PERIOD` | `OnlineEpochs(2**3)` (= 8) | online epochs | ~51 min |
|
| `ONLINE_PERIOD` | `OnlineEpochs(2**3)` (= 8) | online epochs | ~51 min |
|
||||||
| `LIGHT_CLIENT_COMMITTEE_SIZE` | `2**7` (= 128) |
|
| `LIGHT_CLIENT_COMMITTEE_SIZE` | `2**7` (= 128) |
|
||||||
| `LIGHT_CLIENT_COMMITTEE_PERIOD` | `Epoch(2**8)` (= 256) | epochs | ~27 hours |
|
| `LIGHT_CLIENT_COMMITTEE_PERIOD` | `Epoch(2**8)` (= 256) | epochs | ~27 hours |
|
||||||
| `SHARD_COMMITTEE_PERIOD` | `Epoch(2**8)` (= 256) | epochs | ~27 hours |
|
|
||||||
| `MAX_SHARD_BLOCK_SIZE` | `2**20` (= 1,048,576) | |
|
| `MAX_SHARD_BLOCK_SIZE` | `2**20` (= 1,048,576) | |
|
||||||
| `TARGET_SHARD_BLOCK_SIZE` | `2**18` (= 262,144) | |
|
| `TARGET_SHARD_BLOCK_SIZE` | `2**18` (= 262,144) | |
|
||||||
| `SHARD_BLOCK_OFFSETS` | `[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]` | |
|
| `SHARD_BLOCK_OFFSETS` | `[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]` | |
|
||||||
|
|
|
@ -34,8 +34,8 @@ def run_voluntary_exit_processing(spec, state, signed_voluntary_exit, valid=True
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_success(spec, state):
|
def test_success(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
||||||
|
@ -53,8 +53,8 @@ def test_success(spec, state):
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
@always_bls
|
@always_bls
|
||||||
def test_invalid_signature(spec, state):
|
def test_invalid_signature(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
||||||
|
@ -71,8 +71,8 @@ def test_invalid_signature(spec, state):
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_success_exit_queue(spec, state):
|
def test_success_exit_queue(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
|
|
||||||
|
@ -115,8 +115,8 @@ def test_success_exit_queue(spec, state):
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_default_exit_epoch_subsequent_exit(spec, state):
|
def test_default_exit_epoch_subsequent_exit(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
||||||
|
@ -137,8 +137,8 @@ def test_default_exit_epoch_subsequent_exit(spec, state):
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_validator_exit_in_future(spec, state):
|
def test_validator_exit_in_future(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
||||||
|
@ -156,8 +156,8 @@ def test_validator_exit_in_future(spec, state):
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_validator_invalid_validator_index(spec, state):
|
def test_validator_invalid_validator_index(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
||||||
|
@ -190,8 +190,8 @@ def test_validator_not_active(spec, state):
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_validator_already_exited(spec, state):
|
def test_validator_already_exited(spec, state):
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow validator able to exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow validator able to exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
current_epoch = spec.get_current_epoch(state)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
validator_index = spec.get_active_validator_indices(state, current_epoch)[0]
|
||||||
|
@ -218,7 +218,7 @@ def test_validator_not_active_long_enough(spec, state):
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
current_epoch - state.validators[validator_index].activation_epoch <
|
current_epoch - state.validators[validator_index].activation_epoch <
|
||||||
spec.PERSISTENT_COMMITTEE_PERIOD
|
spec.SHARD_COMMITTEE_PERIOD
|
||||||
)
|
)
|
||||||
|
|
||||||
yield from run_voluntary_exit_processing(spec, state, signed_voluntary_exit, False)
|
yield from run_voluntary_exit_processing(spec, state, signed_voluntary_exit, False)
|
||||||
|
|
|
@ -448,7 +448,7 @@ def test_attestation(spec, state):
|
||||||
assert spec.hash_tree_root(state.previous_epoch_attestations) == pre_current_attestations_root
|
assert spec.hash_tree_root(state.previous_epoch_attestations) == pre_current_attestations_root
|
||||||
|
|
||||||
|
|
||||||
# In phase1 a committee is computed for PERSISTENT_COMMITTEE_PERIOD slots ago,
|
# In phase1 a committee is computed for SHARD_COMMITTEE_PERIOD slots ago,
|
||||||
# exceeding the minimal-config randao mixes memory size.
|
# exceeding the minimal-config randao mixes memory size.
|
||||||
@with_phases(['phase0'])
|
@with_phases(['phase0'])
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
|
@ -458,8 +458,8 @@ def test_voluntary_exit(spec, state):
|
||||||
spec.get_current_epoch(state)
|
spec.get_current_epoch(state)
|
||||||
)[-1]
|
)[-1]
|
||||||
|
|
||||||
# move state forward PERSISTENT_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.PERSISTENT_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
yield 'pre', state
|
yield 'pre', state
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue