Skip to content

Commit

Permalink
Merge pull request #337 from openmina/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `main`
  • Loading branch information
tizoc committed Apr 5, 2024
2 parents 68dd2bb + 7718c27 commit 6915ab3
Show file tree
Hide file tree
Showing 179 changed files with 3,438 additions and 2,952 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Expand Up @@ -304,7 +304,7 @@ steps:
DOCKER_BUILDKIT: "0"
commands:
- COMMIT_SHORT_SHA=$(echo $DRONE_COMMIT_SHA | cut -c 1-7)
- docker build --no-cache -t openmina/rust-fe:$COMMIT_SHORT_SHA -f Dockerfile_FE .
- docker build --no-cache -t openmina/frontend:$COMMIT_SHORT_SHA -f Dockerfile_FE .
volumes:
- name: docker_sock
path: /var/run/docker.sock
Expand All @@ -319,7 +319,7 @@ steps:
- build

- name: frontend-server
image: openmina/rust-fe:${DRONE_COMMIT_SHA:0:7}
image: openmina/frontend:${DRONE_COMMIT_SHA:0:7}
pull: if-not-exists
detach: true
privileged: true
Expand Down Expand Up @@ -449,7 +449,7 @@ steps:
image: docker:latest
commands:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- docker push openmina/rust-fe:${DRONE_COMMIT_SHA:0:7}
- docker push openmina/frontend:${DRONE_COMMIT_SHA:0:7}
volumes:
- name: docker_sock
path: /var/run/docker.sock
Expand Down
88 changes: 73 additions & 15 deletions .github/workflows/ci.yaml
Expand Up @@ -47,18 +47,6 @@ jobs:
rustup override set 1.77
rustup component add clippy rustfmt
# - name: Check
# uses: actions-rs/cargo@v1
# with:
# command: check

# - name: Clippy
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# # don't fail the job until clippy is fixed
# continue-on-error: true

- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -74,9 +62,26 @@ jobs:
name: bin
path: target/release/openmina

build-tests:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Setup Rust
run: |
rustup install 1.77
rustup override set 1.77
rustup component add clippy rustfmt
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "ver-0"

- name: Build tests
run: |
mkdir target/release/tests
mkdir -p target/release/tests
cargo build --release --features=scenario-generators --package=openmina-node-testing --tests
cargo build --release --features=scenario-generators --package=openmina-node-testing --tests --message-format=json > cargo-build-test.json
Expand All @@ -102,7 +107,7 @@ jobs:
path: tests.tar

p2p-tests:
needs: [ build ]
needs: [ build-tests ]
runs-on: ubuntu-20.04
container:
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
Expand Down Expand Up @@ -131,7 +136,7 @@ jobs:
./${{ env.TEST }} --nocapture --test-threads=1
scenario-tests:
needs: [ build ]
needs: [ build-tests ]
runs-on: ubuntu-20.04
container:
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
Expand All @@ -158,3 +163,56 @@ jobs:
- name: Run the test
run: |
./${{ matrix.test }} --nocapture --test-threads=1
bootstrap-test:
needs: [ build ]
runs-on: ubuntu-20.04
steps:
- name: Download binary
uses: actions/download-artifact@v4
with:
name: bin

