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:
Pawan Dhananjay
2025-06-30 23:06:37 -07:00
committed by GitHub
parent 257d270718
commit e305cb1b92
7 changed files with 131 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ use types::{EthSpec, Hash256};
/// 32-byte key for accessing the `CustodyContext`. All zero because `CustodyContext` has its own column.
pub const CUSTODY_DB_KEY: Hash256 = Hash256::ZERO;
pub struct PersistedCustody(CustodyContextSsz);
pub struct PersistedCustody(pub CustodyContextSsz);
pub fn load_custody_context<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>(
store: Arc<HotColdDB<E, Hot, Cold>>,