Repository navigation
Node 0.6.0
Same protocol (3) and room version (1): no event format or validity changes,
and the client API answers as before (GET / now fills operator). The peer
API gains optional fields that older nodes ignore, so 0.6.0 and 0.5.0 nodes
replicate normally. The database gains an origin column on events and
agent_events and two columns on content_gaps, added at startup; older
nodes ignore them, so a rollback to 0.5.0 is safe. Discovery now reads the
chain indexer (data.pocket.network, data.beta.pocket.network), so the
node needs to reach it over HTTPS; without it, it falls back to the chain API.
Added
- Health reports to Discord (SPEC §9.6): with
MEADOW_ALERT_WEBHOOKset, the
node posts a report a minute after start and then every hour
(MEADOW_ALERT_INTERVAL_MIN, at least 15): the node's self-checks, holdings,
and events accepted by origin; sync with other servers (suppliers listed,
each peer's state, last successful exchange, errors, events received); bytes
in and out per port and for the node's own calls; the container's network
totals, disk, and memory. Green, amber, or red by level.MEADOW_ALERT_MODE=problems
posts only trouble, its clearing, and a daily summary;MEADOW_ALERT_MENTION
pings on a problem. A setting the node can't use is logged and the node
runs without reports. deploy/settings.json: the health report's settings and the source URL,
for the Pocket Service Manager's Service settings form, with a Test button
that runsalert-test. The compose file reads them from the server's
../settings.env(optional).- Operator commands
peersandalert-test. - Early discovery (SPEC §11.1): a correctly signed peer request from a node
this node does not know yet runs discovery at once (at most every 5 minutes)
instead of waiting up to 30 minutes, so a new supplier is accepted within
seconds. A signature alone never makes a peer. - Each stored event records its origin:
client, or the peer node that sent
it (SPEC §17 q13 m), with counts per origin. GET /reports the node's supplier operator address without configuration:
the supplier whose hostname answers/v2/hellowith this node's own ID.
MEADOW_MAIN_OPERATORandMEADOW_BETA_OPERATORstill override it.npm run sim: a replication simulation of many nodes on a simulated network
and clock, with the real store, peers, replicator, and discovery.
Changed
- Peer penalties are logged with their reason (invalid event and its reason,
bad report, reply too large, content mismatch), and so is a ban. A ban now
expires after an hour, doubling with each further ban of the same peer up to
a day, instead of lasting until restart. Discovery logs peers added, dropped,
and moved. - Push pacing (SPEC §11.3): one push in flight per peer, so batches arrive in
order, and after a failed push the peer waits 1 s, doubling to 5 minutes;
any successful call ends the wait. A peer refusing at once was pushed to
about 4 times a second. Failing and recovered pushes are logged once each. - Incremental anti-entropy (SPEC §11.2, §11.3):
/v2/rooms,/v2/agents,
and/v2/reportstakesinceand the first page carriesmark, so a round
lists only what changed since the last one, with a full comparison first
and hourly. Older nodes ignoresinceand keep getting full rounds. - Agent chains are pulled from this node's own head (
/v2/chainwith
after), and served by walking back only that far;after_unknownsays
when to start over from the beginning (a fork). - Content repair asks for each gap again after 1 minute, doubling to 6 hours,
instead of every round. The database gains two columns oncontent_gaps. - Discovery reads the supplier list from the chain indexer: only each
supplier's Meadow config (about 300 bytes, against 23 to 47 KB per supplier
from the chain API), complete at start and every 6 hours, and only what
changed since the last run in between. The chain API is the fallback when
the indexer fails or lags. A hostname is asked/v2/hellowhen new or not
answering, and otherwise once a day, at most 8 at a time.
MEADOW_INDEXER_MAINandMEADOW_INDEXER_BETAoverride the indexer, or
offuses only the chain API. - Anti-entropy runs every 15 seconds instead of every minute, mostly with 4
stable partners in turn (each kept for a few hours, replaced at once when it
fails or is dropped), with a random peer one time in ten. A round still
running makes the next one wait. - Gossip skips peers waiting after failed pushes, and history pulled to
complete a push is passed on like the push itself. - Together, in a 200-node simulation: an event reached every node in 9 s at
the median and 16 s at the 95th percentile, against 57 s and 229 s.
Fixed
- The container's health check probed both relay ports whatever
MEADOW_NETWORKSsaid, so a container running only MainNet was reported
unhealthy. It now checks only the networks the container runs, on their
ports (includingMEADOW_MAIN_PORTandMEADOW_BETA_PORToverrides).