- name: Prepare peers list
run: |
cat > peers.txt <<EOF
/ip4/135.181.217.23/tcp/31881/p2p/12D3KooWL7TyJx6TZZVKqPKkjNXXovu4y7aRQaWEx3eaiY45Lqw8
/ip4/135.181.217.23/tcp/30386/p2p/12D3KooWQywRHUxh4bjvPSDKbrY8GeUzeGgHxKbesrJYpgqvaicS
/ip4/135.181.217.23/tcp/32272/p2p/12D3KooWA4Mcr2Kn6ivtqFxWcFdLxGW2gqdDVwS86kToUCYst2rj
/ip4/135.181.217.23/tcp/32218/p2p/12D3KooWKWRfqG8QdkpAVY3xUzxndPBgj5WR6fxBNAJKSzek3URZ
/ip4/135.181.217.23/tcp/30798/p2p/12D3KooWJXiYRpj1dCLPv2PMLyNTuWSgzavyKXyaVsmBRhnBVCNM
/ip4/135.181.217.23/tcp/31631/p2p/12D3KooWNeaaS6wpPSa41qkxQWaeauDR51WCNnLUyd5CcjBBiNTq
/ip4/135.181.217.23/tcp/30196/p2p/12D3KooWDdJEVxdrthmuBiEL2Yi6nnryo4UYxz1f98TiykyFBx7H
/ip4/135.181.217.23/tcp/30790/p2p/12D3KooWN8wmWdivGuUG7fTkV34hihgC6RnrfygzbZCuaQceaiak
/ip4/135.181.217.23/tcp/30070/p2p/12D3KooWNi6nauXV3bMtwkc3wqA7V79Um92muVJ5pKvC11wVo2xk
EOF
echo "::group::Peers for bottstrapping"
cat peers.txt
echo "::endgroup::"
- name: Bootstrap node
run: |
set -eu
chmod +x ./openmina
./openmina node --no-peers-discovery --peers $(cat peers.txt) |& tee run.log &
PID=$!
TIME=10
SLEEP=10
ATTEMPTS=$((TIME * 60 / SLEEP))
while ! curl -fs localhost:3000/readyz; do
ATTEMPTS=$((ATTEMPTS-1))
if [ "${ATTEMPTS}" -eq 0 ]; then
echo "::error::Cannot bootsrtap within $TIME minutes"
exit 1
fi
sleep $SLEEP
done
echo "::notice::The node is bootstrapped"
- name: Upload run.log
uses: actions/upload-artifact@v4
with:
name: bootstrap-log
path: run.log
if: ${{ failure() }}
49 changes: 46 additions & 3 deletions .github/workflows/docker.yaml
Expand Up @@ -3,17 +3,16 @@ on:
workflow_dispatch: {}
push:
branches: [ main, develop ]
tags: [ "*" ]
paths-ignore:
# - ".github/**"
- ".drone.yml"
- "helm/**"
- "*.md"
- "docs/**"



jobs:
docker-build:
build-openmina-node-image:
runs-on: ubuntu-latest
steps:
- name: Git checkout
Expand All @@ -39,6 +38,9 @@ jobs:
tags: |
type=ref,event=branch
type=sha,format=short
type=semver,pattern={{version}},event=tag
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
Expand All @@ -48,3 +50,44 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

build-openmina-frontend-image:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
openmina/frontend
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=sha,format=short
type=semver,pattern={{version}},event=tag
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./frontend
build-args: |
BUILD_CONFIGURATION=compose
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
25 changes: 21 additions & 4 deletions CHANGELOG.md
Expand Up @@ -7,9 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.1] - 2024-04-05

### Changed

- Internal improvements to the actions logging mechanism.

### Fixed

- Corrected sync stats for accounts fetching during ledger sync.
- Pruning of kademlia streams and requests.

### Added

- Docker images tagged for each new release.
- Bootstrap process testing on CI.

## [0.3.0] - 2024-03-29

### Changes
### Changed

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

### Fixes
### Fixed

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

### Additions
### Added

- **Bootstrap Efficiency**:
- **Ledger Synchronization**: Optimized the snarked ledger synchronization process during bootstrap, significantly reducing the time required.
Expand Down Expand Up @@ -86,7 +102,8 @@ First public release.
- 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.
- Web-based frontend for the node.

[Unreleased]: https://github.com/openmina/openmina/compare/v0.3.0...develop
[Unreleased]: https://github.com/openmina/openmina/compare/v0.3.1...develop
[0.3.1]: https://github.com/openmina/openmina/releases/tag/v0.3.0...v0.3.1
[0.3.0]: https://github.com/openmina/openmina/releases/tag/v0.2.0...v0.3.0
[0.2.0]: https://github.com/openmina/openmina/releases/tag/v0.1.0...v0.2.0
[0.1.0]: https://github.com/openmina/openmina/releases/tag/v0.0.1...v0.1.0
Expand Down

0 comments on commit 6915ab3

Please sign in to comment.