Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Merk hash prefix additions #14

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
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
210 changes: 116 additions & 94 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,151 +2,173 @@ name: CI

on:
push:
branches: [ master, develop ]
branches: [master, develop]
pull_request:
branches: [ master, develop ]
branches: [master, develop]

env:
CARGO_TERM_COLOR: always

jobs:
build-base:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose

build-all-features:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --all-features

test-base:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-18
override: true
- name: Test
uses: actions-rs/cargo@v1
with:
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry/src/**/librocksdb-sys-*
target/
key: ${{ runner.os }}-test-base-${{ hashFiles('Cargo.toml') }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose

test-all-features:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-18
override: true
- name: Test
uses: actions-rs/cargo@v1
with:
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry/src/**/librocksdb-sys-*
target/
key: ${{ runner.os }}-test-all-features-${{ hashFiles('Cargo.toml') }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all-features

coverage:
runs-on: ubuntu-latest
steps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: llvm-tools-preview
override: true
toolchain: nightly-2022-11-18
components: llvm-tools-preview
override: true
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry/src/**/librocksdb-sys-*
target/
key: ${{ runner.os }}-coverage-${{ hashFiles('Cargo.toml') }}
- name: Install Coverage Tooling
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-llvm-cov
command: install
args: cargo-llvm-cov --force
- name: Run Coverage
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: --all-features --workspace --lcov --output-path lcov.info
command: llvm-cov
args: --all-features --workspace --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
with:
files: lcov.info
fail_ci_if_error: true
files: lcov.info
fail_ci_if_error: true

format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-18
components: rustfmt
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
- name: Check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-18
components: clippy
override: true
- name: Check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry/src/**/librocksdb-sys-*
target/
key: ${{ runner.os }}-clippy-${{ hashFiles('Cargo.toml') }}
- name: Check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings

benches:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Checkout
uses: actions/checkout@v2
- name: Use Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-18
override: true
- name: Run Benches
uses: actions-rs/cargo@v1
with:
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry/src/**/librocksdb-sys-*
target/
key: ${{ runner.os }}-benches-${{ hashFiles('Cargo.toml') }}
- name: Run Benches
uses: actions-rs/cargo@v1
with:
command: bench

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "merk"
description = "Merkle key/value store"
version = "2.0.0"
version = "2.0.0-oo"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does oo comes from?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansl In order to carry two versions of merk in the many-rs PR, the versions must be different. Arguably, this means we should be bumping the version number on each PR merge, but we haven't previously performed this convention.

authors = ["Matt Bell <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
3 changes: 1 addition & 2 deletions src/merk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,7 @@ mod test {
assert_eq!(
merk.root_hash(),
[
99, 81, 104, 29, 169, 195, 53, 48, 134, 74, 250, 47, 77, 121, 157, 227, 139, 241,
250, 216, 78, 87, 152, 116, 252, 116, 132, 16, 150, 163, 107, 30
199, 209, 38, 83, 235, 80, 97, 114, 90, 34, 70, 170, 30, 138, 137, 164, 116, 18, 162, 230, 217, 86, 223, 36, 211, 204, 248, 242, 9, 27, 130, 93
]
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/proofs/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ mod tests {
let chunk = verify_leaf(
ops,
[
34, 133, 104, 181, 253, 249, 189, 168, 15, 209, 70, 164, 224, 192, 18, 36, 1, 74,
79, 9, 158, 188, 98, 47, 53, 32, 109, 14, 151, 13, 49, 74,
66, 41, 175, 143, 229, 65, 233, 73, 123, 110, 101, 193, 16, 16, 194, 20, 74, 123, 112, 8, 48, 172, 218, 249, 237, 253, 113, 179, 128, 121, 91, 133
],
)
.unwrap();
Expand All @@ -460,8 +459,7 @@ mod tests {
let chunk = verify_leaf(
ops,
[
164, 29, 123, 213, 6, 25, 247, 238, 127, 53, 5, 70, 255, 87, 87, 204, 188, 169,
181, 4, 185, 180, 74, 52, 244, 134, 75, 47, 105, 129, 209, 112,
250, 223, 105, 57, 91, 175, 68, 231, 72, 208, 10, 208, 211, 228, 116, 255, 143, 186, 3, 94, 189, 12, 187, 35, 87, 182, 169, 87, 250, 66, 48, 247
],
)
.unwrap();
Expand Down
Loading