Skip to content

build!: vendor bincode 2.0.1 as GroveDB workspace crates - #940

Merged
QuantumExplorer merged 2 commits into
developfrom
codex/vendor-bincode-2-0-1
Sep 8, 2026
Merged

QuantumExplorer merged 2 commits into
developfrom
codex/vendor-bincode-2-0-1

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

GroveDB currently depends on the unmaintained bincode 2.0.1 release. Bring that exact release into the workspace as grovedb-bincode and grovedb-bincode-derive so future maintenance can happen in this repository.

This is an import and dependency migration only. Encoder, decoder, derive behavior, wire format, and resource limits remain those of upstream 2.0.1. Decoder hardening discussed in #938 remains separate.

What was done?

  • Import the runtime, derive macros, original tests, benchmarks, specification, documentation, and MIT licenses from the published 2.0.1 crate archives. All 67 imported upstream files are byte-identical to their archive counterparts; source revision and archive SHA-256 values are recorded in package metadata and GROVEDB.md.
  • Add the two workspace packages at version 2.0.1. Preserve the bincode and bincode_derive library names and workspace dependency aliases, so existing GroveDB imports and derive paths continue to work.
  • Preserve upstream feature definitions and helper dependencies (unty and virtue). Upstream bincode 2.0.1 is used only as a development dependency for a new compatibility test; upstream 1.3 remains in the imported upstream test dependencies.
  • Compare original and imported implementations for byte equality and cross-decoding, including derived enums, integer boundaries, collections, streaming readers, borrowed values, both byte orders, and both integer encodings.
  • Use package-local allowances for existing upstream compiler warnings and narrow pre-commit exclusions for original comments/whitespace/documentation line endings. These keep the imported sources unchanged.
  • Exclude both imported packages from the regular workspace test, lint, all-target check, and formatting targets, and from coverage generation and Codecov. A separate Bincode job runs their upstream/compatibility tests, lint, formatting, and no-std feature checks only when files in either imported crate directory change. GroveDB integration tests still compile and exercise the fork as a dependency.

How Has This Been Tested?

Passed locally:

  • cargo test --workspace --all-features — 5,858 passed, 14 ignored, no failures, including doctests.
  • cargo test -p grovedb-bincode -p grovedb-bincode-derive --all-features
  • cargo clippy --workspace --all-features -- -D warnings
  • cargo clippy -p grovedb-bincode -p grovedb-bincode-derive --all-features --all-targets -- -D warnings
  • cargo check --workspace --all-features --all-targets
  • cargo build --no-default-features --features verify -p grovedb
  • Fork checks with no default features, alloc,derive, and alloc,serde.
  • cargo fmt --all --check and pre-commit hooks.
  • The revised CI workflow passes actionlint. Its regular workspace formatting, lint, and all-target build commands pass with the imported packages excluded. Nextest lists 5,755 tests in 31 suites with no imported bincode suites; every command in the separate Bincode job passes locally.
  • Both packages produced crate archives; the extracted runtime compiled against the extracted derive package through a temporary path patch. Cargo 1.97.1's combined unpublished-package verification hit its internal “no hash listed” error, so the extracted packages were verified directly.
  • SHA-256 verification of both original archives and byte comparison of all 67 imported files after formatting/hooks.

An additional cargo clippy --workspace --all-features --all-targets -- -D warnings run reports an existing clone_on_copy in unchanged grovedb-commitment-tree/src/client/sqlite_client_tests.rs:544. The standard CI lint command above passes. No unrelated test cleanup is included.

Breaking Changes

The Cargo package identities change, so the fork's Encode/Decode traits are distinct from upstream bincode's traits. Downstream applications using these traits with GroveDB types must use the fork, typically through bincode = { package = "grovedb-bincode", version = "=2.0.1" }. Encoded database and proof bytes are unchanged.

The derive package must be published before the runtime package, and both must be published before dependent GroveDB releases. This PR does not publish crates.

Checklist

  • I have performed a self-review of my own code
  • I have documented the upstream provenance and integration choices
  • I have added compatibility coverage and retained the upstream tests
  • I have documented the downstream migration

