aboutsummaryrefslogtreecommitdiffstats
path: root/src/access/rules.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-17 03:15:02 +0000
committertv <tv@krebsco.de>2026-11-17 04:40:12 +0100
commitd6194cdc78b69914810cfc02bbd31aef41067be4 (patch)
treee72d446e6fe373a020285e608a1bf8f3b6c79b90 /src/access/rules.rs
parent4e72aacfc5006317af4989d3779d14940281761f (diff)
holding: a node writes its acks and the compactions it coordinates
A change of a swarm holding a store may write its node's own protocol data a remake needs (`docs/store.md`, What a change writes): its acks, a remake's record and proposal, where there is none, of a compaction it coordinates, and, as the coordinator, its decision, or the record of the remake that made the epoch, carried into it whole; and the maps holding them, where there are none. An abort asked for by another than the coordinator stays closed, as does any other kind of remake. Rows 14 and 21 are judged here.
Diffstat (limited to 'src/access/rules.rs')
-rw-r--r--src/access/rules.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/access/rules.rs b/src/access/rules.rs
index d1edfd5..9597774 100644
--- a/src/access/rules.rs
+++ b/src/access/rules.rs
@@ -171,7 +171,7 @@ pub(crate) fn judge_reading(
// its genesis change, or not at all.
#[cfg(feature = "federation")]
match policy {
- Policy::Store(fold) => return super::holding::judge(&at, change, fold),
+ Policy::Store(fold) => return super::holding::judge(&at, epoch, change, fold),
_ if super::holding::turns_store(change.ops) => {
return Err(Refusal::Rule(
"a swarm holds a store from its genesis change only".to_owned(),
@@ -565,7 +565,7 @@ fn shown(path: &Path) -> String {
/// Whether remake `id`, coordinated by `node`, made `epoch`: as its snapshot's metadata
/// says (`remake::snapshot`), at `at`. Never genesis.
-fn made_the_epoch(at: &At<'_>, epoch: Epoch, id: &str, node: &str) -> bool {
+pub(super) fn made_the_epoch(at: &At<'_>, epoch: Epoch, id: &str, node: &str) -> bool {
if epoch.generation == 0 {
return false;
}
@@ -584,7 +584,7 @@ fn made_the_epoch(at: &At<'_>, epoch: Epoch, id: &str, node: &str) -> bool {
}
/// The coordinator remake `id`'s proposal names, at `at`.
-fn coordinator(at: &At<'_>, id: &str) -> Option<String> {
+pub(super) fn coordinator(at: &At<'_>, id: &str) -> Option<String> {
let proposal = store::read_path(at, &meta::path(&[meta::REMAKES, id, "proposal"]))
.ok()
.flatten()?;