0xMiden / 0xMiden/note-transport-service

Node runs without persistence by default (--database-url :memory:) and loses all notes silently

Offen
#112 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
3
Forks
10
Ø Merge
2 Std. 23 Min.
Gemergte PRs (30 T.)
4

Beschreibung

### Packages versions

miden-note-transport-node: v0.4.0 (default still present on main)

### Bug description

The node defaults to --database-url :memory:, and the Dockerfile CMD doesn't override it, so containers run with zero persistence unless the operator adds a flag.
Worse than losing data on restart: for :memory: the pool holds a single connection, and if it's ever discarded, deadpool transparently opens a new one, a brand-new empty database, migrations auto-run, no log, no downtime.
One dropped connection means total data loss on a healthy process.

Suggested fixes:
- Default --database-url to a file path (or make it required); :memory: should be explicit opt-in.
- Dockerfile CMD should pass a persistent path and declare a VOLUME.
- Log a prominent warning when running in-memory.

Happy to contribute a PR.

### How can this be reproduced?

1. Run the image with defaults, send a note, confirm it's fetchable.
2. Restart the container (or force the pooled connection to be recycled — no restart needed).
3. All notes are gone; the service stays healthy and logs nothing.

### Relevant log output

```shell
Database: :memory: # startup, the only signal — nothing is logged when the data is lost
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.