Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,29 @@ jobs:
cd ledger
cargo test --release -- -Z unstable-options --report-time

vrf-tests:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup build dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Setup Rust
run: |
# Nightly to be able to use `--report-time` below
rustup install nightly
rustup override set nightly
- name: Build vrf tests
run: |
cd vrf
cargo build --release --tests
- name: Run vrf tests
run: |
cd vrf
cargo test --release -- -Z unstable-options --report-time

tx-fuzzer-check:
runs-on: ubuntu-20.04
steps:
Expand Down
12 changes: 4 additions & 8 deletions vrf/src/message.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ff::{One, SquareRootField, Zero};

use ledger::ToInputs;
use ledger::{proofs::transaction::legacy_input::to_bits, ToInputs};
use mina_curves::pasta::curves::pallas::Pallas as CurvePoint;
use mina_p2p_messages::v2::EpochSeed;
use o1_utils::FieldHelpers;
Expand Down Expand Up @@ -98,13 +98,9 @@ impl ToInputs for VrfMessage {
}
};
inputs.append_field(epoch_seed);
for i in (0..LEDGER_DEPTH).rev() {
if self.delegator_index >> i & 1u64 == 1 {
inputs.append_bool(true);
} else {
inputs.append_bool(false);
}
}
inputs.append_u32(self.global_slot);
for bit in to_bits::<_, LEDGER_DEPTH>(self.delegator_index) {
inputs.append_bool(bit);
}
}
}
2 changes: 1 addition & 1 deletion vrf/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ mod test {
let converted = ConsensusVrfOutputTruncatedStableV1::from(vrf_output);
let converted_string = serde_json::to_string_pretty(&converted).unwrap();
let converted_string_deser: String = serde_json::from_str(&converted_string).unwrap();
let expected = String::from("48H9Qk4D6RzS9kAJQX9HCDjiJ5qLiopxgxaS6xbDCWNaKQMQ9Y4C");
let expected = String::from("39cyg4ZmMtnb_aFUIerNAoAJV8qtkfOpq0zFzPspjgM=");

assert_eq!(expected, converted_string_deser);
}
Expand Down
Loading