Skip to content

Commit 9e7331c

Browse files
committed
CI updates
1 parent 0b6a7fd commit 9e7331c

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

.github/actions/setup-build-deps/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ runs:
1414
run: |
1515
sudo apt update || true
1616
if [ "${{ inputs.include-sqlite }}" = "true" ]; then
17-
sudo apt install -y protobuf-compiler sqlite3 || true
17+
sudo apt install -y protobuf-compiler sqlite3 ocaml build-essential || true
1818
else
19-
sudo apt install -y protobuf-compiler || true
19+
sudo apt install -y protobuf-compiler ocaml build-essential || true
2020
fi
2121
2222
- name: Setup build dependencies (macOS)
2323
if: runner.os == 'macOS'
2424
shell: bash
2525
run: |
26-
brew install protobuf
26+
brew install protobuf ocaml opam

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Setup build dependencies
3636
run: |
3737
sudo apt update
38-
sudo apt install -y protobuf-compiler
38+
sudo apt install -y protobuf-compiler ocaml
3939
4040
- name: Install documentation dependencies
4141
run: make docs-install

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup build dependencies
1919
run: |
2020
sudo apt update || true
21-
sudo apt install -y protobuf-compiler sqlite3 || true
21+
sudo apt install -y protobuf-compiler sqlite3 ocaml || true
2222
- name: Setup SQLite database for SQLx
2323
run: |
2424
sqlite3 /tmp/heartbeats.db < tools/heartbeats-processor/schema.sql
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup build dependencies
4848
run: |
4949
sudo apt update || true
50-
sudo apt install -y protobuf-compiler || true
50+
sudo apt install -y protobuf-compiler ocaml || true
5151
- uses: dtolnay/rust-toolchain@stable
5252
with:
5353
toolchain: ${{ matrix.toolchain }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM rust:bullseye AS build
22
# hadolint ignore=DL3008
33
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends protobuf-compiler && \
4+
apt-get install -y --no-install-recommends protobuf-compiler ocaml && \
55
apt-get clean
66

77
WORKDIR /openmina

tools/fuzzing/src/transaction_fuzzer/generator.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use ark_ec::{AffineCurve, ProjectiveCurve};
1+
use ark_ec::{AffineRepr, CurveGroup};
22
use ark_ff::{Field, UniformRand};
33
use ledger::{
44
generators::zkapp_command_builder::get_transaction_commitments,
@@ -69,7 +69,11 @@ use mina_signer::{
6969
CompressedPubKey, CurvePoint, Keypair, NetworkId, ScalarField, SecKey, Signature, Signer,
7070
};
7171
use rand::{seq::SliceRandom, Rng};
72-
use std::{array, iter, ops::RangeInclusive, sync::Arc};
72+
use std::{
73+
array, iter,
74+
ops::{Mul, RangeInclusive},
75+
sync::Arc,
76+
};
7377
use tuple_map::TupleMap2;
7478

7579
use super::context::{FuzzerCtx, PermissionModel};
@@ -155,9 +159,7 @@ impl Generator<Keypair> for FuzzerCtx {
155159
fn gen(&mut self) -> Keypair {
156160
let sec_key: SecKey = self.gen();
157161
let scalar = sec_key.into_scalar();
158-
let public: CurvePoint = CurvePoint::prime_subgroup_generator()
159-
.mul(scalar)
160-
.into_affine();
162+
let public: CurvePoint = CurvePoint::generator().mul(scalar).into_affine();
161163

162164
let keypair = Keypair::from_parts_unsafe(scalar, public);
163165

@@ -223,10 +225,14 @@ impl<F: Field + From<i32>> Generator<CurvePointGenerator<F>> for FuzzerCtx {
223225
impl Generator<(Fp, Fp)> for FuzzerCtx {
224226
#[coverage(off)]
225227
fn gen(&mut self) -> (Fp, Fp) {
228+
use std::ops::Mul;
226229
if let Some((x, y)) = self.state.cache_curve_point_fp {
227-
let p = GroupAffine::<Fp>::new(x, y, false);
228-
let rand_scalar: u64 = self.gen.rng.gen();
229-
let new_p: GroupAffine<Fp> = p.mul(rand_scalar).into();
230+
let p = GroupAffine::<Fp>::new(x, y);
231+
let rand_scalar: u64 = self.r#gen.rng.gen();
232+
let scalar_field_elem =
233+
<Fp as ledger::proofs::field::FieldWitness>::Scalar::from(rand_scalar);
234+
235+
let new_p: GroupAffine<Fp> = p.mul(scalar_field_elem).into();
230236
(new_p.x, new_p.y)
231237
} else {
232238
let p: CurvePointGenerator<Fp> = self.gen();
@@ -240,9 +246,11 @@ impl Generator<(Fq, Fq)> for FuzzerCtx {
240246
#[coverage(off)]
241247
fn gen(&mut self) -> (Fq, Fq) {
242248
if let Some((x, y)) = self.state.cache_curve_point_fq {
243-
let p = GroupAffine::<Fq>::new(x, y, false);
249+
let p = GroupAffine::<Fq>::new(x, y);
244250
let rand_scalar: u64 = self.gen.rng.gen();
245-
let new_p: GroupAffine<Fq> = p.mul(rand_scalar).into();
251+
let scalar_field_elem =
252+
<Fq as ledger::proofs::field::FieldWitness>::Scalar::from(rand_scalar);
253+
let new_p: GroupAffine<Fq> = p.mul(scalar_field_elem).into();
246254
(new_p.x, new_p.y)
247255
} else {
248256
let p: CurvePointGenerator<Fq> = self.gen();

0 commit comments

Comments
 (0)