feat(v4.0.0): storage speaks messages -- a device over v3's block chains, common and private

What is on a storage port (v4/system/storage.c): it takes Block read,
Block write and Block data and answers Block data or Block done.  It
holds a view of a common chain, a private chain, or both; private block k
is number 2^32 - 1 - k.  Behind it is v3's block subsystem, reached
through v4/system/store_v3.c, the one v4 file that includes v3's headers.

v3's block code links here with its two device back ends, its log and
its clock, and nothing else of v3.

v4/tests/test_store.c: 36 checks at 64 bits, 35 at 32, and under the
sanitizers.  docs/v4.0.0/MESH.md 8.3, 8.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-06 20:41:07 -04:00
co-authored by Claude Opus 5.5
parent 0e761cb117
commit 4a505a154d
6 changed files with 525 additions and 6 deletions
+12
View File
@@ -34,6 +34,18 @@
#define V4_MSG_OUTPUT 2 /* what a node printed */
#define V4_MSG_DONE 3 /* how the text ended: one word, V4_TEXT_* */
/* Storage (docs/v4.0.0/MESH.md 8.3). A block's number is one word of
* payload, written as it is; a block is 1024 characters. */
#define V4_MSG_BLOCK_READ 4 /* the block's number; answered by BLOCK_DATA, or BLOCK_DONE with an error */
#define V4_MSG_BLOCK_WRITE 5 /* the block's number; a BLOCK_DATA follows; answered by BLOCK_DONE */
#define V4_MSG_BLOCK_DATA 6 /* 1024 characters */
#define V4_MSG_BLOCK_DONE 7 /* one word, V4_STORE_* */
#define V4_STORE_OK 0
#define V4_STORE_NONE 1 /* there is no storage for that number */
#define V4_STORE_REFUSED 2
#define V4_STORE_RANGE 3 /* there is no such block */
/* how text ended */
#define V4_TEXT_QUIT 0 /* QUIT: nothing is to be said */
#define V4_TEXT_COMPLETED 1 /* a console says " ok" */