Skip to content
Open
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
5 changes: 5 additions & 0 deletions rust/grovedb/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.aarch64-unknown-linux-musl]
rustflags = [ "-C", "target-feature=-crt-static" ]

[target.x86_64-unknown-linux-musl]
rustflags = [ "-C", "target-feature=-crt-static" ]
38 changes: 38 additions & 0 deletions rust/grovedb/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

<!--- Provide a general summary of the issue in the Title above -->

## Expected Behavior
<!--- Tell us what should happen -->

## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Environment name and version (e.g. Chrome 39, node.js 5.4):
* Operating System and version (desktop, server, or mobile):
* Link to your project:
25 changes: 25 additions & 0 deletions rust/grovedb/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''

---

<!--- Provide a general summary of the feature request in the Title above -->

## Expected Behavior
<!--- A clear and concise description of what you want to happen -->

## Current Behavior
<!--- Explain the difference from current behavior -->

## Possible Solution
<!--- Suggest ideas of how to implement the addition or change -->

## Alternatives Considered
<!--- A clear and concise description of any alternative solutions or features you've considered -->

## Additional Context
<!--- Add any other context or screenshots about the feature request here. -->
32 changes: 32 additions & 0 deletions rust/grovedb/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--- Provide a general summary of your changes in the Title above -->
<!--- Pull request titles must use the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format -->

## Issue being fixed or feature implemented
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


## What was done?
<!--- Describe your changes in detail -->


## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## Breaking Changes
<!--- Please describe any breaking changes your code introduces and verify that -->
<!--- the title includes "!" following the conventional commit type (e.g. "feat!: ..."-->


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [ ] I have assigned this pull request to a milestone
22 changes: 22 additions & 0 deletions rust/grovedb/.github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
workflow_dispatch:
pull_request:
branches:
- master
- develop
- v[0-9]+\.[0-9]+-dev

name: Coverage

jobs:
build:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Coverage
run: |
cargo test &&
curl -Os https://uploader.codecov.io/latest/linux/codecov &&
chmod +x codecov &&
./codecov
142 changes: 142 additions & 0 deletions rust/grovedb/.github/workflows/grovedb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
on:
workflow_dispatch:
pull_request:
branches:
- master
- develop
- v[0-9]+\.[0-9]+-dev

name: GroveDB

jobs:
test:
name: Tests
runs-on: ubuntu-22.04
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown

- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "false"

- name: Setup Trunk
uses: jetli/trunk-action@v0.5.0

- run: cargo test --workspace --all-features


linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Check out repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
components: clippy
target: wasm32-unknown-unknown

- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "false"

- name: Setup Trunk
uses: jetli/trunk-action@v0.5.0

- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

formatting:
name: Formatting
runs-on: ubuntu-22.04
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
components: rustfmt

- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "false"

- run: exit `cargo +nightly fmt --check | wc -l`

errors:
name: Compilation errors
runs-on: ubuntu-22.04
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true

- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "false"

- run: cargo check

- name: Compile proof verification feature
run: cargo build --no-default-features --features verify -p grovedb

security:
name: Dependencies security audit
runs-on: ubuntu-22.04
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2

- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions rust/grovedb/.github/workflows/release-crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release Crates

on:
workflow_dispatch:
release:
types:
- published

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Login to crates.io
run: cargo login ${{ secrets.CARGO_GROVE_TOKEN }}

- name: Publish crates
run: |
# Publish all workspace crates
cargo publish -p grovedb-version
cargo publish -p grovedb-costs
cargo publish -p grovedb-visualize
cargo publish -p grovedb-path
cargo publish -p grovedb-storage
cargo publish -p grovedb-epoch-based-storage-flags
cargo publish -p grovedbg-types
cargo publish -p grovedb-merk
cargo publish -p grovedb
9 changes: 9 additions & 0 deletions rust/grovedb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/target
.idea
Cargo.lock
prebuilds
node_modules
.DS_Store
.DS_Store?
tutorials/target
tutorial-storage
17 changes: 17 additions & 0 deletions rust/grovedb/.rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
unstable_features = true

blank_lines_lower_bound = 0
condense_wildcard_suffixes = true
error_on_line_overflow = true
error_on_unformatted = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_strings = true
imports_granularity = "Crate"
normalize_comments = true
normalize_doc_attributes = true
reorder_impl_items = true
group_imports = "StdExternalCrate"
use_field_init_shorthand = true
use_try_shorthand = true
wrap_comments = true
29 changes: 29 additions & 0 deletions rust/grovedb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

All notable changes to GroveDB will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- **BREAKING**: Added `add_parent_tree_on_subquery` feature to PathQuery (#379)
- New field in `Query` struct: `add_parent_tree_on_subquery: bool`
- When set to `true`, parent tree elements (like CountTree or SumTree) are included in query results when performing subqueries
- Particularly useful for aggregate trees where you need both the aggregate value and individual elements
- Requires GroveVersion v2 or higher
- Updated proof verification logic to handle parent tree inclusion

### Changed
- Updated delete function to include grove_version parameter (#377)
- Adjusted batch size type for better performance (#377)
- Renamed `prove_internal` to `prove_query_non_serialized` for clarity (#373)

### Fixed
- Corrected proof verification logic in GroveDb (#371)
- Added ASCII check before appending string to hex display for better visualization (#376)

## Version History

For previous versions, see commit history.
Loading
Loading