The have bucket takes a node's whole facts, as large as a chain value, never cut (issue 1162) #385

Merged
mesh-tools merged 1 commits from fix/1162-have-node-size into main 2026-10-18 22:07:28 +00:00
2 changed files with 13 additions and 2 deletions
Showing only changes of commit 75a27ec1a4 - Show all commits
+4 -2
View File
@@ -449,7 +449,9 @@ func EnsureLeaseBucket(ctx context.Context, js jetstream.JetStream) error {
}
// HaveBucketConfig is the options of the have bucket (novox/hq ADR 0429 §1): delivery.HaveHistory revisions of each
// key, no age, a value under a kilobyte (a have is JSON of about 500 bytes), 64 MiB on disk like the assignments.
// key, no age, 64 MiB on disk like the assignments. A module's have is JSON of about 500 bytes, but a node's own key
// carries its whole facts (its profile among them), several kilobytes on a desktop: a value is as large as the chain's
// buckets take, since a value is never cut (novox/hq ADR 0408 §6, issue 1162).
func HaveBucketConfig() jetstream.KeyValueConfig {
return jetstream.KeyValueConfig{
Bucket: delivery.HaveBucket,
@@ -457,7 +459,7 @@ func HaveBucketConfig() jetstream.KeyValueConfig {
"own facts) (novox/hq ADR 0429, design 47): written by each machine's node-engine under its own node's keys " +
"alone, never by the controller; read by the delivery view and the watchman",
History: delivery.HaveHistory,
MaxValueSize: 4 << 10,
MaxValueSize: ChainValueBytes,
MaxBytes: 64 << 20,
Storage: jetstream.FileStorage,
}
+9
View File
@@ -104,3 +104,12 @@ func TestAModuleReadingHaveAssignmentsAndBuildsReadsAndWritesNone(t *testing.T)
}
}
}
// A node's own key carries its whole facts (its profile among them), several kilobytes on a desktop: the have
// bucket takes any value the chain's buckets take, since a value is never cut (novox/hq ADR 0408 §6, issue 1162).
// 1162/AC1
func TestTheHaveBucketTakesAValueAsLargeAsTheChains(t *testing.T) {
if got := HaveBucketConfig().MaxValueSize; got != ChainValueBytes {
t.Fatalf("the have bucket takes values up to %d bytes, the chain's up to %d", got, ChainValueBytes)
}
}