mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Custody persist fix (#7661)
N/A Persist the epoch -> cgc values. This is to ensure that `ValidatorRegistrations::latest_validator_custody_requirement` always returns a `Some` value post restart assuming the `epoch_validator_custody_requirements` map has been updated in the previous runs.
This commit is contained in:
@@ -88,7 +88,7 @@ async fn schema_stability() {
|
||||
check_db_columns();
|
||||
check_metadata_sizes(&store);
|
||||
check_op_pool(&store);
|
||||
check_custody_context(&store);
|
||||
check_custody_context(&store, &harness.spec);
|
||||
check_persisted_chain(&store);
|
||||
|
||||
// Not covered here:
|
||||
@@ -134,12 +134,13 @@ fn check_op_pool(store: &Store<E>) {
|
||||
assert_eq!(op_pool.as_store_bytes().len(), 28);
|
||||
}
|
||||
|
||||
fn check_custody_context(store: &Store<E>) {
|
||||
let custody_context = store
|
||||
.get_item::<PersistedCustody>(&Hash256::ZERO)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
assert_eq!(custody_context.as_store_bytes().len(), 9);
|
||||
fn check_custody_context(store: &Store<E>, spec: &ChainSpec) {
|
||||
let custody_context_opt = store.get_item::<PersistedCustody>(&Hash256::ZERO).unwrap();
|
||||
if spec.is_peer_das_scheduled() {
|
||||
assert_eq!(custody_context_opt.unwrap().as_store_bytes().len(), 13);
|
||||
} else {
|
||||
assert!(custody_context_opt.is_none());
|
||||
}
|
||||
}
|
||||
|
||||
fn check_persisted_chain(store: &Store<E>) {
|
||||
|
||||
Reference in New Issue
Block a user