Skip to content

Commit 08e82c7

Browse files
authored
Merge pull request #453 from openmina/develop
Merge `develop` into `main`
2 parents 44b3cfe + 4b4942a commit 08e82c7

File tree

504 files changed

+66311
-10925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

504 files changed

+66311
-10925
lines changed

.drone.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,16 @@ steps:
5555
- name: build
5656
image: rust:1.77-bullseye
5757
commands:
58-
- apt-get update && apt-get install -y libssl-dev libjemalloc-dev jq
58+
- apt-get update && apt-get install -y libssl-dev libjemalloc-dev jq protobuf-compiler
5959
- rustup update 1.77 && rustup default 1.77
6060
- rustup component add rustfmt
6161
# just to be sure it builds without errors
6262
- cargo build
63-
- cargo build --release --features p2p-libp2p --bin openmina
63+
- cargo build --release --bin openmina
6464
# unit tests
65-
- cargo test --features p2p-libp2p --release -p cli
65+
- cargo test --release -p cli
6666
# build tester binaries
67-
- 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
68-
- cargo build --release --features scenario-generators,p2p-libp2p -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-libp2p
69-
- 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
67+
- cargo build --release --features scenario-generators -p openmina-node-testing && mv target/release/openmina-node-testing target/release/openmina-node-testing-mio
7068
- cargo build --release --bin runner
7169

7270
# o sole mio :)
@@ -333,6 +331,41 @@ steps:
333331
depends_on:
334332
- prepare
335333

334+
- name: block-production-overview-epoch-graphs
335+
image: cypress/included:13.3.2
336+
commands:
337+
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/epoch-graphs.cy.ts"
338+
depends_on:
339+
- prepare
340+
341+
- name: block-production-overview-slots
342+
image: cypress/included:13.3.2
343+
commands:
344+
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/slots.cy.ts"
345+
depends_on:
346+
- prepare
347+
348+
- name: block-production-overview-side-panel
349+
image: cypress/included:13.3.2
350+
commands:
351+
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/side-panel.cy.ts"
352+
depends_on:
353+
- prepare
354+
355+
- name: block-production-overview-toolbar
356+
image: cypress/included:13.3.2
357+
commands:
358+
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/toolbar.cy.ts"
359+
depends_on:
360+
- prepare
361+
362+
- name: block-production-overview-apis
363+
image: cypress/included:13.3.2
364+
commands:
365+
- cd frontend && cypress run --config-file "cypress.config.js" --spec "cypress/e2e/block-production/overview/apis.cy.ts"
366+
depends_on:
367+
- prepare
368+
336369
- name: nodes-overview-table
337370
image: cypress/included:13.3.2
338371
commands:
@@ -460,6 +493,11 @@ steps:
460493
from_secret: docker_hub_password
461494
depends_on:
462495
- dashboard-peers
496+
- block-production-overview-epoch-graphs
497+
- block-production-overview-slots
498+
- block-production-overview-side-panel
499+
- block-production-overview-toolbar
500+
- block-production-overview-apis
463501
- nodes-overview-table
464502
- nodes-overview-side-panel
465503
- nodes-live-blocks-map

.github/workflows/ci.yaml

Lines changed: 95 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
RUST_MIN_STACK: 10000000
14+
1215
jobs:
1316
ledger-tests:
1417
runs-on: ubuntu-20.04
@@ -17,6 +20,10 @@ jobs:
1720
steps:
1821
- name: Git checkout
1922
uses: actions/checkout@v4
23+
- name: Setup build dependencies
24+
run: |
25+
sudo apt update
26+
sudo apt install -y protobuf-compiler
2027
- name: Setup Rust
2128
run: |
2229
# Nightly to be able to use `--report-time` below
@@ -41,6 +48,11 @@ jobs:
4148
- name: Git checkout
4249
uses: actions/checkout@v4
4350

51+
- name: Setup build dependencies
52+
run: |
53+
sudo apt update
54+
sudo apt install -y protobuf-compiler
55+
4456
- name: Setup Rust
4557
run: |
4658
rustup default 1.77
@@ -62,6 +74,11 @@ jobs:
6274
- name: Git checkout
6375
uses: actions/checkout@v4
6476

77+
- name: Setup build dependencies
78+
run: |
79+
sudo apt update
80+
sudo apt install -y protobuf-compiler
81+
6582
- name: Setup Rust
6683
run: |
6784
rustup default 1.77
@@ -88,6 +105,11 @@ jobs:
88105
- name: Git checkout
89106
uses: actions/checkout@v4
90107

108+
- name: Setup build dependencies
109+
run: |
110+
sudo apt update
111+
sudo apt install -y protobuf-compiler
112+
91113
- name: Setup Rust
92114
run: |
93115
rustup default 1.77
@@ -115,10 +137,16 @@ jobs:
115137

116138
build-tests-webrtc:
117139
runs-on: ubuntu-20.04
140+
if: false
118141
steps:
119142
- name: Git checkout
120143
uses: actions/checkout@v4
121144

