denoland/celldPublic

self-hosted, distributed Durable Objects

v0.6.0

Upgrading from v0.5.1 with fleet durability requires stopping the whole fleet
first. A fleet with bucket durability can use a rolling update.

- Each Durable Object facet has its own SQLite file and replication stream. A
  facet write no longer copies the facet database into the root or joins a
  root transaction. A facet can start from a class in `ctx.exports`. Facets
  from v0.5.1 migrate on first open.
- `crypto.subtle` supports Ed25519 (also as `NODE-ED25519`) and X25519, with
  `raw` import and export. (#221)
- Per-cell memory: the SQL statement cache is capped at 128 KiB of compiled
  statements instead of 1 MiB of SQL text, which could hold tens of MB. A cell
  shares one object store client instead of three, and operation timers no
  longer leak one map entry per operation.
- Stricter workerd parity: `WorkerCode` requires `compatibilityDate`, a wasm
  module in `modules` must be `{ wasm: bytes }`, `export const X = "..."` in
  a main module fails the Worker's start, and the `transactionSync()` callback
  receives no argument.
- `ctx.exports` holds `default` and each entrypoint, and `fetch()` on its
  stubs sends an HTTP request.
- R2 keeps empty key segments, so `a/b`, `/a/b`, `a//b`, and `a/b/` are four
  objects. An object v0.5.1 wrote as `photos/` stays at `photos`.
- Invalid UTF-8 in SQLite `TEXT` decodes as U+FFFD instead of failing.
- `Headers` accepts values above U+00FF and decodes response values as UTF-8.
- A WebSocket close is `wasClean: true` whenever the peer sent a close frame.
- `run_worker_first` accepts the root route `/`.
- Recovery waits for range evidence from a follower's log tail.

Issues fixed:

- #226: Nest `transactionSync()` calls through the root storage handle.
- #227: Resolve relative imports in Dynamic Worker subdirectories.
- #228: Fire a re-armed alarm on time despite the handler's pending timers.
- #229: Deliver WebSocket frames while `webSocketMessage()` runs.
- #232: R2 `list()` returns non-ASCII and `%` keys as `put()` received them.

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Yusuke Tanaka <yusuktan@maguro.dev>
YTRDBIBartek Iwańczuk and 2 others authored
bad4649Patch
Parent42269c1
59 files changed+11174-8787
StackedSplit
Cargo.lock+1 −1
crates/celld/Cargo.toml+1 −1
crates/celld/actor.rs+45 −12
crates/celld/bucket.rs+90 −23
crates/celld/cell_host.rs+208 −0
crates/celld/cell_runtime.rs+310 −0
crates/celld/clean_reload.rs+49 −0
crates/celld/deploy.rs+1 −1
crates/celld/engine_api.rs+877 −0
crates/celld/facet_streams.rs+313 −0
crates/celld/generation.rs+204 −1
crates/celld/host_channels.rs+282 −0
crates/celld/host_services.rs+23 −0
crates/celld/http_streams.rs+2105 −0
crates/celld/js.rs+514 −3852
crates/celld/js/bootstrap.rs+32 −263
crates/celld/js/crypto.js+70 −8
crates/celld/js/crypto.rs+140 −14
crates/celld/js/harness.js+123 −1154
crates/celld/js/headers.js+3 −2
crates/celld/js/modules.rs+83 −9
crates/celld/js/r2_ops.rs+21 −735
crates/celld/js/services/kv.js+1127 −0
crates/celld/js/storage_ops.rs+12 −16
crates/celld/js/websocket.rs+107 −887
crates/celld/kv_blob.rs+180 −0
crates/celld/lib.rs+13 −0
crates/celld/local_store.rs+21 −9
crates/celld/ltx_repl.rs+261 −32
crates/celld/ltx_replication.rs+162 −0
crates/celld/main.rs+56 −7
crates/celld/main/websocket.rs+11 −7
crates/celld/node_log.rs+709 −188
crates/celld/ownership_store.rs+8 −2
crates/celld/pool.rs+27 −60
crates/celld/queue_policy.rs+465 −0
crates/celld/r2_store.rs+750 −0
crates/celld/runtime.rs+165 −935
crates/celld/storage.rs+211 −501
crates/celld/wake.rs+1 −1
crates/celld/wake_entry.rs+124 −0
crates/celld/ws_registry.rs+1069 −0
crates/logic/cron.rs+41 −0
docs/README.md+7 −0
docs/cloudflare-compat.md+6 −0
docs/guarantees.md+44 −0
docs/limitations.md+1 −1
docs/security.md+4 −3
docs/services/d1.md+3 −2
docs/services/durable-object-facets-flow.svg+5 −6
docs/services/durable-object-facets.md+30 −38
docs/services/durable-objects.md+12 −4
docs/services/dynamic-workers.md+10 −6
docs/services/r2.md+25 −0
docs/services/static-assets.md+2 −2
docs/services/workers.md+4 −1
docs/wasm.md+4 −3
examples/dynamic-worker-tails/index.js+1 −0
examples/facets/index.js+1 −0