@blinklabs/dingo 0.46.4 → 0.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md DELETED
@@ -1,38 +0,0 @@
1
- # CLAUDE.md
2
-
3
- Go Cardano node (Ouroboros). Derivable info (build targets, flags, package layout) lives in `Makefile`, `go.mod`, `node.go`, `dingo.yaml.example`. This file is only what isn't derivable.
4
-
5
- ## Testing
6
-
7
- - No `time.Sleep()` for sync. Use `internal/test/testutil/`:
8
- - `WaitForCondition` / `require.Eventually` — 2–5s timeout, 5–10ms interval, lock shared state inside the condition fn
9
- - `RequireReceive` / `RequireNoReceive` for channel assertions
10
- - `context.WithTimeout` for graceful shutdown
11
- - `make test` runs with `-race`.
12
- - Integration tests in `internal/integration/` load real blocks from `database/immutable/testdata/`.
13
- - Mock fixtures come from `github.com/blinklabs-io/ouroboros-mock` (`fixtures/`, `ledger/`, `conformance/`). Never add local ledger/consensus/network mocks — extend the shared library.
14
- - DevNet (`internal/test/devnet/run-tests.sh`, see `internal/test/devnet/README.md`): use to validate any change that touches consensus, block production, header/VRF/KES/OpCert verification, chain selection, mempool, tx submission, NtN/NtC protocols, epoch boundaries, or nonce computation. Brings up Dingo + cardano-node side by side with `txpump` feeding the mempool, so it surfaces divergence from the reference implementation that unit and conformance tests miss. Run conformance (`internal/test/conformance/`) after every change; run DevNet additionally for consensus-affecting work.
15
-
16
- ## Pre-commit
17
-
18
- ```shell
19
- golangci-lint run ./...
20
- nilaway ./...
21
- modernize ./... # --fix to auto-apply
22
- ```
23
-
24
- ## Non-obvious invariants
25
-
26
- - CBOR offsets: UTxOs/txs store 52-byte `CborOffset` refs (magic `"DOFF"` + slot + hash + offset + length), not full CBOR. Resolved via `TieredCborCache` (hot → block LRU → cold blob extract). See `database/cbor_offset.go`, `database/cbor_cache.go`, `database/block_indexer.go`.
27
- - EventBus for async cross-component notifications: block/chain/mempool/peer events go through `event.EventBus.SubscribeFunc()`. Synchronous state queries between components still use direct method calls.
28
- - Cert ordering: multiple certs per slot — tie-break with `Order("added_slot DESC, block_index DESC, cert_index DESC")` (`cert_index` resets per tx, so `block_index` is required to disambiguate across txs in the same block).
29
- - Rollbacks: `Chain.Rollback(point)` emits `ChainRollbackEvent`; check `TransactionEvent.Rollback` for undo.
30
- - Plugins (`database/plugin/`): blob = `badger` (default) | `gcs` | `s3`; metadata = `sqlite` (default) | `mysql` | `postgres`.
31
- - Config priority: CLI > env > YAML > defaults.
32
-
33
- ## Profiling
34
-
35
- ```shell
36
- ./dingo --cpuprofile=cpu.prof --memprofile=mem.prof load database/immutable/testdata
37
- go tool pprof cpu.prof
38
- ```