You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
storage/admin: a 4 419-line LMDB module and helpers implemented twice #1213
crates/nostream-storage/src/lmdb/events.rs is 4,419 lines. Writes, retention, purge, filter planning, paging, counting and reconciliation live in one file, so a change to any one of them is a change to a file nobody can hold in their head, and the module's tests are one module's tests.
derive_from_secret exists twice, with different return types: nostream-relay/src/relay_key.rs:123 returns [u8; 32], nostream-services/src/payments/mod.rs:232 returns Vec<u8>. Same HMAC-SHA256 construction, two implementations, so a change to the derivation is a change in two places.
iso8601 exists twice in one crate: nostream-admin/src/state.rs:740 and nostream-admin/src/utils/nip05.rs:67.
Duplication here is not cosmetic: each copy is a place a fix can land and another can be missed, and the two derive_from_secrets return different types, which means they are not even interchangeable today.
Acceptance:
lmdb/events.rs is split by concern — writing, reading/paging, retention/purge, reconciliation — with the public surface unchanged, and the existing tests still pass against the new module boundaries without edits.
One derive_from_secret, in the crate both callers can depend on, with the [u8; 32] return and callers adapting at their own edge.
One iso8601 per crate, imported rather than redefined.
Activity