Skip to content

Commit

Permalink
v0.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth authored May 16, 2024
2 parents 4bf6ad3 + 93967f8 commit f0a0508
Show file tree
Hide file tree
Showing 63 changed files with 6,422 additions and 2,812 deletions.
10 changes: 10 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[profile.default]
retries = 0
slow-timeout = { period = "5m"}

[profile.ci-default]
retries = { backoff = "exponential", count = 2, delay = "1s", jitter = true, max-delay = "10s"}
status-level = "skip"
failure-output = "immediate-final"
fail-fast = false
slow-timeout = { period = "3m", terminate-after = 4}
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
toolchain: ${{matrix.toolchain}}
- name: Install cargo make
run: cargo install cargo-make
- uses: taiki-e/install-action@nextest
- name: cargo make - test
run: cargo make test
run: cargo make ci-test

clippy:
name: Clippy
Expand All @@ -38,8 +39,8 @@ jobs:
toolchain: stable
- name: Install cargo make
run: cargo install cargo-make
- name: cargo make - clippy
run: cargo make clippy
- name: cargo make - clippy-all
run: cargo make clippy-all

rustfmt:
name: rustfmt
Expand Down Expand Up @@ -67,9 +68,11 @@ jobs:
components: rustfmt
- name: Install cargo make
run: cargo install cargo-make
- uses: taiki-e/install-action@nextest
- run: cargo make reset
- run: cargo make node
- run: cargo make start-node > /dev/null &
- run: cargo make integration-test
- run: cargo make ci-integration-test
- name: Kill miden-node
if: always()
run: cargo make kill-node
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## v0.3.0 (2024-05-17)

* Added swap transactions and example flows on integration tests.
* Flatten the CLI subcommand tree.
* Added a mechanism to retrieve MMR data whenever a note created on a past block is imported.
* Changed the way notes are added to the database based on `ExecutedTransaction`.
* Added more feedback information to commands `info`, `notes list`, `notes show`, `account new`, `notes import`, `tx new` and `sync`.
* Add `consumer_account_id` to `InputNoteRecord` with an implementation for sqlite store.
* Renamed the CLI `input-notes` command to `notes`. Now we only export notes that were created on this client as the result of a transaction.
* Added validation using the `NoteScreener` to see if a block has relevant notes.
* Added flags to `init` command for non-interactive environments
* Added an option to verify note existence in the chain before importing.
* Add new store note filter to fetch multiple notes by their id in a single query.
* [BREAKING] `Client::new()` now does not need a `data_store_store` parameter, and `SqliteStore`'s implements interior mutability.
* [BREAKING] The store's `get_input_note` was replaced by `get_input_notes` and a `NoteFilter::Unique` was added.
* Refactored `get_account` to create the account from a single query.
* Added support for using an account as the default for the CLI
* Replace instead of ignore note scripts with when inserting input/output notes with a previously-existing note script root to support adding debug statements.
* Added RPC timeout configuration field
* Add off-chain account support for the tonic client method `get_account_update`.
* Refactored `get_account` to create the account from a single query.
* Admit partial account IDs for the commands that need them.
* Added nextest to be used as test runner.
* Added config file to run integration tests against a remote node.
* Added `CONTRIBUTING.MD` file.
* Renamed `format` command from `Makefile.toml` to `check-format` and added a new `format` command that applies the formatting.
* Added methods to get output notes from client.
* Added a `input-notes list-consumable` command to the CLI.

## 0.2.1 (2024-04-24)

