Skip to content

perf(transaction): cache empty ZIP-244 bundle hashes#288

Open
czarcas7ic wants to merge 8 commits into
mainfrom
adam/cache-empty-zip244-bundle-hashes
Open

perf(transaction): cache empty ZIP-244 bundle hashes#288
czarcas7ic wants to merge 8 commits into
mainfrom
adam/cache-empty-zip244-bundle-hashes

Conversation

@czarcas7ic

@czarcas7ic czarcas7ic commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Motivation

ZIP-244 transaction IDs and authorizing-data digests recompute fixed BLAKE2b hashes whenever transparent, Sapling, Orchard, or Ironwood bundle nodes are absent.

Solution

Use verified constants for those empty digest nodes and for missing Sapling spend or output children. A unit test recomputes every constant from its personalization.

The digest benchmark now covers both an Orchard-only V5 transaction and an Ironwood-only V6 transaction. The V6 case leaves the transparent, Sapling, and Orchard bundles empty.

Benchmark

Using the same Ironwood-only V6 benchmark harness on main at 819ef11 and this branch:

  • auth_digest: 5.2405 us to 5.0703 us, 2.8% faster (95% CI: 2.5% to 3.1%)
  • txid_and_auth_digest: 7.3915 us to 6.9712 us, 5.6% faster (95% CI: 5.5% to 5.8%)

Rerun with:

cargo bench -p zakura-chain --bench transaction --locked -- ironwood_only

Testing

  • cargo fmt --all -- --check
  • cargo test -p zakura-chain zip244 --locked
  • cargo bench -p zakura-chain --bench transaction --locked -- ironwood_only
  • cargo clippy -p zakura-chain --all-targets --locked -- -D warnings

@czarcas7ic

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 56bda41b0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@czarcas7ic
czarcas7ic marked this pull request as ready for review July 19, 2026 23:02
Comment thread zakura-chain/src/transaction/zip244.rs Outdated
Comment thread zakura-chain/src/transaction/zip244.rs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Zakura PR node run — tip/mainnet ✅

Verdict ok
Commit bae4e0304c2e69ddd89becc1bab7dc17471c6045
Duration 60 min
Height 3417514 → 3419382 (+1868)
Blocks/hour 1868
Estimated tip at end 3419382
Peers (min/last) 8 / 17
Peak RSS 628.7 MiB
Service at end active, 0 restart(s)
Log errors/warns/panics 0 / 3 / 0

Height over time

Elapsed Height Peers RSS (MiB)
0m 3417514 9 277.6
5m 3419254 9 616.1
9m 3419339 9 623.9
14m 3419342 10 624.9
18m 3419351 10 625.1
23m 3419356 10 625.5
27m 3419358 13 625.9
32m 3419361 13 626.3
36m 3419364 13 626.8
41m 3419369 14 626.9
45m 3419372 14 627.1
50m 3419373 15 627.4
54m 3419379 15 627.9
59m 3419381 17 628.7
59m 3419382 17 628.7

Notes

  • State DB format v28 matches the PR tree.
  • Incremental build took 259s (warm baked cache).

Droplet deleted after the run.

Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants