All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[2.2.0]
- Reject strategy-provided machine IDs outside
0..511; an invalid ID fails startup immediately. - Use the
:nameoption as theNoNoncense.MachineIdsupervisor child ID, allowing multiple named instances under one supervisor. Existing supervisor references to named children must use their configured names. - Reduce the columns fetched when acquiring a
SqlLease. - Clarify that the
SqlLeasemigration must run before starting a machine ID supervisor using that strategy. - Protect
SqlLeaseandRedisLeaseID reuse against clock skew by recording the lease holder's local expiry and requiring the successor's local clock to pass that cutoff. Lease strategies and nonce factories share a fixed clock offset. - Quarantine released IDs for one second before reuse; clock-skew protection may delay reuse further.
- Report confirmed lease ownership loss as
:not_ownerinstead of:expiredinSqlLeaseandRedisLease, including lease-loss callbacks and telemetry. - Limit conflict-guard broadcasts to the resolved machine ID and start timestamp.
[2.1.0]
Machine ID lease management has been substantially reworked to better withstand coordinator failures, slow callbacks, and lease loss while protecting nonce uniqueness.
- Enforce local lease expiry independently of strategy callbacks, disabling factories on lease loss, expiry, or store shutdown. Release locally rejected leases on a best-effort basis.
- Add
:callback_timeoutto bound acquisition, renewal, and release calls. - Remove internal
LeaseManager.machine_id/0,1,LeaseManager.lease_lost/0,1,2, andLeaseCacheAPIs. Direct use was not a supported integration; the supportedNoNoncense.MachineIdsupervision API is unchanged. - Require strategy
release/2callbacks to be idempotent and ignore stale leases; they may run after a replacement is acquired. SqlLeaseprevents delayed renewals from reviving released leases.- Prevent duplicate nonces when a factory is reinitialized shortly after lease loss.
- Rename telemetry
:sourcevalue:cacheto:storeand add:loss. - Fix an off-by-one timestamp overflow check.
- RedisLease and SqlLease now attempt acquisition of up to 512 IDs (possibly pre-empted by the callback timeout), shuffled after the first three (so they still prefer the lowest available).
[2.0.0]
NoNoncense.MachineIdis now a supervisor that can manage machine ID leases using several strategies based on MySQL / Postgres / Redis / Valkey coordination, or Kubernetes Statefulsets, or classic static node identifiers. NoNoncense can still be initialized directly using a static machine ID.- Add optional telemetry for machine ID lease management and conflict detection. See
NoNoncense.Telemetryfor the emitted events. - Drop support for Elixir 1.15, minimal supported version is now 1.16 (with OTP 25).
NoNoncenseraises explicitNoNoncense.Errors.DisabledErrorandNoNoncense.Errors.UninitializedErrorwhen appropriate, instead of relying on the:persistent_term.get/1argument error.
[1.3.1]
- Use bitwise operations to process atomics
- Fix sortable nonce initialization (this did not cause problems in practice but was technically incorrect)
[1.3.0]
- Formulate an explicit support policy.
- Support Elixir 1.20 and Erlang/OTP 29.
- Drop support for Elixir 1.14, minimal supported version is now 1.15 (with OTP 25).
[1.2.0]
Changed
- Internal refactor: State is now stored in a typed record (
NoNoncense.State) for improved maintainability. - Performance: 64-bit counter is initialized with the startup timestamp, eliminating a redundant addition on each
nonce/2call. - Performance: Minor optimization in the
nonce/2hot path.
Other
- Updated dependencies.
[1.1.3]
- Fixed documentation typos.
- Added link to Speck Rust crate docs.
[1.1.2]
- Improved documentation.
- Extended CI to run on Windows and macOS.
[1.1.1]
- Updated documentation to reflect that legacy ciphers (Blowfish, 3DES) are unavailable on Windows and macOS.
[1.1.0]
- Add
encrypt/2,decrypt/2andencrypted_nonce/3.
[1.0.0]
Breaking Changes
- Encryption key management: Encryption keys must now be provided at initialization via
NoNoncense.init/1using the:base_keyoption (or individual:key64,:key96,:key128options). Keys are no longer passed toencrypted_nonce/2. - Default encryption algorithm changed: The default encryption algorithm for 64-bit and 96-bit nonces has been changed from
:des3to:blowfishfor better performance and security. - Function signature change:
encrypted_nonce/3signature changed fromencrypted_nonce(name \\ __MODULE__, bit_size, key)toencrypted_nonce(name \\ __MODULE__, bit_size).
Added
- Speck cipher support: Added optional support for the Speck cipher family via the
speck_exdependency, providing native block sizes for 64-bit, 96-bit, and 128-bit nonces with excellent performance. - Algorithm selection: New options
:cipher64,:cipher96, and:cipher128inNoNoncense.init/1allow choosing encryption algorithms per nonce size.- 64/96 bits:
:blowfish(default),:des3and:speck - 128 bits:
:aes(default) and:speck
- 64/96 bits:
- Key derivation: Automatic key derivation from
:base_keyusing PBKDF2-HMAC-SHA256, eliminating the need to manage separate keys for each nonce size.
Changed
- Performance improvement: Pre-initialization of encryption ciphers at startup provides huge performance gains.
- Default algorithms: 64-bit and 96-bit nonces now default to
:blowfishinstead of:des3for better performance and security.
Migration Guide
See MIGRATION.md for detailed migration instructions.
[0.0.1 - 0.0.7]
Initial releases, changes were mainly performance improvements.