Summary by CodeRabbit

  • New Features

    • Added a bundled bincode 2.0.1 serialization library with encoding and decoding APIs.
    • Added configurable endianness, integer encoding, and decode-size limits.
    • Added support for standard Rust types, collections, atomic types, borrowed data, and reader/writer streams.
    • Added optional no_std, allocation, standard library, derive, and Serde integrations.
    • Added derive macros for Encode, Decode, and BorrowDecode, including generic and enum support.
  • Documentation

    • Added migration guidance, binary format specifications, usage documentation, licensing, and provenance details.
  • Tests

    • Added broad compatibility, round-trip, feature, regression, and upstream wire-format validation coverage.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 0e3ede5b-cfee-46bc-a231-d7ed48f06145

📥 Commits

Reviewing files that changed from the base of the PR and between 3df18d7 and 9b0f154.

📒 Files selected for processing (77)
  • .codecov.yml
  • .github/workflows/grovedb.yml
  • .pre-commit-config.yaml
  • Cargo.toml
  • grovedb-bincode-derive/.rustfmt.toml
  • grovedb-bincode-derive/Cargo.toml
  • grovedb-bincode-derive/GROVEDB.md
  • grovedb-bincode-derive/LICENSE.md
  • grovedb-bincode-derive/readme.md
  • grovedb-bincode-derive/src/attribute.rs
  • grovedb-bincode-derive/src/derive_enum.rs
  • grovedb-bincode-derive/src/derive_struct.rs
  • grovedb-bincode-derive/src/lib.rs
  • grovedb-bincode/.rustfmt.toml
  • grovedb-bincode/Cargo.toml
  • grovedb-bincode/GROVEDB.md
  • grovedb-bincode/LICENSE.md
  • grovedb-bincode/benches/inline.rs
  • grovedb-bincode/benches/string.rs
  • grovedb-bincode/benches/varint.rs
  • grovedb-bincode/docs/migration_guide.md
  • grovedb-bincode/docs/spec.md
  • grovedb-bincode/readme.md
  • grovedb-bincode/src/atomic.rs
  • grovedb-bincode/src/config.rs
  • grovedb-bincode/src/de/decoder.rs
  • grovedb-bincode/src/de/impl_core.rs
  • grovedb-bincode/src/de/impl_tuples.rs
  • grovedb-bincode/src/de/impls.rs
  • grovedb-bincode/src/de/mod.rs
  • grovedb-bincode/src/de/read.rs
  • grovedb-bincode/src/enc/encoder.rs
  • grovedb-bincode/src/enc/impl_tuples.rs
  • grovedb-bincode/src/enc/impls.rs
  • grovedb-bincode/src/enc/mod.rs
  • grovedb-bincode/src/enc/write.rs
  • grovedb-bincode/src/error.rs
  • grovedb-bincode/src/features/derive.rs
  • grovedb-bincode/src/features/impl_alloc.rs
  • grovedb-bincode/src/features/impl_std.rs
  • grovedb-bincode/src/features/mod.rs
  • grovedb-bincode/src/features/serde/de_borrowed.rs
  • grovedb-bincode/src/features/serde/de_owned.rs
  • grovedb-bincode/src/features/serde/mod.rs
  • grovedb-bincode/src/features/serde/ser.rs
  • grovedb-bincode/src/lib.rs
  • grovedb-bincode/src/utils.rs
  • grovedb-bincode/src/varint/decode_signed.rs
  • grovedb-bincode/src/varint/decode_unsigned.rs
  • grovedb-bincode/src/varint/encode_signed.rs
  • grovedb-bincode/src/varint/encode_unsigned.rs
  • grovedb-bincode/src/varint/mod.rs
  • grovedb-bincode/tests/alloc.rs
  • grovedb-bincode/tests/atomic.rs
  • grovedb-bincode/tests/basic_types.rs
  • grovedb-bincode/tests/context.rs
  • grovedb-bincode/tests/derive.rs
  • grovedb-bincode/tests/derive_rename.rs
  • grovedb-bincode/tests/error_size.rs
  • grovedb-bincode/tests/issues.rs
  • grovedb-bincode/tests/issues/issue_427.rs
  • grovedb-bincode/tests/issues/issue_431.rs
  • grovedb-bincode/tests/issues/issue_459.rs
  • grovedb-bincode/tests/issues/issue_467.rs
  • grovedb-bincode/tests/issues/issue_474.rs
  • grovedb-bincode/tests/issues/issue_498.rs
  • grovedb-bincode/tests/issues/issue_500.rs
  • grovedb-bincode/tests/issues/issue_523.rs
  • grovedb-bincode/tests/issues/issue_537.rs
  • grovedb-bincode/tests/issues/issue_547.rs
  • grovedb-bincode/tests/issues/issue_570.rs
  • grovedb-bincode/tests/issues/issue_592.rs
  • grovedb-bincode/tests/issues/issue_614.rs
  • grovedb-bincode/tests/serde.rs
  • grovedb-bincode/tests/std.rs
  • grovedb-bincode/tests/upstream_compatibility.rs
  • grovedb-bincode/tests/utils.rs

