Skip to content

Commit 6662c7a

Browse files
committed
CI updates
1 parent dc577b6 commit 6662c7a

File tree

5 files changed

+72
-36
lines changed

5 files changed

+72
-36
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ runs:
2727
if: runner.os == 'macOS'
2828
shell: bash
2929
run: |
30-
brew install protobuf
30+
brew install protobuf ocaml opam
3131
3232
- name: Install cargo-nextest
3333
if: inputs.install-nextest == 'true'

.github/workflows/ci.yaml

Lines changed: 51 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Openmina CI
22
on:
33
push:
4-
branches: [ main, develop ]
4+
branches: [main, develop]
55
pull_request:
6-
paths-ignore: [ "frontend" ]
6+
paths-ignore: ["frontend"]
77
workflow_dispatch:
88
inputs:
99
refresh_cache:
10-
description: 'Refresh cargo cache'
10+
description: "Refresh cargo cache"
1111
required: false
1212
type: boolean
1313
default: false
@@ -18,6 +18,7 @@ env:
1818
OPENMINA_PANIC_ON_BUG: true
1919
CARGO_INCREMENTAL: 1
2020
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off"
21+
OCAML_VERSION: "4.14.2"
2122

2223
concurrency:
2324
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -140,7 +141,7 @@ jobs:
140141
# NOTE: If you add or remove platforms from this matrix, make sure to update
141142
# the documentation at website/docs/developers/getting-started.mdx
142143
strategy:
143-
fail-fast: false # Allow other platforms to continue if one fails
144+
fail-fast: false # Allow other platforms to continue if one fails
144145
matrix:
145146
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-latest]
146147
runs-on: ${{ matrix.os }}
@@ -151,6 +152,11 @@ jobs:
151152
- name: Setup build dependencies
152153
uses: ./.github/actions/setup-build-deps
153154

155+
- name: Use shared OCaml setting up steps
156+
uses: ./.github/actions/setup-ocaml
157+
with:
158+
ocaml_version: ${{ OCAML_VERSION }}
159+
154160
- name: Setup Rust
155161
uses: ./.github/actions/setup-rust
156162
with:
@@ -173,7 +179,7 @@ jobs:
173179
# NOTE: If you add or remove platforms from this matrix, make sure to update
174180
# the documentation at website/docs/developers/getting-started.mdx
175181
strategy:
176-
fail-fast: false # Allow other platforms to continue if one fails
182+
fail-fast: false # Allow other platforms to continue if one fails
177183
matrix:
178184
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-latest]
179185
runs-on: ${{ matrix.os }}
@@ -184,6 +190,11 @@ jobs:
184190
- name: Setup build dependencies
185191
uses: ./.github/actions/setup-build-deps
186192

193+
- name: Use shared OCaml setting up steps
194+
uses: ./.github/actions/setup-ocaml
195+
with:
196+
ocaml_version: ${{ OCAML_VERSION }}
197+
187198
- name: Setup WebAssembly environment
188199
uses: ./.github/actions/setup-wasm
189200
with:
@@ -197,7 +208,7 @@ jobs:
197208
# NOTE: If you add or remove platforms from this matrix, make sure to update
198209
# the documentation at website/docs/developers/getting-started.mdx
199210
strategy:
200-
fail-fast: false # Allow other platforms to continue if one fails
211+
fail-fast: false # Allow other platforms to continue if one fails
201212
matrix:
202213
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-latest]
203214
runs-on: ${{ matrix.os }}
@@ -208,6 +219,11 @@ jobs:
208219
- name: Setup build dependencies
209220
uses: ./.github/actions/setup-build-deps
210221

