Skip to content

Commit 6915ab3

Browse files
authored
Merge pull request #337 from openmina/develop
Merge `develop` into `main`
2 parents 68dd2bb + 7718c27 commit 6915ab3

File tree

179 files changed

+3438
-2952
lines changed

Some content is hidden

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

179 files changed

+3438
-2952
lines changed

.drone.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ steps:
304304
DOCKER_BUILDKIT: "0"
305305
commands:
306306
- COMMIT_SHORT_SHA=$(echo $DRONE_COMMIT_SHA | cut -c 1-7)
307-
- docker build --no-cache -t openmina/rust-fe:$COMMIT_SHORT_SHA -f Dockerfile_FE .
307+
- docker build --no-cache -t openmina/frontend:$COMMIT_SHORT_SHA -f Dockerfile_FE .
308308
volumes:
309309
- name: docker_sock
310310
path: /var/run/docker.sock
@@ -319,7 +319,7 @@ steps:
319319
- build
320320

321321
- name: frontend-server
322-
image: openmina/rust-fe:${DRONE_COMMIT_SHA:0:7}
322+
image: openmina/frontend:${DRONE_COMMIT_SHA:0:7}
323323
pull: if-not-exists
324324
detach: true
325325
privileged: true
@@ -449,7 +449,7 @@ steps:
449449
image: docker:latest
450450
commands:
451451
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
452-
- docker push openmina/rust-fe:${DRONE_COMMIT_SHA:0:7}
452+
- docker push openmina/frontend:${DRONE_COMMIT_SHA:0:7}
453453
volumes:
454454
- name: docker_sock
455455
path: /var/run/docker.sock

.github/workflows/ci.yaml

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ jobs:
4747
rustup override set 1.77
4848
rustup component add clippy rustfmt
4949
50-
# - name: Check
51-
# uses: actions-rs/cargo@v1
52-
# with:
53-
# command: check
54-
55-
# - name: Clippy
56-
# uses: actions-rs/cargo@v1
57-
# with:
58-
# command: clippy
59-
# # don't fail the job until clippy is fixed
60-
# continue-on-error: true
61-
6250
- name: Setup Rust Cache
6351
uses: Swatinem/rust-cache@v2
6452
with:
@@ -74,9 +62,26 @@ jobs:
7462
name: bin
7563
path: target/release/openmina
7664

65+
build-tests:
66+
runs-on: ubuntu-20.04
67+
steps:
68+
- name: Git checkout
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Rust
72+
run: |
73+
rustup install 1.77
74+
rustup override set 1.77
75+
rustup component add clippy rustfmt
76+
77+
- name: Setup Rust Cache
78+
uses: Swatinem/rust-cache@v2
79+
with:
80+
prefix-key: "ver-0"
81+
7782
- name: Build tests
7883
run: |
79-
mkdir target/release/tests
84+
mkdir -p target/release/tests
8085
8186
cargo build --release --features=scenario-generators --package=openmina-node-testing --tests
8287
cargo build --release --features=scenario-generators --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
@@ -102,7 +107,7 @@ jobs:
102107
path: tests.tar
103108

104109
p2p-tests:
105-
needs: [ build ]
110+
needs: [ build-tests ]
106111
runs-on: ubuntu-20.04
107112
container:
108113
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
@@ -131,7 +136,7 @@ jobs:
131136
./${{ env.TEST }} --nocapture --test-threads=1
132137
133138
scenario-tests:
134-
needs: [ build ]
139+
needs: [ build-tests ]
135140
runs-on: ubuntu-20.04
136141
container:
137142
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
@@ -158,3 +163,56 @@ jobs:
158163
- name: Run the test
159164
run: |
160165
./${{ matrix.test }} --nocapture --test-threads=1
166+
167+
168+
bootstrap-test:
169+
needs: [ build ]
170+
runs-on: ubuntu-20.04
171+
steps:
172+
- name: Download binary
173+
uses: actions/download-artifact@v4
174+
with:
175+
name: bin
176+
177+
- name: Prepare peers list
178+
run: |
179+
cat > peers.txt <<EOF
180+
/ip4/135.181.217.23/tcp/31881/p2p/12D3KooWL7TyJx6TZZVKqPKkjNXXovu4y7aRQaWEx3eaiY45Lqw8
181+
/ip4/135.181.217.23/tcp/30386/p2p/12D3KooWQywRHUxh4bjvPSDKbrY8GeUzeGgHxKbesrJYpgqvaicS
182+
/ip4/135.181.217.23/tcp/32272/p2p/12D3KooWA4Mcr2Kn6ivtqFxWcFdLxGW2gqdDVwS86kToUCYst2rj
183+
/ip4/135.181.217.23/tcp/32218/p2p/12D3KooWKWRfqG8QdkpAVY3xUzxndPBgj5WR6fxBNAJKSzek3URZ
184+
/ip4/135.181.217.23/tcp/30798/p2p/12D3KooWJXiYRpj1dCLPv2PMLyNTuWSgzavyKXyaVsmBRhnBVCNM
185+
/ip4/135.181.217.23/tcp/31631/p2p/12D3KooWNeaaS6wpPSa41qkxQWaeauDR51WCNnLUyd5CcjBBiNTq
186+
/ip4/135.181.217.23/tcp/30196/p2p/12D3KooWDdJEVxdrthmuBiEL2Yi6nnryo4UYxz1f98TiykyFBx7H
187+
/ip4/135.181.217.23/tcp/30790/p2p/12D3KooWN8wmWdivGuUG7fTkV34hihgC6RnrfygzbZCuaQceaiak
188+
/ip4/135.181.217.23/tcp/30070/p2p/12D3KooWNi6nauXV3bMtwkc3wqA7V79Um92muVJ5pKvC11wVo2xk
189+
EOF
190+
echo "::group::Peers for bottstrapping"
191+
cat peers.txt
192+
echo "::endgroup::"
193+
194+
- name: Bootstrap node
195+
run: |
196+
set -eu
197+
chmod +x ./openmina
198+
./openmina node --no-peers-discovery --peers $(cat peers.txt) |& tee run.log &
199+
PID=$!
200+
TIME=10
201+
SLEEP=10
202+
ATTEMPTS=$((TIME * 60 / SLEEP))
203+
while ! curl -fs localhost:3000/readyz; do
204+
ATTEMPTS=$((ATTEMPTS-1))
205+
if [ "${ATTEMPTS}" -eq 0 ]; then
206+
echo "::error::Cannot bootsrtap within $TIME minutes"
207+
exit 1
208+
fi
209+
sleep $SLEEP
210+
done
211+
echo "::notice::The node is bootstrapped"
212+
213+
- name: Upload run.log
214+
uses: actions/upload-artifact@v4
215+
with:
216+
name: bootstrap-log
217+
path: run.log
218+
if: ${{ failure() }}