📝 Walkthrough

Walkthrough

Adds vendored bincode 2.0.1 runtime and derive crates. The change includes configurable encoding and decoding, feature-gated integrations, compatibility tests, benchmarks, documentation, and dedicated CI checks.

Changes

Vendored bincode integration

Layer / File(s) Summary
Workspace and CI integration
.codecov.yml, .github/workflows/grovedb.yml, .pre-commit-config.yaml, Cargo.toml, grovedb-bincode*/Cargo.toml, grovedb-bincode*/.rustfmt.toml
Adds both crates to the workspace, redirects bincode dependencies to local version 2.0.1 packages, preserves upstream formatting and content, excludes the crates from general jobs, and adds dedicated tests, lint, formatting, and no-std checks.
Core codec and configuration
grovedb-bincode/src/{lib.rs,config.rs,error.rs,enc/*,de/*,varint/*,atomic.rs,utils.rs}
Adds the configurable encoder and decoder, reader and writer abstractions, primitive and collection-independent implementations, varint support, byte-limit accounting, atomic support, and codec errors.
Derive macro generation
grovedb-bincode-derive/src/*
Adds Encode, Decode, and BorrowDecode procedural macros with attribute parsing, generic bounds, decode contexts, borrowed fields, enum handling, and serde compatibility wrappers.
Feature integrations
grovedb-bincode/src/features/*
Adds allocation-backed collections, standard-library I/O and type implementations, optional derive exports, and serde encoding and decoding adapters.
Compatibility validation and documentation
grovedb-bincode/tests/*, grovedb-bincode/benches/*, grovedb-bincode/docs/*, grovedb-bincode/readme.md, grovedb-bincode/GROVEDB.md
Adds tests for core types, features, derive behavior, contexts, serde, standard-library types, issue regressions, and upstream wire compatibility, plus benchmarks and format and migration documentation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant grovedb_bincode
  participant EncoderDecoder
  participant ReaderWriter
  Caller->>grovedb_bincode: encode or decode value with Configuration
  grovedb_bincode->>EncoderDecoder: construct EncoderImpl or DecoderImpl
  EncoderDecoder->>ReaderWriter: write or read encoded bytes
  ReaderWriter-->>EncoderDecoder: bytes and errors
  EncoderDecoder-->>Caller: encoded output or decoded value
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/vendor-bincode-2-0-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.90%. Comparing base (3df18d7) to head (9b0f154).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #940   +/-   ##
========================================
  Coverage    92.90%   92.90%           
========================================
  Files          325      325           
  Lines       102938   102938           
========================================
  Hits         95633    95633           
  Misses        7305     7305           
Components Coverage Δ
grovedb-core 91.32% <ø> (ø)
merk 93.92% <ø> (ø)
storage 91.86% <ø> (ø)
commitment-tree 95.62% <ø> (ø)
mmr 95.11% <ø> (ø)
bulk-append-tree 92.78% <ø> (ø)
element 96.93% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@QuantumExplorer
QuantumExplorer merged commit ca3db70 into develop Sep 8, 2026
8 of 9 checks passed
@QuantumExplorer
QuantumExplorer deleted the codex/vendor-bincode-2-0-1 branch September 8, 2026 00:13
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.

1 participant