feat: introduce on-disk cache persistance for major nym-api caches (#6302)

This includes:
- mixnet contract cache
- described nodes cache
- nodes annotations cache (performance)

those changes include taking some code developed for the purposes of #6277
This commit is contained in:
Jędrzej Stuczyński
2026-02-11 15:57:47 +00:00
committed by GitHub
parent 46b9d5374b
commit 4897cb0ce4
29 changed files with 436 additions and 151 deletions
@@ -7,8 +7,10 @@ use nym_contracts_common::NaiveFloat;
use nym_mixnet_contract_common::reward_params::Performance;
use nym_mixnet_contract_common::{EpochId, NodeId};
use nym_validator_client::nyxd::contract_traits::performance_query_client::NodePerformance;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap};
#[derive(Serialize, Deserialize)]
pub(crate) struct PerformanceContractEpochCacheData {
pub(crate) epoch_id: EpochId,
pub(crate) median_performance: HashMap<NodeId, Performance>,
@@ -30,6 +32,7 @@ impl PerformanceContractEpochCacheData {
}
}
#[derive(Serialize, Deserialize)]
pub(crate) struct PerformanceContractCacheData {
pub(crate) epoch_performance: BTreeMap<EpochId, PerformanceContractEpochCacheData>,
}