Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
ref:
description: 'The reference (branch/tag/commit) to build'
required: false

jobs:
docker-release:
name: Release docker images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref || github.ref }}

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

- name: Install cross
if: runner.os == 'Linux'
# cross don't publish tags, so using commit hash instead
run: cargo install cross --git https://github.com/cross-rs/cross --rev 7b24b6e9f6834a3ac31d3dad1e2ff24c1b66f7cf

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Build & push docker images
run: |
make docker
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lean_client/target/*
lean_client/tests/mainnet
lean_client/bin
target/*
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
.PHONY: build format check-format test

all:
$(MAKE) -C lean_client all

.PHONY: build
build:
$(MAKE) -C lean_client build

.PHONY: format
format:
$(MAKE) -C lean_client format

.PHONY: check-format
check-format:
$(MAKE) -C lean_client check-format

.PHONY: test
test:
$(MAKE) -C lean_client test

.PHONY: docker
docker:
$(MAKE) -C lean_client docker

.PHONY: release
release:
$(MAKE) -C lean_client release
7 changes: 7 additions & 0 deletions lean_client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:22.04

ARG TARGETARCH

COPY ./bin/$TARGETARCH/lean_client /usr/local/bin/lean_client

ENTRYPOINT ["lean_client"]
43 changes: 38 additions & 5 deletions lean_client/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
.PHONY: build format check-format test

all: build check-format test

build:
cargo build --release

.PHONY: format
format:
cargo fmt

.PHONY: check-format
check-format:
cargo fmt --check

.PHONY: test
test:
cargo test --workspace --all-features --no-fail-fast

.PHONY: build
build:
cargo build --release

.PHONY: x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnu: ./target/x86_64-unknown-linux-gnu/release/lean_client

./target/x86_64-unknown-linux-gnu/release/lean_client:
cross build --bin lean_client --target x86_64-unknown-linux-gnu --profile release

.PHONY: aarch64-unknown-linux-gnu
aarch64-unknown-linux-gnu: ./target/aarch64-unknown-linux-gnu/release/lean_client

./target/aarch64-unknown-linux-gnu/release/lean_client:
cross build --bin lean_client --target aarch64-unknown-linux-gnu --profile release

DOCKER_REPO ?= sifrai/lean
DOCKER_TAG ?= unstable

.PHONY: release
release: docker

.PHONY: docker
docker: ./target/x86_64-unknown-linux-gnu/release/lean_client ./target/aarch64-unknown-linux-gnu/release/lean_client
@mkdir -p ./bin/amd64
@cp ./target/x86_64-unknown-linux-gnu/release/lean_client ./bin/amd64/lean_client
@mkdir -p ./bin/arm64
@cp ./target/aarch64-unknown-linux-gnu/release/lean_client ./bin/arm64/lean_client
docker buildx build \
--file Dockerfile \
--platform linux/amd64,linux/arm64 \
--tag $(DOCKER_REPO):$(DOCKER_TAG) \
--push \
.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ use super::runner::TestRunner;
// Without xmss-verify feature, they pass because structural validation succeeds.

#[test]
#[ignore = "TODO"]
fn test_proposer_signature() {
let test_path = "../tests/test_vectors/test_verify_signatures/test_valid_signatures/test_proposer_signature.json";
TestRunner::run_verify_signatures_test(test_path).expect("test_proposer_signature failed");
}

#[test]
#[ignore = "TODO"]
fn test_proposer_and_attester_signatures() {
let test_path = "../tests/test_vectors/test_verify_signatures/test_valid_signatures/test_proposer_and_attester_signatures.json";
TestRunner::run_verify_signatures_test(test_path)
Expand Down
4 changes: 3 additions & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[toolchain]
channel = "1.92"
channel = '1.92'
profile = 'minimal'
components = ['clippy', 'rustfmt']