* Added ability to start the client in debug mode (#283).
Expand Down
103 changes: 103 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Contributing to Miden Client

#### First off, thanks for taking the time to contribute!

We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a [bug](https://github.com/0xPolygonMiden/miden-client/issues/new)
- Taking part in [discussions](https://github.com/0xPolygonMiden/miden-client/discussions)
- Submitting a [fix](https://github.com/0xPolygonMiden/miden-client/pulls)
- Proposing new [features](https://github.com/0xPolygonMiden/miden-client/issues/new)

## Flow
We are using [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow), so all code changes happen through pull requests from a [forked repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo).

### Branching
- The current active branch is `next`. Every branch with a fix/feature must be forked from `next`.

- The branch name should contain a short issue/feature description separated with hyphens [(kebab-case)](https://en.wikipedia.org/wiki/Letter_case#Kebab_case).

For example, if the issue title is `Fix functionality X in component Y` then the branch name will be something like: `fix-x-in-y`.

- New branch should be rebased from `next` before submitting a PR in case there have been changes to avoid merge commits.
i.e. this branches state:
```
A---B---C fix-x-in-y
/
D---E---F---G next
| |
(F, G) changes happened after `fix-x-in-y` forked
```

should become this after rebase:


```
A'--B'--C' fix-x-in-y
/
D---E---F---G next
```


More about rebase [here](https://git-scm.com/docs/git-rebase) and [here](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase#:~:text=What%20is%20git%20rebase%3F,of%20a%20feature%20branching%20workflow.)


### Commit messages
- Commit messages should be written in a short, descriptive manner and be prefixed with tags for the change type and scope (if possible) according to the [semantic commit](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) scheme.
For example, a new change to the `miden-node-store` crate might have the following message: `feat(miden-node-store): fix block-headers database schema`

- Also squash commits to logically separated, distinguishable stages to keep git log clean:
```
7hgf8978g9... Added A to X \
\ (squash)
gh354354gh... oops, typo --- * ---------> 9fh1f51gh7... feat(X): add A && B
/
85493g2458... Added B to X /
789fdfffdf... Fixed D in Y \
\ (squash)
787g8fgf78... blah blah --- * ---------> 4070df6f00... fix(Y): fixed D && C
/
9080gf6567... Fixed C in Y /
```
### Code Style and Documentation
- For documentation in the codebase, we follow the [rustdoc](https://doc.rust-lang.org/rust-by-example/meta/doc.html) convention with no more than 100 characters per line.
- We also have technical and user documentation built with [mkdocs](https://github.com/mkdocs/mkdocs). You should update it whenever architectural changes or public interface (cli, client lib, etc.) changes are being made.
- For code sections, we use code separators like the following to a width of 100 characters::
```
// CODE SECTION HEADER
// ================================================================================
```
- [Rustfmt](https://github.com/rust-lang/rustfmt), [Clippy](https://github.com/rust-lang/rust-clippy) and [Rustdoc](https://doc.rust-lang.org/rustdoc/index.html) linting is included in CI pipeline. Anyways it's preferable to run linting locally before push. To simplify running these commands in a reproducible manner we use [cargo-make](https://github.com/sagiegurari/cargo-make), you can run:
```
cargo make lint
```
You can find more information about the `cargo make` commands in the [Makefile](Makefile.toml)
### Versioning
We use [semver](https://semver.org/) naming convention.
## Pre-PR checklist
1. Repo forked and branch created from `next` according to the naming convention.
2. Commit messages and code style follow conventions.
3. Tests added for new functionality.
4. Documentation/comments updated for all changes according to our documentation convention.
5. Rustfmt, Clippy and Rustdoc linting passed.
## Write bug reports with detail, background, and sample code
**Great Bug Reports** tend to have:
- A quick summary and/or background
- Steps to reproduce
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[package]
name = "miden-client"
version = "0.2.1"
version = "0.3.0"
description = "Client library that facilitates interaction with the Miden rollup"
authors = ["miden contributors"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-client"
documentation = "https://docs.rs/miden-client/0.2.1"
documentation = "https://docs.rs/miden-client/0.3.0"
keywords = ["miden", "client"]
edition = "2021"
rust-version = "1.75"
default-run = "miden-client"
rust-version = "1.78"
default-run = "miden"

[[bin]]
name = "miden"
path = "src/main.rs"

[[test]]
name = "integration"
path = "tests/integration/main.rs"
required-features = ["integration"]

[features]
concurrent = [
"miden-lib/concurrent",
"miden-objects/concurrent",
"miden-tx/concurrent",
]
concurrent = ["miden-lib/concurrent", "miden-objects/concurrent", "miden-tx/concurrent"]
default = ["std"]
integration = ["testing", "concurrent", "uuid"]
std = ["miden-objects/std"]
Expand All @@ -35,12 +35,12 @@ clap = { version = "4.3", features = ["derive"] }
comfy-table = "7.1.0"
figment = { version = "0.10", features = ["toml", "env"] }
lazy_static = "1.4.0"
miden-lib = { version = "0.2", default-features = false }
miden-node-proto = { version = "0.2", default-features = false }
miden-tx = { version = "0.2", default-features = false }
miden-objects = { version = "0.2", features = ["serde"] }
miden-lib = { version = "0.3", default-features = false }
miden-node-proto = { version = "0.3", default-features = false }
miden-tx = { version = "0.3", default-features = false }
miden-objects = { version = "0.3", default-features = false, features = ["serde"] }
rand = { version = "0.8.5" }
rusqlite = { version = "0.30.0", features = ["bundled"] }
rusqlite = { version = "0.30.0", features = ["vtab", "array", "bundled"] }
rusqlite_migration = { version = "1.0" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
Expand Down
45 changes: 35 additions & 10 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ NODE_FEATURES_TESTING="testing"
[tasks.format]
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all"]

[tasks.check-format]
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all", "--", "--check"]

[tasks.clippy-all]
dependencies = [
"clippy",
"clippy-integration-tests"
]

[tasks.clippy]
command = "cargo"
args = ["clippy","--workspace", "--all-targets", "--", "-D", "clippy::all", "-D", "warnings"]

[tasks.clippy-integration-tests]
command = "cargo"
args = ["clippy","--workspace", "--tests", "--features", "integration", "--", "-D", "clippy::all", "-D", "warnings"]

[tasks.docs]
env = { "RUSTDOCFLAGS" = "-D warnings" }
command = "cargo"
Expand All @@ -21,17 +36,28 @@ args = ["doc", "--all-features", "--keep-going", "--release"]
[tasks.test]
description = "Run the client testing suite"
command = "cargo"
args = ["test", "--release", "--workspace", "--", "--nocapture"]
args = ["nextest", "run", "--release", "--workspace"]

[tasks.integration-test]
description = "Run the integration test binary. Requires a node to connect to."
command = "cargo"
args = ["test", "--release", "--test=integration", "--features", "${FEATURES_INTEGRATION_TESTING}"]
args = ["nextest", "run", "--release", "--test=integration", "--features", "${FEATURES_INTEGRATION_TESTING}"]

# Same commands as above but using ci profile for nextest
[tasks.ci-test]
description = "Run the client testing suite"
command = "cargo"
args = ["nextest", "run", "--profile", "ci-default", "--release", "--workspace"]

[tasks.ci-integration-test]
description = "Run the integration test binary. Requires a node to connect to."
command = "cargo"
args = ["nextest", "run", "--profile", "ci-default", "--release", "--test=integration", "--features", "${FEATURES_INTEGRATION_TESTING}"]

[tasks.lint]
dependencies = [
"format",
"clippy",
"check-format",
"clippy-all",
"docs"
]

Expand All @@ -48,18 +74,17 @@ args = ["-rf", "miden-node"]
description = "Clone or update miden-node repository and clean up files"
script_runner = "bash"
script = [
'if [ -d miden-node ]; then cd miden-node && git checkout main; else git clone https://github.com/0xPolygonMiden/miden-node.git && cd miden-node && git checkout main; fi',
'if [ -d miden-node ]; then cd miden-node ; else git clone https://github.com/0xPolygonMiden/miden-node.git && cd miden-node; fi',
'git checkout main && git pull origin main && cargo update',
'rm -rf miden-store.sqlite3 miden-store.sqlite3-wal miden-store.sqlite3-shm',
'cd bin/node',
'cargo run --features $NODE_FEATURES_TESTING -- make-genesis --force'
'cargo run --bin miden-node --features $NODE_FEATURES_TESTING -- make-genesis --inputs-path ../tests/config/genesis.toml --force',
]

[tasks.start-node]
description = "Start the miden-node"
dependencies = ["node"]
script_runner = "bash"
cwd = "./miden-node/bin/node"
script = "cargo run --features ${NODE_FEATURES_TESTING} -- start node"
cwd = "./miden-node"
script = "cargo run --bin miden-node --features $NODE_FEATURES_TESTING -- start --config ../tests/config/miden-node.toml node"

[tasks.docs-deps]
description = "Install documentation dependencies"
Expand Down
Loading

0 comments on commit f0a0508

Please sign in to comment.