Skip to content

Added broadcast delay for snarks and transactions until they are fully vertified #3828

Added broadcast delay for snarks and transactions until they are fully vertified

Added broadcast delay for snarks and transactions until they are fully vertified #3828

Workflow file for this run

name: Openmina CI
on:
push:
branches: [ main, develop ]
pull_request:
paths-ignore: [ "frontend" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
OPENMINA_PANIC_ON_BUG: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ledger-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: Download circuits files
run: |
git clone --depth 1 https://github.com/openmina/circuit-blobs.git
ln -s -b $PWD/circuit-blobs/* ledger/
- name: Build ledger tests
run: |
cd ledger
cargo build --release --tests
- name: Run ledger tests
run: |
cd ledger
cargo test --release -- -Z unstable-options --report-time
ledger-32x9-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: Download circuits files
run: |
git clone --depth 1 https://github.com/openmina/circuit-blobs.git
ln -s -b $PWD/circuit-blobs/* ledger/
- name: Enable 32x9 fields implementation
run: |
cargo install sd
sd '^mina-curves.*$' '' ./Cargo.toml
sd '^ark-ff = \{ version .*$' '' ./Cargo.toml
sd -F '# UNCOMMENTED_IN_CI ' '' ./Cargo.toml
cat ./Cargo.toml
- name: Build ledger tests
run: |
cd ledger
cargo build --release --tests
- name: Run ledger tests
run: |
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:
- 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: |
rustup install nightly
rustup override set nightly
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: Check for compilation errors in transaction fuzzer
run: |
cd tools/fuzzing
cargo check
p2p-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: |
rustup default 1.84
rustup component add rustfmt
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0"
- name: Test p2p crate
run: |
cargo test -p p2p --tests
build:
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: |
rustup default 1.84
rustup component add rustfmt
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0"
- name: Release build
run: |
cargo build --release --bin openmina
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: bin
path: target/release/openmina
build_wasm:
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: |
rustup default nightly
rustup component add rustfmt rust-src
rustup target add wasm32-unknown-unknown
cargo install -f wasm-bindgen-cli --version 0.2.99
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0"
- name: Release build
run: |
cd node/web
cargo +nightly build --release --target wasm32-unknown-unknown
wasm-bindgen --keep-debug --web --out-dir pkg ../../target/wasm32-unknown-unknown/release/openmina_node_web.wasm
build-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: |
rustup default 1.84
rustup component add rustfmt
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0"
- name: Build tests
run: |
mkdir -p target/release/tests
cargo build --release --tests --package=openmina-node-testing --package=cli
cargo build --release --tests --package=openmina-node-testing --package=cli --message-format=json > cargo-build-test.json
jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
while read NAME FILE; do cp -a $FILE target/release/tests/$NAME; done < tests.tsv
- name: Upload tests
uses: actions/upload-artifact@v4
with:
name: tests
path: target/release/tests
build-tests-webrtc:
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: |
rustup default 1.84
rustup component add rustfmt
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0"
- name: Build tests
run: |
mkdir -p target/release/tests
cargo build --release --features=scenario-generators,p2p-webrtc --package=openmina-node-testing --tests
cargo build --release --features=scenario-generators,p2p-webrtc --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' cargo-build-test.json > tests.tsv
while read NAME FILE; do cp -a $FILE target/release/tests/webrtc_$NAME; done < tests.tsv
- name: Upload tests
uses: actions/upload-artifact@v4
with:
name: tests-webrtc
path: target/release/tests
p2p-scenario-tests:
needs: [ build-tests, build-tests-webrtc ]
runs-on: ubuntu-20.04
container:
image: gcr.io/o1labs-192920/mina-daemon:3.0.4-alpha1-889607b-bullseye-devnet
options: --volume debugger_data:/tmp/db
env:
BPF_ALIAS: /coda/0.0.1/29936104443aaf264a7f0192ac64b1c7173198c1ed404c1bcff5e562e05eb7f6-0.0.0.0
strategy:
matrix:
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing, p2p_pubsub, p2p_kad,
webrtc_p2p_basic_connections]
fail-fast: false
services:
network-debugger:
image: openmina/mina-network-debugger:23385c61
options: --privileged --init --volume debugger_data:/tmp/db --volume /sys/kernel/debug:/sys/kernel/debug
env:
SERVER_PORT: 80
FIREWALL_INTERFACE: lo
RUST_LOG: info
DB_PATH: /tmp/db
ports:
- 80:80
steps:
- name: Download tests
uses: actions/download-artifact@v4
with:
pattern: tests*
merge-multiple: true
- name: Setup permissions
run: |
chmod +x ./${{ matrix.test }}
# TODO: use curl
- name: Wait for the debugger
run: |
sleep 5
- name: Run the test
run: |
./${{ matrix.test }} --test-threads=1
- name: Archive network debugger database
uses: actions/upload-artifact@v4
with:
name: network-debugger-${{ matrix.test }}
path: /tmp/db
if: ${{ always() }}
k8s-peers:
runs-on: ubuntu-20.04
# TODO: query cluster for actual addresses, or specify then on deployment
env:
PEERS: |
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40101/p2p/12D3KooWNGY3guz8pYHrVEqs8se4MSnnmpgguyQYDazMbVCyrMnS
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40102/p2p/12D3KooWSqZ4qtysb8Du4yVpcc5SYc3gsRuNqgMomggw6hekATWg
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40103/p2p/12D3KooWSHiGavQpamDPEc6rPaqT4PoS1Lr9aDfrfg5dKM2V6x3H
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40104/p2p/12D3KooWA3yPrTaLXsggVSCG4mr7c33YNdz5DSs87LszRUVt9vLT
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40105/p2p/12D3KooWCLcUWCdU4VstETztxE3feQyS57dVDdzBhmkj5tiCaha8
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40106/p2p/12D3KooWNZWqEoCuhMrc9tTMxtEsfxmeFhjh2agUcmzJFNKxQnNA
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40107/p2p/12D3KooWAMSP94SM3icSeAXeBmPUuZ5JvwrZ5w87fpRHVeJkdboe
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40108/p2p/12D3KooWL5gPf5CrARVPhBi6KsDHmB1gsJKZ4vWrcLweWyMjpB5e
/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40109/p2p/12D3KooWT1nNJLGE8jWcshPSq3FmSXmmNn2MzfmvJcWYZ1HrtHnZ
outputs:
peers: ${{ steps.peers.outputs.peers }}
steps:
- id: peers
name: Fetch k8s OCaml peers
run: |
{
echo 'peers<<EOF'
echo $PEERS
echo EOF
} >> "$GITHUB_OUTPUT"
scenario-tests:
needs:
- k8s-peers
- build-tests
- build-tests-webrtc
runs-on: ubuntu-20.04
container:
image: gcr.io/o1labs-192920/mina-daemon:3.0.4-alpha1-889607b-bullseye-devnet
options: --volume debugger_data:/tmp/db
env:
# to allow local addrs discovery
OPENMINA_DISCOVERY_FILTER_ADDR: false
# to allow connection with replayer
# TODO: remove when replayer supports identify
KEEP_CONNECTION_WITH_UNKNOWN_STREAM: true
OPENMINA_SCENARIO_SEEDS: ${{ needs.k8s-peers.outputs.peers }}
REPLAYER_MULTIADDR: "/dns4/primary-tcp-proxy.hz.minaprotocol.network/tcp/40110/p2p/12D3KooWPayQEdprqY2m3biReUUybA5LoULpJE7YWu6wetEKKELv"
BPF_ALIAS: /coda/0.0.1/29936104443aaf264a7f0192ac64b1c7173198c1ed404c1bcff5e562e05eb7f6-0.0.0.0
strategy:
matrix:
test:
- single_node
- multi_node_initial_joining
- multi_node_peer_discovery
- multi_node_propagate_block
- connection_discovery_ocaml_to_rust_via_seed
- connection_discovery_ocaml_to_rust
- connection_discovery_rust_as_seed
- connection_discovery_rust_to_ocaml_via_seed
- connection_discovery_rust_to_ocaml
- webrtc_p2p_signaling
# - webrtc_single_node
# - webrtc_multi_node
fail-fast: false
services:
network-debugger:
image: openmina/mina-network-debugger:23385c61
options: --privileged --init --volume debugger_data:/tmp/db --volume /sys/kernel/debug:/sys/kernel/debug
env:
SERVER_PORT: 80
FIREWALL_INTERFACE: lo
RUST_LOG: info
DB_PATH: /tmp/db
ports:
- 80:80
steps:
- name: Download tests
uses: actions/download-artifact@v4
with:
pattern: tests*
merge-multiple: true
- name: Download tests
uses: actions/download-artifact@v4
with:
pattern: tests-webrtc*
merge-multiple: true
- name: Setup permissions
run: |
chmod +x ./${{ matrix.test }}
# TODO: use curl
- name: Wait for the debugger
run: |
sleep 5
- name: Run the test
run: |
./${{ matrix.test }} --test-threads=1
- name: Archive network debugger database
uses: actions/upload-artifact@v4
with:
name: network-debugger-${{ matrix.test }}
path: /tmp/db
if: ${{ always() }}
record-replay-tests:
needs:
- k8s-peers
- build-tests
- build-tests-webrtc
runs-on: ubuntu-20.04
container:
image: gcr.io/o1labs-192920/mina-daemon:3.0.4-alpha1-889607b-bullseye-devnet
env:
# to allow local addrs discovery
OPENMINA_DISCOVERY_FILTER_ADDR: false
OPENMINA_SCENARIO_SEEDS: ${{ needs.k8s-peers.outputs.peers }}
strategy:
matrix:
test: [record_replay, webrtc_record_replay]
fail-fast: false
steps:
- name: Download tests
uses: actions/download-artifact@v4
with:
pattern: tests*
merge-multiple: true
- name: Setup permissions
run: |
chmod +x ./${{ matrix.test }}
- name: Run the test
run: |
./${{ matrix.test }} --test-threads=1
bootstrap-test:
needs: [ k8s-peers, build, build-tests ]
runs-on: ubuntu-20.04
env:
PEERS_LIST: ${{ needs.k8s-peers.outputs.peers }}
PEER_LIST_FILE: peer-list.txt
OPENMINA_HOME: data
BPF_ALIAS: /coda/0.0.1/29936104443aaf264a7f0192ac64b1c7173198c1ed404c1bcff5e562e05eb7f6-0.0.0.0
services:
network-debugger:
image: openmina/mina-network-debugger:23385c61
options: --privileged --init --volume /tmp/db:/tmp/db --volume /sys/kernel/debug:/sys/kernel/debug
env:
SERVER_PORT: 80
FIREWALL_INTERFACE: lo
RUST_LOG: info
DB_PATH: /tmp/db
ports:
- 80:80
steps:
- name: Download binary
uses: actions/download-artifact@v4
with:
name: bin
- name: Download test
uses: actions/download-artifact@v4
with:
pattern: tests*
merge-multiple: true
- name: Fix permissions
run: |
chmod +x bootstrap openmina
# TODO: use curl
- name: Wait for the debugger
run: |
sleep 5
- name: Peer List File
run: |
for PEER in $PEERS_LIST; do echo $PEER; done > $PEER_LIST_FILE
cat $PEER_LIST_FILE
- name: Bootstrap node
env:
OPENMINA_COMMAND: openmina
NO_PEER_DISCOVERY: "true"
OUT_PATH: ${{ env.OPENMINA_HOME }}/logs/bootstrap_output
RECORD: state-with-input-actions
run: |
mkdir -p $OUT_PATH
PATH=$PATH:$(pwd) OPENMINA_COMMAND=openmina NO_PEER_DISCOVERY=true ./bootstrap --nocapture || {
echo "::group::Stderr"
cat $OUT_PATH.stderr
echo "::endgroup::"
exit 1
}
- name: Upload logs
uses: actions/upload-artifact@v4
with:
name: bootstrap-logs
path: ${{ env.OPENMINA_HOME }}/logs/*
if: ${{ failure() }}
- name: Upload record
uses: actions/upload-artifact@v4
with:
name: bootstrap-record
path: ${{ env.OPENMINA_HOME }}/recorder/*
if: ${{ failure() }}
- name: Archive network debugger database
uses: actions/upload-artifact@v4
with:
name: network-debugger-test-bootstrap
path: /tmp/db
if: ${{ always() }}