222+
- name: Use shared OCaml setting up steps
223+
uses: ./.github/actions/setup-ocaml
224+
with:
225+
ocaml_version: ${{ OCAML_VERSION }}
226+
211227
- name: Setup Rust
212228
uses: ./.github/actions/setup-rust
213229
with:
@@ -230,7 +246,7 @@ jobs:
230246
# NOTE: If you add or remove platforms from this matrix, make sure to update
231247
# the documentation at website/docs/developers/getting-started.mdx
232248
strategy:
233-
fail-fast: false # Allow other platforms to continue if one fails
249+
fail-fast: false # Allow other platforms to continue if one fails
234250
matrix:
235251
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-latest]
236252
runs-on: ${{ matrix.os }}
@@ -241,6 +257,11 @@ jobs:
241257
- name: Setup build dependencies
242258
uses: ./.github/actions/setup-build-deps
243259

260+
- name: Use shared OCaml setting up steps
261+
uses: ./.github/actions/ocaml-shared
262+
with:
263+
ocaml_version: ${{ OCAML_VERSION }}
264+
244265
- name: Setup Rust
245266
uses: ./.github/actions/setup-rust
246267
with:
@@ -259,7 +280,7 @@ jobs:
259280
retention-days: 7
260281

261282
p2p-scenario-tests:
262-
needs: [ build-tests, build-tests-webrtc ]
283+
needs: [build-tests, build-tests-webrtc]
263284
runs-on: ubuntu-24.04
264285
timeout-minutes: 20
265286
container:
@@ -269,8 +290,15 @@ jobs:
269290
BPF_ALIAS: /coda/0.0.1/29936104443aaf264a7f0192ac64b1c7173198c1ed404c1bcff5e562e05eb7f6-0.0.0.0
270291
strategy:
271292
matrix:
272-
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing, p2p_pubsub, p2p_kad,
273-
webrtc_p2p_basic_connections]
293+
test:
294+
[
295+
p2p_basic_connections,
296+
p2p_basic_incoming,
297+
p2p_basic_outgoing,
298+
p2p_pubsub,
299+
p2p_kad,
300+
webrtc_p2p_basic_connections,
301+
]
274302
fail-fast: false
275303

276304
services:
@@ -288,10 +316,10 @@ jobs:
288316
steps:
289317
- name: Install libssl3t64 # Our binaries are built on a newer ubuntu and require libssl3t64
290318
run: |
291-
apt-get update && \
292-
apt-get install -y --no-install-recommends libssl3t64 && \
293-
apt-get clean && \
294-
rm -rf /var/lib/apt/lists/*
319+
apt-get update && \
320+
apt-get install -y --no-install-recommends libssl3t64 && \
321+
apt-get clean && \
322+
rm -rf /var/lib/apt/lists/*
295323
296324
- name: Download tests
297325
uses: actions/download-artifact@v4
@@ -369,10 +397,10 @@ jobs:
369397
steps:
370398
- name: Install libssl3t64 # Our binaries are built on a newer ubuntu and require libssl3t64
371399
run: |
372-
apt-get update && \
373-
apt-get install -y --no-install-recommends libssl3t64 && \
374-
apt-get clean && \
375-
rm -rf /var/lib/apt/lists/*
400+
apt-get update && \
401+
apt-get install -y --no-install-recommends libssl3t64 && \
402+
apt-get clean && \
403+
rm -rf /var/lib/apt/lists/*
376404
377405
- name: Download tests
378406
uses: actions/download-artifact@v4
@@ -426,10 +454,10 @@ jobs:
426454
steps:
427455
- name: Install libssl3t64 # Our binaries are built on a newer ubuntu and require libssl3t64
428456
run: |
429-
apt-get update && \
430-
apt-get install -y --no-install-recommends libssl3t64 && \
431-
apt-get clean && \
432-
rm -rf /var/lib/apt/lists/*
457+
apt-get update && \
458+
apt-get install -y --no-install-recommends libssl3t64 && \
459+
apt-get clean && \
460+
rm -rf /var/lib/apt/lists/*
433461
434462
- name: Download tests
435463
uses: actions/download-artifact@v4
@@ -447,7 +475,7 @@ jobs:
447475
448476
bootstrap-test:
449477
timeout-minutes: 4
450-
needs: [ build, build-tests ]
478+
needs: [build, build-tests]
451479
runs-on: ubuntu-24.04
452480
env:
453481
OPENMINA_HOME: data

.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

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)