Skip to content

Commit

Permalink
Merge pull request #378 from openmina/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `main`
  • Loading branch information
tizoc committed Apr 30, 2024
2 parents 6915ab3 + 3ea843d commit 44b3cfe
Show file tree
Hide file tree
Showing 326 changed files with 11,747 additions and 4,735 deletions.
97 changes: 66 additions & 31 deletions .github/workflows/ci.yaml
Expand Up @@ -35,6 +35,27 @@ jobs:
cd ledger
cargo test --release -- -Z unstable-options --report-time
p2p-tests:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Setup Rust
run: |
rustup default 1.77
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:
Expand All @@ -43,14 +64,13 @@ jobs:

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

- name: Release build
run: |
Expand All @@ -70,14 +90,13 @@ jobs:

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

- name: Build tests
run: |
Expand All @@ -88,55 +107,70 @@ 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/$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 Rust
run: |
rustup default 1.77
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
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@v4
with:
name: tests
path: tests.tar
name: tests-webrct
path: target/release/tests

p2p-tests:
p2p-scenario-tests:
needs: [ build-tests ]
runs-on: ubuntu-20.04
container:
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
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@v4
with:
name: tests

- name: Unpack tests
- name: Setup permissions
run: |
tar xf tests.tar ./${{ env.TEST }}
chmod +x ./${{ matrix.test }}
- name: Run the test
run: |
./${{ env.TEST }} --nocapture --test-threads=1
./${{ matrix.test }} --test-threads=1
scenario-tests:
needs: [ build-tests ]
if: false
needs: [ build-tests, build-tests-webrtc ]
runs-on: ubuntu-20.04
container:
image: minaprotocol/mina-daemon:2.0.0berkeley-rc1-1551e2f-focal-berkeley
Expand All @@ -154,15 +188,16 @@ jobs:
- name: Download tests
uses: actions/download-artifact@v4
with:
name: tests
pattern: tests*
merge-multiple: true

- name: Unpack tests
- name: Setup permissions
run: |
tar xf tests.tar ./${{ matrix.test }}
chmod +x ./${{ matrix.test }}
- name: Run the test
run: |
./${{ matrix.test }} --nocapture --test-threads=1
./${{ matrix.test }} --test-threads=1
bootstrap-test:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/rustfmt.yml → .github/workflows/lint.yml
@@ -1,22 +1,28 @@
name: rustfmt
name: lint

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

jobs:
rustfmt:
name: Rustfmt
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.77
components: rustfmt, clippy
default: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
name: rustfmt
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
name: clippy
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets -- -A clippy::too_many_arguments -A clippy::doc_markdown
22 changes: 21 additions & 1 deletion CHANGELOG.md
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0] - 2024-04-30

### Fixed

- Interactions with the ledger service are now async. This fixes situations in which expensive ledger operations could starve the state machine loop.
- Ledger synchronization issue that happens when synchronizing the node during the second epoch.
- Correctly handle the situation in which the best tip changes during staged ledger reconstruction, causing the reconstruct to produce a stale result.
- Various edge cases in p2p layer (error propagation, disconnection, self-connection).

### Added

- Support for `identify` protocol.
- P2P layer testing framework.
- Frontend: Block production page.

### Removed

- Removed rust-libp2p based code, in favor of our own libp2p implementation.

## [0.3.1] - 2024-04-05

### Changed
Expand Down Expand Up @@ -102,7 +121,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.1...develop
[Unreleased]: https://github.com/openmina/openmina/compare/v0.4.0...develop
[0.4.0]: https://github.com/openmina/openmina/releases/tag/v0.3.0...v0.4.0
[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
Expand Down

0 comments on commit 44b3cfe

Please sign in to comment.