Skip to content

Commit

Permalink
Merge pull request #314 from openmina/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `main`
  • Loading branch information
tizoc committed Mar 29, 2024
2 parents adf6f81 + 5cfdf69 commit 68dd2bb
Show file tree
Hide file tree
Showing 532 changed files with 31,032 additions and 9,231 deletions.
56 changes: 22 additions & 34 deletions .drone.yml
Expand Up @@ -12,7 +12,6 @@ trigger:
- feat/graphql

environment:
REPLAYER_ID: 12D3KooWETkiRaHCdztkbmrWQTET9HMWimQPx5sH5pLSRZNxRsjw
CHAIN_ID: 3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e

OPENMINA1_SK: 5KJKg7yAbYAQcNGWcKFf2C4ruJxwrHoQvsksU16yPzFzXHMsbMc
Expand Down Expand Up @@ -54,16 +53,29 @@ steps:
- cp /usr/local/bin/mina cli/bin/

- name: build
image: rust:1.75-bullseye
image: rust:1.77-bullseye
commands:
- apt-get update && apt-get install -y libssl-dev libjemalloc-dev jq
- rustup update 1.75 && rustup default 1.75
- rustup update 1.77 && rustup default 1.77
- rustup component add rustfmt
- cargo test --release -p cli
- cargo build --release -p cli --bin openmina
# just to be sure it builds without errors
- cargo build
- cargo build --release --features p2p-libp2p --bin openmina
# unit tests
- cargo test --features p2p-libp2p --release -p cli
# build tester binaries
- cargo build --release --features scenario-generators --no-default-features -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-mio
- cargo build --release --features scenario-generators,p2p-libp2p -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-libp2p
- cargo build --release --features scenario-generators,p2p-libp2p,p2p-webrtc -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-webrtc
- cargo build --release --bin runner
- cargo build --release --features scenario-generators -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-libp2p
- cargo build --release --features scenario-generators,p2p-webrtc -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-webrtc

# o sole mio :)
- name: solo-mio-bootstrap
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
failure: ignore
commands:
- cp target/release/openmina-node-testing-mio /usr/bin/openmina-node-testing-mio
- openmina-node-testing-mio scenarios-generate --name solo-node-bootstrap

- name: solo-webrtc-sync-root-snarked-ledger
image: vladsimplestakingcom/mina-debugger:2.0.0rampup4-focal
Expand Down Expand Up @@ -177,24 +189,14 @@ steps:
environment:
BPF_ALIAS: "/coda/0.0.1/3c41383994b87449625df91769dff7b507825c064287d30fada9286f3f1cb15e-255.255.255.7"

- name: replayer
image: vladsimplestakingcom/bootstrap-rr:graphql
pull: always
detach: true
environment:
# 12D3KooWETkiRaHCdztkbmrWQTET9HMWimQPx5sH5pLSRZNxRsjw
OPENMINA_P2P_SEC_KEY: 5JDRBqXfHm4Xne1QKUJyg9FKRfwN6gtduZb7nVYHg2F1BmwPynT
commands:
- RUST_LOG=info openmina-bootstrap-sandbox --path='/tmp/mina-record' --listen='/ip4/0.0.0.0/tcp/8302' --chain-id=$CHAIN_ID replay 234

- name: openmina1
image: *snark-worker-image
detach: true
commands:
- mkdir test_ledgers
- curl https://raw.githubusercontent.com/openmina/openmina-poc/3a81bc7/test_ledgers/jx5k7xf3L2aof821PQWumABQ793rhEis5kRb8YUmJWTHKtEJ5nb -o test_ledgers/jx5k7xf3L2aof821PQWumABQ793rhEis5kRb8YUmJWTHKtEJ5nb
- target/release/openmina node -p 10000 -v Debug -s $OPENMINA1_SK
--peers /dns4/replayer/tcp/8302/p2p/$REPLAYER_ID /dns4/openmina2/tcp/8302/p2p/$OPENMINA2_LIBP2P_ID /dns4/openmina3/tcp/8302/p2p/$OPENMINA3_LIBP2P_ID
--peers /dns4/openmina2/tcp/8302/p2p/$OPENMINA2_LIBP2P_ID /dns4/openmina3/tcp/8302/p2p/$OPENMINA3_LIBP2P_ID
/dns4/ocaml1/tcp/8302/p2p/12D3KooWKLzGWSdFAQGEAtrHan1TTwu7idagcZ83X6MXWfUJNiTU
--run-snarker $OPENMINA1_SNARKER_KEY --snarker-strategy seq --snarker-exe-path cli/bin/snark-worker

