Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "provenance-log"
version = "2.3.2"
version = "2.4.0"
edition = "2021"
rust-version = "1.96"
rust-version = "1.99"
authors = ["Dave Grantham <dwg@linuxprogrammer.org>"]
description = "Programmable cryptographic provenance logs"
repository = "https://github.com/cryptidtech/provenance-log.git"
Expand All @@ -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",
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
83 changes: 38 additions & 45 deletions src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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<Script> = vec![
Expand Down Expand Up @@ -996,24 +999,20 @@ mod tests {
fn test_sort_locks_no_ops() {
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_in: Vec<Script> = vec![
Expand Down Expand Up @@ -1058,24 +1057,20 @@ mod tests {
fn test_sort_locks() {
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_in: Vec<Script> = vec![
Expand Down Expand Up @@ -1156,14 +1151,12 @@ mod tests {
.unwrap();

// build a cid for Script::Cid
let mut hash_builder = mh::Builder::new(Codec::Sha3512)
.expect("SHA3-512 is a hashing codec, a builder for it should always be created");
hash_builder.update(b"for great justice, move every zig!");
let cid = cid::Builder::new(Codec::Cidv1)
.with_target_codec(Codec::DagCbor)
.with_hash(
&mh::Builder::new_from_bytes(Codec::Sha3512, b"for great justice, move every zig!")
.unwrap()
.try_build()
.unwrap(),
)
.with_hash(&hash_builder.try_build().unwrap())
.try_build()
.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,10 @@ mod tests {
}

fn get_hash_update_op(k: &str, preimage: &str) -> Op {
let mh = mh::Builder::new_from_bytes(Codec::Sha3512, preimage.as_bytes())
.unwrap()
.try_build()
.unwrap();
let mut hash_builder = mh::Builder::new(Codec::Sha3512)
.expect("SHA3-512 is a hashing codec, a builder for it should always be created");
hash_builder.update(preimage.as_bytes());
let mh = hash_builder.try_build().unwrap();
Op::Update(k.try_into().unwrap(), Value::Data(mh.into()))
}

Expand Down
Loading
Loading