Skip to content
Closed
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
40 changes: 40 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
slack: circleci/slack@4.1

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
cargo-test:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: cimg/rust:1.59.0
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
- checkout
- run:
name: "cargo test"
command: |
sudo apt update && sudo apt-get install libfontconfig libfontconfig1-dev libfreetype6-dev;
cargo version;
cargo test --all --all-features;
- slack/notify:
event: fail
template: basic_fail_1
- slack/notify:
event: pass
template: basic_success_1


# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
build-and-test:
jobs:
- cargo-test:
context: CI-Orchard-slack
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
**/*.rs.bk
Cargo.lock
.vscode
.idea
action-circuit-layout.png
proptest-regressions/*.txt
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ blake2b_simd = "1"
ff = "0.12"
fpe = "0.5"
group = "0.12"
halo2_gadgets = "0.2"
halo2_proofs = "0.2"
halo2_gadgets = { version = "0.2", git = "https://github.com/QED-it/halo2", branch = "sinsemilla-hash-blind" }
halo2_proofs = { version = "0.2", git = "https://github.com/QED-it/halo2", branch = "sinsemilla-hash-blind" }
#halo2_gadgets = { version = "0.2", path = "../halo2/halo2_gadgets" }
#halo2_proofs = { version = "0.2", path = "../halo2/halo2_proofs" }
hex = "0.4"
lazy_static = "1"
memuse = { version = "0.2", features = ["nonempty"] }
Expand All @@ -52,7 +54,8 @@ plotters = { version = "0.3.0", optional = true }

[dev-dependencies]
criterion = "0.3"
halo2_gadgets = { version = "0.2", features = ["test-dependencies"] }
halo2_gadgets = { version = "0.2", git = "https://github.com/QED-it/halo2", branch = "sinsemilla-hash-blind", features = ["test-dependencies"] }
#halo2_gadgets = { version = "0.2", path = "../halo2/halo2_gadgets", features = ["test-dependencies"] }
hex = "0.4"
proptest = "1.0.0"
zcash_note_encryption = { version = "0.1", features = ["pre-zip-212"] }
Expand Down
9 changes: 8 additions & 1 deletion benches/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use criterion::{BenchmarkId, Criterion};
#[cfg(unix)]
use pprof::criterion::{Output, PProfProfiler};

use orchard::note::NoteType;
use orchard::{
builder::Builder,
bundle::Flags,
Expand All @@ -32,7 +33,13 @@ fn criterion_benchmark(c: &mut Criterion) {
);
for _ in 0..num_recipients {
builder
.add_recipient(None, recipient, NoteValue::from_raw(10), None)
.add_recipient(
None,
recipient,
NoteValue::from_raw(10),
NoteType::native(),
None,
)
.unwrap();
}
let bundle: Bundle<_, i64> = builder.build(rng).unwrap();
Expand Down
17 changes: 15 additions & 2 deletions benches/note_decryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use orchard::{
bundle::Flags,
circuit::ProvingKey,
keys::{FullViewingKey, Scope, SpendingKey},
note::NoteType,
note_encryption::{CompactAction, OrchardDomain},
value::NoteValue,
Anchor, Bundle,
Expand Down Expand Up @@ -51,10 +52,22 @@ fn bench_note_decryption(c: &mut Criterion) {
// The builder pads to two actions, and shuffles their order. Add two recipients
// so the first action is always decryptable.
builder
.add_recipient(None, recipient, NoteValue::from_raw(10), None)
.add_recipient(
None,
recipient,
NoteValue::from_raw(10),
NoteType::native(),
None,
)
.unwrap();
builder
.add_recipient(None, recipient, NoteValue::from_raw(10), None)
.add_recipient(
None,
recipient,
NoteValue::from_raw(10),
NoteType::native(),
None,
)
.unwrap();
let bundle: Bundle<_, i64> = builder.build(rng).unwrap();
bundle
Expand Down
9 changes: 7 additions & 2 deletions src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ pub(crate) mod testing {

use proptest::prelude::*;

use crate::note::note_type::testing::arb_note_type;
use crate::{
note::{
commitment::ExtractedNoteCommitment, nullifier::testing::arb_nullifier,
Expand All @@ -146,11 +147,13 @@ pub(crate) mod testing {
nf in arb_nullifier(),
rk in arb_spendauth_verification_key(),
note in arb_note(output_value),
note_type in arb_note_type()
) -> Action<()> {
let cmx = ExtractedNoteCommitment::from(note.commitment());
let cv_net = ValueCommitment::derive(
spend_value - output_value,
ValueCommitTrapdoor::zero()
ValueCommitTrapdoor::zero(),
note_type
);
// FIXME: make a real one from the note.
let encrypted_note = TransmittedNoteCiphertext {
Expand All @@ -177,11 +180,13 @@ pub(crate) mod testing {
note in arb_note(output_value),
rng_seed in prop::array::uniform32(prop::num::u8::ANY),
fake_sighash in prop::array::uniform32(prop::num::u8::ANY),
note_type in arb_note_type()
) -> Action<redpallas::Signature<SpendAuth>> {
let cmx = ExtractedNoteCommitment::from(note.commitment());
let cv_net = ValueCommitment::derive(
spend_value - output_value,
ValueCommitTrapdoor::zero()
ValueCommitTrapdoor::zero(),
note_type
);

// FIXME: make a real one from the note.
Expand Down
Loading