Skip to content

Commit 4bf2110

Browse files
authored
Merge pull request #167 from anoma/xuyang/refactor_arm
refactor arm
2 parents 2cfc587 + dc382b7 commit 4bf2110

File tree

24 files changed

+297
-1847
lines changed

24 files changed

+297
-1847
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
.
120120
121121
- name: Run tests (main workspace)
122-
run: cargo test --workspace --features test
122+
run: cargo test --workspace
123123

124124
test-release:
125125
name: Test Release
@@ -138,5 +138,5 @@ jobs:
138138
.
139139
140140
- name: Run release tests (main workspace)
141-
run: cargo test --workspace --release --features test
141+
run: cargo test --workspace --release
142142
timeout-minutes: 60

Cargo.lock

Lines changed: 58 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
resolver = "2"
33
members = [
44
"arm",
5+
"arm_tests/arm_test_witness",
6+
"arm_tests/arm_test_app",
7+
"arm_gadgets"
58
]
69

710
[profile.bench]

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ This is a shielded resource machine implementation based on [Risc0-zkvm](https:/
1717
- **trivial_logic**: Minimal logic circuit example, also used in padding resources
1818
- **proof aggregation (batch_aggregation, sequential_aggregation)**: Circuits for single-run aggregation and IVC-based aggregation, respectively
1919

20+
- **`arm_gadgets/`**: It provides a range of commonly used components for resource logic circuits, such as verifiable encryption and ECDSA signature authentication.
21+
22+
- **`arm_tests/`**: It encompasses a basic resource logic instantiation and transaction tests.
23+
2024
## ARM-RISC0 Application Examples
2125

2226
Several application examples are available at [here](https://github.com/anoma/arm-risc0-examples), including the simple counter application, token transfer application, and the kudo application.
@@ -32,7 +36,7 @@ Note: The installation of the Risc0 toolchain is required only if you intend to
3236

3337
### Build and Test
3438

35-
* Compile `arm` lib
39+
* Compile `arm` libs
3640

3741
```bash
3842
cargo build
@@ -78,8 +82,6 @@ We have the following feature flags in arm lib:
7882
| `composite_prover` | | Fastest option producing linear-size proofs, and supports compression via recursion |
7983
| `groth16_prover` | | Generates groth16 proofs(requires x86_64 machines) |
8084
| `nif` | | Enables Erlang/Elixir NIF (Native Implemented Function) bindings |
81-
| `test_circuit` | | A simple circuit implementation for testing |
82-
| `test` | | Includes tx and action tests; some test APIs are available outside the arm lib(Binding lib and Elixir SDK). |
8385
| `aggregation_circuit` | | A specific feature for (pcd-based) aggregation circuits |
8486
| `aggregation` | `aggregation_circuit`, `transaction` | Enables proof aggregation (with constant-sized proofs by default) |
8587
|`fast_aggregation` | `aggregation` | Faster aggregation with linear-sized proofs without compression
@@ -165,7 +167,7 @@ The _sequential_ strategy aggregates sequentially, in an IVC style.
165167
use arm::aggregation::AggregationStrategy;
166168

167169
assert!(tx.aggregate_with_strategy(AggregationStrategy::Sequential).is_ok());
168-
```
170+
```
169171

170172
**Warning:** Once again, aggregation erases all the individual proofs from `tx` and replaces them with the (single) aggregation proof in a dedicated field. This is why the transaction must be `mut`. This is true independently of the strategy used.
171173

arm/Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ serde_with = "3.14.1"
1313
k256 = { version = "=0.13.3", features = ["arithmetic", "serde", "expose-field", "std", "ecdsa", "hash2curve"], default-features = false }
1414
sha3 = { version = "0.10", optional = true }
1515
rand = "0.8"
16-
aes-gcm = "0.10"
1716
bincode = "1.3.3"
1817
hex = "0.4"
1918
lazy_static = "1.5.0"
2019
rustler = { version = "0.36.2", optional = true }
2120
bytemuck = { version = "1.12", features = ["derive"] }
22-
alloy-primitives = "1.0.23"
23-
alloy-sol-types = "1.0.23"
2421
thiserror = "2.0.6"
25-
zeroize = { version = "1.8.2" }
22+
2623
# To fix the dependency warnings
2724
tracing-subscriber = "0.3.20"
2825
slab = "0.4.11"
@@ -38,8 +35,6 @@ nif = ["dep:rustler"]
3835
prove = ["risc0-zkvm/prove"]
3936
bonsai = ["risc0-zkvm/bonsai"]
4037
cuda = ["risc0-zkvm/cuda"]
41-
test_circuit = []
42-
test = ["transaction", "test_circuit"]
4338
aggregation = ["aggregation_circuit","transaction"]
4439
aggregation_circuit = []
4540
fast_aggregation = ["aggregation"]

arm/src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pub mod action;
33
pub mod action_tree;
44
#[cfg(feature = "aggregation")]
55
pub mod aggregation;
6-
pub mod authorization;
76
#[cfg(any(feature = "compliance_circuit", feature = "aggregation_circuit"))]
87
pub mod compliance;
98
#[cfg(feature = "transaction")]
@@ -12,9 +11,7 @@ pub mod compliance_unit;
1211
pub mod constants;
1312
#[cfg(feature = "transaction")]
1413
pub mod delta_proof;
15-
pub mod encryption;
1614
pub mod error;
17-
pub mod evm;
1815
#[cfg(feature = "aggregation_circuit")]
1916
pub mod hash;
2017
pub mod logic_instance;
@@ -27,10 +24,6 @@ pub mod proving_system;
2724
pub mod resource;
2825
pub mod resource_logic;
2926
mod rustler_util;
30-
#[cfg(feature = "test_circuit")]
31-
pub mod test_logic;
32-
#[cfg(feature = "test")]
33-
pub mod tests;
3427
#[cfg(feature = "transaction")]
3528
pub mod transaction;
3629
pub mod utils;

arm_circuits/Cargo.lock

Lines changed: 26 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)