.github/workflows/docker.yaml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ on:
33
workflow_dispatch: {}
44
push:
55
branches: [ main, develop ]
6+
tags: [ "*" ]
67
paths-ignore:
78
# - ".github/**"
89
- ".drone.yml"
910
- "helm/**"
1011
- "*.md"
1112
- "docs/**"
1213

13-
14-
1514
jobs:
16-
docker-build:
15+
build-openmina-node-image:
1716
runs-on: ubuntu-latest
1817
steps:
1918
- name: Git checkout
@@ -39,6 +38,9 @@ jobs:
3938
tags: |
4039
type=ref,event=branch
4140
type=sha,format=short
41+
type=semver,pattern={{version}},event=tag
42+
type=ref,event=tag
43+
type=raw,value=latest,enable={{is_default_branch}}
4244
4345
- name: Build and push
4446
uses: docker/build-push-action@v5
@@ -48,3 +50,44 @@ jobs:
4850
tags: ${{ steps.meta.outputs.tags }}
4951
cache-from: type=gha
5052
cache-to: type=gha,mode=max
53+
54+
build-openmina-frontend-image:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Git checkout
58+
uses: actions/checkout@v3
59+
60+
- name: Login to Docker Hub
61+
uses: docker/login-action@v3
62+
with:
63+
username: ${{ secrets.DOCKERHUB_USERNAME }}
64+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
65+
66+
- name: Set up Docker Buildx
67+
uses: docker/setup-buildx-action@v3
68+
69+
- name: Docker meta
70+
id: meta
71+
uses: docker/metadata-action@v5
72+
with:
73+
# list of Docker images to use as base name for tags
74+
images: |
75+
openmina/frontend
76+
# generate Docker tags based on the following events/attributes
77+
tags: |
78+
type=ref,event=branch
79+
type=sha,format=short
80+
type=semver,pattern={{version}},event=tag
81+
type=ref,event=tag
82+
type=raw,value=latest,enable={{is_default_branch}}
83+
84+
- name: Build and push
85+
uses: docker/build-push-action@v5
86+
with:
87+
context: ./frontend
88+
build-args: |
89+
BUILD_CONFIGURATION=compose
90+
push: true
91+
tags: ${{ steps.meta.outputs.tags }}
92+
cache-from: type=gha
93+
cache-to: type=gha,mode=max

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [0.3.1] - 2024-04-05
11+
12+
### Changed
13+
14+
- Internal improvements to the actions logging mechanism.
15+
16+
### Fixed
17+
18+
- Corrected sync stats for accounts fetching during ledger sync.
19+
- Pruning of kademlia streams and requests.
20+
21+
### Added
22+
23+
- Docker images tagged for each new release.
24+
- Bootstrap process testing on CI.
25+
1026
## [0.3.0] - 2024-03-29
1127

12-
### Changes
28+
### Changed
1329

1430
- **Rust Toolchain**: Updated the minimum required Rust toolchain to version 1.77.
1531
- **Networking**:
@@ -20,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2036
- **Frontend**:
2137
- **Mobile Compatibility**: Enhanced support for mobile platforms, improving user experience across various devices.
2238

23-
### Fixes
39+
### Fixed
2440

2541
- **Staged Ledger**: Resolved an issue where the ledger reconstruct step would block the state machine.
2642
- **Node Communication**: Fixed a bug where nodes did not respond to ledger queries from bootstrapping peers, enhancing network cooperation.
@@ -29,7 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2945
- **Backend**:
3046
- **HTTP RPC**: Corrected an error triggered when querying the `/state` endpoint.
3147

32-
### Additions
48+
### Added
3349

3450
- **Bootstrap Efficiency**:
3551
- **Ledger Synchronization**: Optimized the snarked ledger synchronization process during bootstrap, significantly reducing the time required.
@@ -86,7 +102,8 @@ First public release.
86102
- Alpha version of the node which can connect and syncup to the berkeleynet network, and keep applying new blocks to maintain consensus state and ledger up to date.
87103
- Web-based frontend for the node.
88104

89-
[Unreleased]: https://github.com/openmina/openmina/compare/v0.3.0...develop
105+
[Unreleased]: https://github.com/openmina/openmina/compare/v0.3.1...develop
106+
[0.3.1]: https://github.com/openmina/openmina/releases/tag/v0.3.0...v0.3.1
90107
[0.3.0]: https://github.com/openmina/openmina/releases/tag/v0.2.0...v0.3.0
91108
[0.2.0]: https://github.com/openmina/openmina/releases/tag/v0.1.0...v0.2.0
92109
[0.1.0]: https://github.com/openmina/openmina/releases/tag/v0.0.1...v0.1.0

0 commit comments

Comments
 (0)