From a3a47d7da58c0e285ef3fb6e69a5dad9111474c3 Mon Sep 17 00:00:00 2001 From: Dave Grantham Date: Thu, 8 Oct 2026 17:10:13 -0600 Subject: [PATCH 1/2] update msrv Signed-off-by: Dave Grantham --- .github/workflows/rust.yml | 6 +++--- Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1ba2dea..ecdc50c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -50,14 +50,14 @@ jobs: run: cargo doc --no-deps msrv: - name: Verify MSRV (1.96) + name: Verify MSRV (1.99) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Rust Toolchain (1.96) - uses: dtolnay/rust-toolchain@1.96.0 + - name: Install Rust Toolchain (1.99) + uses: dtolnay/rust-toolchain@1.99.0 - name: Pin pkcs1 to 0.8.0-rc.4 # Same mitigation as in the build job: sad-rsa 0.2.3 fails to compile diff --git a/Cargo.toml b/Cargo.toml index e604a64..051b920 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "provenance-log" version = "2.3.2" edition = "2021" -rust-version = "1.96" +rust-version = "1.99" authors = ["Dave Grantham "] description = "Programmable cryptographic provenance logs" repository = "https://github.com/cryptidtech/provenance-log.git" diff --git a/README.md b/README.md index a319dbe..7c323e8 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Each entry in the log represents a state transition that must be cryptographical provenance-log = "2.0" ``` -MSRV: Rust 1.85. +MSRV: Rust 1.99. ## License From 4871417e9d271e67879fb9091c448f57aa10b352 Mon Sep 17 00:00:00 2001 From: Dave Grantham Date: Thu, 8 Oct 2026 23:41:08 -0600 Subject: [PATCH 2/2] update multi-hash Signed-off-by: Dave Grantham --- CHANGELOG.md | 10 +++++ Cargo.toml | 26 +++++------ src/entry.rs | 83 +++++++++++++++++------------------- src/log.rs | 8 ++-- src/serde/mod.rs | 90 ++++++++++++++++----------------------- tests/alleged_cid.rs | 13 +++--- tests/delegation.rs | 40 +++++++---------- tests/entry_cid_compat.rs | 38 +++++++++++++++++ tests/serialization.rs | 10 ++--- tests/verification.rs | 48 +++++++++------------ tests/version_rules.rs | 10 ++--- 11 files changed, 190 insertions(+), 186 deletions(-) create mode 100644 tests/entry_cid_compat.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index e3b9c7e..16c0545 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.4.0] - 2026-10-08 + +### Changed + +- Migrated the crate to multi-hash 2.0. Requirement `multi-hash` 1.1 → 2.0 and `multi-cid` 0.2 → 0.3. All 30 `Builder::new_from_bytes` call sites moved to the streaming builder shape (`Builder::new` plus `update` and `try_build`). The two Blake3 sites, the cached `Entry::cid()` path and the `bogus_cid` test helper, pin `.output_len(32)`, the digest length multi-hash 1.1 produced, so the Cid bytes of stored entries stay byte for byte identical; the fixed-output SHA2-256, SHA3-256, and SHA3-512 sites keep their digests unchanged besides the new call shape. +- The crate requires multi-hash 2.0, which declares rust-version = "1.99". +- The dependency graph carries two multi-hash majors for now: 2.0.1 from this crate and multi-cid 0.3.0, and 1.1.2 through the published multi-key 2.1.0 the crate keeps requiring. The code never exchanges multi-hash types with multi-key, so the split major stays harmless until a multi-key release moves to multi-hash 2.0. No public API changes. +- Added the `stored_entry_cid_byte_compatibility` regression test, which asserts that the cached `Entry::cid()` path still produces the exact Cid bytes captured under multi-hash 1.1 for a deterministic entry. + ## [2.3.2] - 2026-10-07 ### Changed @@ -293,6 +302,7 @@ Synced from the BetterSign workspace `bs-provenance-log 0.7.0` crate. This is a - First approximation. Initial implementation of programmable cryptographic provenance logs. +[2.4.0]: https://github.com/cryptidtech/provenance-log/compare/v2.3.2...v2.4.0 [2.3.2]: https://github.com/cryptidtech/provenance-log/compare/v2.3.1...v2.3.2 [2.3.0]: https://github.com/cryptidtech/provenance-log/compare/v2.2.0...v2.3.0 [2.2.0]: https://github.com/cryptidtech/provenance-log/compare/v2.1.0...v2.2.0 diff --git a/Cargo.toml b/Cargo.toml index 051b920..2d64e35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "provenance-log" -version = "2.3.2" +version = "2.4.0" edition = "2021" rust-version = "1.99" authors = ["Dave Grantham "] @@ -20,20 +20,20 @@ slow-tests = [] [dependencies] log = "0.4" -multi-base = { version = "1.0", default-features = false } -multi-cbor = { version = "0.1", optional = true } -multi-cid = "0.2" -multi-codec = "1.5" -multi-hash = "1.1" -multi-key = "2.1" -multi-sig = "1.5" -multi-trait = { version = "1.0", default-features = false } -multi-util = "1.1" -multi-vlad = "0.2" +multi-base = { version = "1.1", default-features = false } +multi-cbor = { version = "0.2", optional = true } +multi-cid = "0.3" +multi-codec = "1.6" +multi-hash = "2.0" +multi-key = "2.2" +multi-sig = "1.6" +multi-trait = { version = "1.1", default-features = false } +multi-util = "1.2" +multi-vlad = "0.3" once_cell = "1.21" thiserror = "2.0" serde = { version = "1.0", default-features = false, features = ["alloc", "derive"], optional = true } -wacc = "2.2" +wacc = "2.3" wasmtime = { version = "49.0", default-features = false, features = [ "cranelift", "parallel-compilation", @@ -45,7 +45,7 @@ wasmtime = { version = "49.0", default-features = false, features = [ [dev-dependencies] criterion = "0.8" hex = "0.4" -multi-cbor = "0.1" +multi-cbor = "0.2" proptest = "1.11" rand_010 = { package = "rand", version = "0.10" } serde_json = "1.0" diff --git a/src/entry.rs b/src/entry.rs index d4c1777..4b13883 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -531,13 +531,20 @@ impl Entry { .get_or_init(|| { let mut v = Vec::new(); self.encode_into_buffer(&mut v); + let mut hash_builder = mh::Builder::new(Codec::Blake3) + .expect("Blake3 is a hashing codec, a builder for it should always be created"); + hash_builder.update(v.as_slice()); + // Blake3 is an extendable-output codec in multi-hash 2.0 and requires an + // explicit digest length. Every stored entry hashed Blake3 to 32 bytes + // under multi-hash 1.1, so pinning 32 keeps the Cid bytes of stored + // entries byte-for-byte stable across the builder shape change. + hash_builder.output_len(32); cid::Builder::new(Codec::Cidv1) .with_target_codec(Codec::DagCbor) .with_hash( - &mh::Builder::new_from_bytes(Codec::Blake3, v.as_slice()) - .expect("Blake3 hashing of entry bytes should never fail") + &hash_builder .try_build() - .expect("Multihash building should never fail with valid Blake3 hash"), + .expect("a Blake3 multihash with a 32 byte digest should always build"), ) .try_build() .expect("CID building should never fail with valid hash and codec") @@ -907,24 +914,20 @@ mod tests { fn test_sort_locks_change_lock_order() { let vlad = Vlad::default(); let script = Script::default(); + let mut hash_builder = mh::Builder::new(Codec::Sha2256) + .expect("SHA2-256 is a hashing codec, a builder for it should always be created"); + hash_builder.update(b"for great justice"); let cid1 = cid::Builder::new(Codec::Cidv1) .with_target_codec(Codec::DagCbor) - .with_hash( - &mh::Builder::new_from_bytes(Codec::Sha2256, b"for great justice") - .unwrap() - .try_build() - .unwrap(), - ) + .with_hash(&hash_builder.try_build().unwrap()) .try_build() .unwrap(); + let mut hash_builder = mh::Builder::new(Codec::Sha3256) + .expect("SHA3-256 is a hashing codec, a builder for it should always be created"); + hash_builder.update(b"move every zig"); let cid2 = cid::Builder::new(Codec::Cidv1) .with_target_codec(Codec::DagCbor) - .with_hash( - &mh::Builder::new_from_bytes(Codec::Sha3256, b"move every zig") - .unwrap() - .try_build() - .unwrap(), - ) + .with_hash(&hash_builder.try_build().unwrap()) .try_build() .unwrap(); let locks_in1: Vec