DMC-14: a state put answers its bucket's fill beside its revision

mesh/state.put answers {"revision", "fill": {"count", "bytes", "max_bytes"}}, buscalls.Fill's
form, read from the bound stream's info once per put, since the key-value put answers no figures;
a bundle's prune reads it from the put.

Builds: design 47 H2 DMC-14, H-A-350, H-A-386
This commit is contained in:
2026-11-22 00:12:23 +01:00
parent a1c12af8b2
commit ec3fe34afc
3 changed files with 48 additions and 11 deletions
+6 -1
View File
@@ -1264,7 +1264,12 @@ func (b *moduleBus) State(verb string, params json.RawMessage) (json.RawMessage,
if err != nil {
return nil, err
}
answer = map[string]any{"revision": revision}
// With the bucket's fill, so a bundle's prune reads it from the put (design 47 H2 DMC-14, H-A-386).
fill, err := conn.StateFill(b.module, asked.State)
if err != nil {
return nil, fmt.Errorf("%s was put at revision %d, but its state's fill is not read: %w", asked.Key, revision, err)
}
answer = map[string]any{"revision": revision, "fill": fill}
case "delete":
if err := conn.StateDelete(b.module, asked.State, asked.Key); err != nil {
return nil, err