Move auth_chain cache to db.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-01-21 16:24:53 +00:00
parent 7b22e7930a
commit afcb2315ee
4 changed files with 87 additions and 149 deletions

View File

@@ -202,11 +202,12 @@ fn get_cache(ctx: &Context, desc: &Descriptor) -> Option<Cache> {
| "eventid_pduid" => Some(config.eventid_pdu_cache_capacity),
| "eventid_shorteventid" => Some(config.eventidshort_cache_capacity),
| "shorteventid_eventid" => Some(config.shorteventid_cache_capacity),
| "shorteventid_authchain" => Some(config.auth_chain_cache_capacity),
| "shortstatekey_statekey" => Some(config.shortstatekey_cache_capacity),
| "statekey_shortstatekey" => Some(config.statekeyshort_cache_capacity),
| "servernameevent_data" => Some(config.servernameevent_data_cache_capacity),
| "pduid_pdu" | "eventid_outlierpdu" => Some(config.pdu_cache_capacity),
| "shorteventid_authchain" | "authchainkey_authchain" =>
Some(config.auth_chain_cache_capacity),
| _ => None,
}
.map(TryInto::try_into)

View File

@@ -34,6 +34,15 @@ pub(super) static MAPS: &[Descriptor] = &[
name: "aliasid_alias",
..descriptor::RANDOM_SMALL
},
Descriptor {
name: "authchainkey_authchain",
cache_disp: CacheDisp::SharedWith("shorteventid_authchain"),
index_size: 512,
block_size: 4096,
key_size_hint: Some(8),
val_size_hint: Some(1024),
..descriptor::RANDOM_CACHE
},
Descriptor {
name: "backupid_algorithm",
..descriptor::RANDOM_SMALL
@@ -279,8 +288,11 @@ pub(super) static MAPS: &[Descriptor] = &[
},
Descriptor {
name: "shorteventid_authchain",
cache_disp: CacheDisp::Unique,
cache_disp: CacheDisp::SharedWith("authchainkey_authchain"),
key_size_hint: Some(8),
val_size_hint: Some(1024),
index_size: 512,
block_size: 4096,
..descriptor::SEQUENTIAL
},
Descriptor {