145+
- name: Setup build dependencies
146+
run: |
147+
sudo apt update
148+
sudo apt install -y protobuf-compiler
149+
122150
- name: Setup Rust
123151
run: |
124152
rustup default 1.77
@@ -151,7 +179,7 @@ jobs:
151179
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
152180
strategy:
153181
matrix:
154-
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing]
182+
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing, p2p_pubsub]
155183
fail-fast: false
156184

157185
steps:
@@ -168,19 +196,51 @@ jobs:
168196
run: |
169197
./${{ matrix.test }} --test-threads=1
170198
199+
k8s-peers:
200+
runs-on: ubuntu-20.04
201+
# TODO: query cluster for actual addresses, or specify then on deployment
202+
env:
203+
PEERS: |
204+
/ip4/135.181.217.23/tcp/31881/p2p/12D3KooWKiKQkUTTZ6u8HDk471ZQE2vStpEDnySiKDrYgZGfEcsF
205+
/ip4/135.181.217.23/tcp/30386/p2p/12D3KooWBHknA3ty2tk4u3N6Rwnjs5YwYaxHT9dURf7zGeBJ4VJG
206+
/ip4/135.181.217.23/tcp/32272/p2p/12D3KooWDZDH6ucaZY4bU2R8Xy9T1iy4PGtaZ8vEWeuGEeLaQEg5
207+
/ip4/135.181.217.23/tcp/32218/p2p/12D3KooWMenq7gPcF7utkZao8WLtjMqsZkY7LeLD1Y9q9YyQZnkG
208+
/ip4/135.181.217.23/tcp/30798/p2p/12D3KooWMMsF7dYbn4Szf7TvrRofuK53W3zj6TDKgxAFSWYypLsB
209+
/ip4/135.181.217.23/tcp/31631/p2p/12D3KooWNeaaS6wpPSa41qkxQWaeauDR51WCNnLUyd5CcjBBiNTq
210+
/ip4/135.181.217.23/tcp/30196/p2p/12D3KooWCBTaSVMxDT1SUoeSg3PUsVL1Df1hDxkSvN544i7tsE76
211+
/ip4/135.181.217.23/tcp/30790/p2p/12D3KooWG7egucvX5sompG2euhaPL4QQ3BdHJrLS7HGWyiHyoD5y
212+
/ip4/135.181.217.23/tcp/30070/p2p/12D3KooWFG5dhmgS6rb8NdoNbiK7Vf6TqTQDTYxq18DVkmPwsgfg
213+
outputs:
214+
peers: ${{ steps.peers.outputs.peers }}
215+
steps:
216+
- id: peers
217+
name: Fetch k8s OCaml peers
218+
run: |
219+
{
220+
echo 'peers<<EOF'
221+
echo $PEERS
222+
echo EOF
223+
} >> "$GITHUB_OUTPUT"
224+
171225
scenario-tests:
172-
if: false
173-
needs: [ build-tests, build-tests-webrtc ]
226+
needs:
227+
- k8s-peers
228+
- build-tests
229+
# - build-tests-webrtc
174230
runs-on: ubuntu-20.04
175231
container:
176232
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
233+
env:
234+
# to allow local addrs discovery
235+
OPENMINA_DISCOVERY_FILTER_ADDR: false
236+
OPENMINA_SCENARIO_SEEDS: ${{ needs.k8s-peers.outputs.peers }}
177237
strategy:
178238
matrix:
179239
test:
180240
- single_node
181241
- multi_node
182-
- webrtc_single_node
183-
- webrtc_multi_node
242+
# - webrtc_single_node
243+
# - webrtc_multi_node
184244
# - connection_discovery
185245
fail-fast: false
186246

@@ -201,41 +261,51 @@ jobs:
201261
202262
203263
bootstrap-test:
204-
needs: [ build ]
264+
needs: [ k8s-peers, build ]
205265
runs-on: ubuntu-20.04
266+
env:
267+
PEERS: ${{ needs.k8s-peers.outputs.peers }}
206268
steps:
207269
- name: Download binary
208270
uses: actions/download-artifact@v4
209271
with:
210272
name: bin
211273