Expand All @@ -203,31 +205,17 @@ steps:
detach: true
commands:
- target/release/openmina node -p 10000 -v Debug -s $OPENMINA2_SK
--peers /dns4/replayer/tcp/8302/p2p/$REPLAYER_ID /dns4/openmina1/tcp/8302/p2p/$OPENMINA1_LIBP2P_ID /dns4/openmina3/tcp/8302/p2p/$OPENMINA3_LIBP2P_ID
--peers /dns4/openmina1/tcp/8302/p2p/$OPENMINA1_LIBP2P_ID /dns4/openmina3/tcp/8302/p2p/$OPENMINA3_LIBP2P_ID
--run-snarker $OPENMINA2_SNARKER_KEY --snarker-strategy rand --snarker-exe-path cli/bin/snark-worker

- name: test-bootstrap-replayer-to-openmina
image: vladsimplestakingcom/bootstrap-rr:graphql
pull: always
commands:
- sleep 180
- RUST_LOG=debug timeout 3600s openmina-bootstrap-sandbox --path='/tmp/mina-record' --chain-id=$CHAIN_ID test-graphql 234 http://openmina1:10000/graphql

- name: openmina3
image: *snark-worker-image
detach: true
commands:
- target/release/openmina node -p 10000 -v Debug -s $OPENMINA3_SK
--peers /dns4/replayer/tcp/8302/p2p/$REPLAYER_ID /dns4/openmina1/tcp/8302/p2p/$OPENMINA1_LIBP2P_ID /dns4/openmina2/tcp/8302/p2p/$OPENMINA2_LIBP2P_ID
--peers /dns4/openmina1/tcp/8302/p2p/$OPENMINA1_LIBP2P_ID /dns4/openmina2/tcp/8302/p2p/$OPENMINA2_LIBP2P_ID
--run-snarker $OPENMINA3_SNARKER_KEY --snarker-strategy rand --snarker-exe-path cli/bin/snark-worker

- name: test-bootstrap-openmina-to-openmina
image: vladsimplestakingcom/bootstrap-rr:graphql
pull: always
commands:
- sleep 180
- RUST_LOG=debug timeout 3600s openmina-bootstrap-sandbox --path='/tmp/mina-record' --chain-id=$CHAIN_ID test-graphql 234 http://openmina3:10000/graphql

- name: test-snark-work
image: alpine
commands:
Expand Down
37 changes: 26 additions & 11 deletions .github/workflows/ci.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
CARGO_TERM_COLOR: always
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Rust
run: |
# Nightly to be able to use `--report-time` below
Expand All @@ -39,12 +39,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Rust
run: |
rustup install 1.75
rustup override set 1.75
rustup install 1.77
rustup override set 1.77
rustup component add clippy rustfmt
# - name: Check
Expand All @@ -69,7 +69,7 @@ jobs:
cargo build --release --bin openmina
- name: Upload binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bin
path: target/release/openmina
Expand All @@ -88,10 +88,15 @@ jobs:
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
cargo build --release --features=scenario-generators,p2p-libp2p --package=openmina-node-testing --tests
cargo build --release --features=scenario-generators,p2p-libp2p --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/libp2p_$NAME; done < tests.tsv
tar cf tests.tar -C target/release/tests .
- name: Upload tests
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: tests
path: tests.tar
Expand All @@ -104,21 +109,26 @@ jobs:
strategy:
matrix:
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing]
libp2p:
- external
# - internal
fail-fast: false
env:
TEST: ${{ matrix.libp2p == 'external' && format('libp2p_{0}', matrix.test) || matrix.test }}

steps:
- name: Download tests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: tests

- name: Unpack tests
run: |
tar xf tests.tar ./${{ matrix.test }}
tar xf tests.tar ./${{ env.TEST }}
- name: Run the test
run: |
./${{ matrix.test }} --nocapture --test-threads=1
./${{ env.TEST }} --nocapture --test-threads=1
scenario-tests:
needs: [ build ]
Expand All @@ -127,12 +137,17 @@ jobs:
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
strategy:
matrix:
test: [single_node, multi_node, connection_discovery, webrtc_single_node, webrtc_multi_node]
test:
- single_node
- multi_node
- webrtc_single_node
- webrtc_multi_node
# - connection_discovery
fail-fast: false

steps:
- name: Download tests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: tests

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/rustfmt.yml
@@ -0,0 +1,22 @@
name: rustfmt

on:
push:
branches: [ main, develop ]
pull_request:

jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.77
default: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 68dd2bb

Please sign in to comment.