212-
- name: Prepare peers list
213-
run: |
214-
cat > peers.txt <<EOF
215-
/ip4/135.181.217.23/tcp/31881/p2p/12D3KooWL7TyJx6TZZVKqPKkjNXXovu4y7aRQaWEx3eaiY45Lqw8
216-
/ip4/135.181.217.23/tcp/30386/p2p/12D3KooWQywRHUxh4bjvPSDKbrY8GeUzeGgHxKbesrJYpgqvaicS
217-
/ip4/135.181.217.23/tcp/32272/p2p/12D3KooWA4Mcr2Kn6ivtqFxWcFdLxGW2gqdDVwS86kToUCYst2rj
218-
/ip4/135.181.217.23/tcp/32218/p2p/12D3KooWKWRfqG8QdkpAVY3xUzxndPBgj5WR6fxBNAJKSzek3URZ
219-
/ip4/135.181.217.23/tcp/30798/p2p/12D3KooWJXiYRpj1dCLPv2PMLyNTuWSgzavyKXyaVsmBRhnBVCNM
220-
/ip4/135.181.217.23/tcp/31631/p2p/12D3KooWNeaaS6wpPSa41qkxQWaeauDR51WCNnLUyd5CcjBBiNTq
221-
/ip4/135.181.217.23/tcp/30196/p2p/12D3KooWDdJEVxdrthmuBiEL2Yi6nnryo4UYxz1f98TiykyFBx7H
222-
/ip4/135.181.217.23/tcp/30790/p2p/12D3KooWN8wmWdivGuUG7fTkV34hihgC6RnrfygzbZCuaQceaiak
223-
/ip4/135.181.217.23/tcp/30070/p2p/12D3KooWNi6nauXV3bMtwkc3wqA7V79Um92muVJ5pKvC11wVo2xk
224-
EOF
225-
echo "::group::Peers for bottstrapping"
226-
cat peers.txt
227-
echo "::endgroup::"
228-
229274
- name: Bootstrap node
230275
run: |
231276
set -eu
232277
chmod +x ./openmina
233-
./openmina node --no-peers-discovery --peers $(cat peers.txt) |& tee run.log &
278+
./openmina node --no-peers-discovery --peers $PEERS 2>&1 | tee run.log &
234279
PID=$!
235280
TIME=10
236281
SLEEP=10
237282
ATTEMPTS=$((TIME * 60 / SLEEP))
238-
while ! curl -fs localhost:3000/readyz; do
283+
284+
healthy() {
285+
curl -fs -m 5 localhost:3000/healthz
286+
}
287+
288+
ready() {
289+
curl -fs -m 5 localhost:3000/readyz
290+
}
291+
292+
ready3() {
293+
ready && sleep 10 && ready && sleep 10 && ready
294+
}
295+
296+
while ! healthy; do
297+
echo "::notice::The node is not healthy yet"
298+
ATTEMPTS=$((ATTEMPTS-1))
299+
if [ "${ATTEMPTS}" -eq 0 ]; then
300+
echo "::error::Cannot bootsrtap within $TIME minutes"
301+
exit 1
302+
fi
303+
sleep $SLEEP
304+
done
305+
echo "::notice::The node is healthy"
306+
307+
while ! ready3; do
308+
echo "::notice::The node is not bootstrapped yet"
239309
ATTEMPTS=$((ATTEMPTS-1))
240310
if [ "${ATTEMPTS}" -eq 0 ]; then
241311
echo "::error::Cannot bootsrtap within $TIME minutes"

.github/workflows/docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
uses: docker/build-push-action@v5
4747
with:
4848
context: .
49+
platforms: linux/amd64,linux/arm64
4950
push: true
5051
tags: ${{ steps.meta.outputs.tags }}
5152
cache-from: type=gha

.github/workflows/lint.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14+
- name: Setup build dependencies
15+
run: |
16+
sudo apt update
17+
sudo apt install -y protobuf-compiler
1418
- uses: actions-rs/toolchain@v1
1519
with:
1620
toolchain: 1.77
@@ -21,8 +25,15 @@ jobs:
2125
with:
2226
command: fmt
2327
args: --all -- --check
28+
- uses: actions-rs/cargo@v1
29+
name: check
30+
with:
31+
command: check
32+
args: --all-targets
33+
env:
34+
RUSTFLAGS: -D warnings
2435
- uses: actions-rs/clippy-check@v1
2536
name: clippy
2637
with:
2738
token: ${{ secrets.GITHUB_TOKEN }}
28-
args: --all-targets -- -A clippy::too_many_arguments -A clippy::doc_markdown
39+
args: --all-targets -- -D warnings

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.5.0] - 2024-05-31
11+
12+
### Fixed
13+
14+
- When applying blocks, use the `supercharge_coinbase` value from the block which was being ignored before.
15+
- Incorrect stream being used for RPC responses.
16+
- Allow multiple nodes running on the same host to connect to each other.
17+
- Invalid `delta_block_chain_proof` in block producer.
18+
- Various p2p layer fixes.
19+
20+
### Added
21+
22+
- Support for PubSub in the p2p layer.
23+
- Block producer dashboard, and simulator-based demo.
24+
- Support for parsing `daemon.json` files with custom genesis ledgers.
25+
- Chain ID computation (was hardcoded before).
26+
- Multiple RPC and p2p tests.
27+
- More limits to p2p messages, connections, and parsing.
28+
29+
### Removed
30+
31+
- Support for v1 messages in p2p layer.
32+
1033
## [0.4.0] - 2024-04-30
1134

1235
### Fixed

0 commit comments

Comments
 (0)