Skip to content

Commit

Permalink
Merge branch 'main' into feat/retry-sign-transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
frolvanya authored Feb 2, 2025
2 parents 891f914 + 679d480 commit c55a50b
Show file tree
Hide file tree
Showing 70 changed files with 2,276 additions and 4,184 deletions.
2 changes: 1 addition & 1 deletion .catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ spec:
- ./near/omni-types/.catalog-info.yaml
- ./near/omni-bridge/.catalog-info.yaml
- ./near/omni-token/.catalog-info.yaml
- ./evm/bridge-token-factory/.catalog-info.yaml
- ./evm/.catalog-info.yaml
- ./omni-relayer/.catalog-info.yaml
- ./solana/bridge_token_factory/.catalog-info.yaml
2 changes: 1 addition & 1 deletion .github/workflows/build-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: matrix.platform == 'near' || matrix.platform == 'solana'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.80.0
toolchain: 1.84.0
target: wasm32-unknown-unknown

- name: Install NEAR CLI RS
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/check-wasm.yaml

This file was deleted.

44 changes: 20 additions & 24 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- 'near/**'
- 'omni-relayer/**'

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -25,18 +29,17 @@ jobs:
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.80.0
toolchain: 1.84.0
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
shared-key: "lint-${{ matrix.component }}"
workspaces: ${{ matrix.component }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.7

- name: Install cargo-near
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Run clippy
run: make clippy-${{ matrix.component }}

Expand All @@ -52,27 +55,20 @@ jobs:
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.80.0
toolchain: 1.84.0
target: wasm32-unknown-unknown

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
shared-key: "build-test"
workspaces: near
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.7

- name: Install cargo-near
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: nextest

- name: Build token contract
run: make rust-build-near

- name: Build tests
run: cargo build --manifest-path ./near/Cargo.toml --tests --all-features

- name: Run tests
run: cargo nextest run --manifest-path ./near/Cargo.toml
- name: Rust tests
run: make rust-run-tests
39 changes: 39 additions & 0 deletions .github/workflows/update-contracts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
tags:
- '*'

workflow_dispatch:

name: Update Contracts
jobs:
update-contracts:
runs-on: ubuntu-latest
name: Update Contracts
permissions:
contents: write
steps:
- name: Clone the repository
uses: actions/checkout@v3

- name: Install cargo-near
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- name: Build NEAR contracts
run: |
make rust-build-near
timeout-minutes: 60

- name: Archive built WASM files
run: |
mkdir -p artifacts
find ./near/target/near -name "*.wasm" -exec cp {} artifacts/ \;
zip -j contracts.zip artifacts/*.wasm
shell: bash

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: contracts.zip
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
**/.env
.history
node_modules
near/res/mock_token.wasm
near/res/mock_prover.wasm
near/res/omni_tests.wasm
54 changes: 43 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
.PHONY: rust-lint rust-lint-near rust-lint-omni-relayer

MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

OUT_DIR ?= $(MAKEFILE_DIR)/near/target/near

LINT_OPTIONS = -D warnings -D clippy::pedantic -A clippy::missing_errors_doc -A clippy::must_use_candidate -A clippy::module_name_repetitions
RUSTFLAGS = -C link-arg=-s

NEAR_MANIFEST = ./near/Cargo.toml
OMNI_RELAYER_MANIFEST = ./omni-relayer/Cargo.toml
NEAR_MANIFEST := $(MAKEFILE_DIR)/near/Cargo.toml
OMNI_BRIDGE_MANIFEST := $(MAKEFILE_DIR)/near/omni-bridge/Cargo.toml
OMNI_TOKEN_MANIFEST := $(MAKEFILE_DIR)/near/omni-token/Cargo.toml
TOKEN_DEPLOYER := $(MAKEFILE_DIR)/near/token-deployer/Cargo.toml
OMNI_PROVER_MANIFEST := $(MAKEFILE_DIR)/near/omni-prover/omni-prover/Cargo.toml
EVM_PROVER_MANIFEST := $(MAKEFILE_DIR)/near/omni-prover/evm-prover/Cargo.toml
WORMHOLE_OMNI_PROVER_PROXY_MANIFEST := $(MAKEFILE_DIR)/near/omni-prover/wormhole-omni-prover-proxy/Cargo.toml
MOCK_PROVER_MANIFEST := $(MAKEFILE_DIR)/near/mock/mock-prover/Cargo.toml
MOCK_TOKEN_MANIFEST := $(MAKEFILE_DIR)/near/mock/mock-token/Cargo.toml

OMNI_RELAYER_MANIFEST := $(MAKEFILE_DIR)/omni-relayer/Cargo.toml

clippy: clippy-near clippy-omni-relayer

clippy-near: rust-build-token
clippy-near:
cargo clippy --manifest-path $(NEAR_MANIFEST) -- $(LINT_OPTIONS)

fmt-near:
Expand All @@ -20,11 +32,31 @@ fmt-omni-relayer:
clippy-omni-relayer:
cargo clippy --manifest-path $(OMNI_RELAYER_MANIFEST) -- $(LINT_OPTIONS)

rust-build-token:
RUSTFLAGS='$(RUSTFLAGS)' cargo build --target wasm32-unknown-unknown --release --manifest-path $(NEAR_MANIFEST) --package omni-token

rust-build-near: rust-build-token
RUSTFLAGS='$(RUSTFLAGS)' cargo build --target wasm32-unknown-unknown --release --manifest-path $(NEAR_MANIFEST)

test-near: rust-build-near
rust-build-omni-bridge:
cargo near build reproducible-wasm --manifest-path $(OMNI_BRIDGE_MANIFEST) --out-dir $(OUT_DIR)

rust-build-omni-token:
cargo near build reproducible-wasm --manifest-path $(OMNI_TOKEN_MANIFEST) --out-dir $(OUT_DIR)

rust-build-token-deployer:
cargo near build reproducible-wasm --manifest-path $(TOKEN_DEPLOYER) --out-dir $(OUT_DIR)

rust-build-omni-prover:
cargo near build reproducible-wasm --manifest-path $(OMNI_PROVER_MANIFEST) --out-dir $(OUT_DIR)

rust-build-evm-prover:
cargo near build reproducible-wasm --manifest-path $(EVM_PROVER_MANIFEST) --out-dir $(OUT_DIR)

rust-build-wormhole-omni-prover-proxy:
cargo near build reproducible-wasm --manifest-path $(WORMHOLE_OMNI_PROVER_PROXY_MANIFEST) --out-dir $(OUT_DIR)

rust-build-mock-prover:
cargo near build reproducible-wasm --manifest-path $(MOCK_PROVER_MANIFEST) --out-dir $(OUT_DIR)

rust-build-mock-token:
cargo near build reproducible-wasm --manifest-path $(MOCK_TOKEN_MANIFEST) --out-dir $(OUT_DIR)

rust-build-near: rust-build-omni-bridge rust-build-omni-token rust-build-token-deployer rust-build-omni-prover rust-build-evm-prover rust-build-wormhole-omni-prover-proxy rust-build-mock-prover rust-build-mock-token

rust-run-tests:
cargo nextest run --manifest-path $(NEAR_MANIFEST)
13 changes: 13 additions & 0 deletions evm/.catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: omni-evm-bridge-token-factory
tags:
- ethereum
links: []
annotations:
aurora.dev/security-tier: "1"
spec:
owner: nearone-team
type: contract
lifecycle: production
Loading

0 comments on commit c55a50b

Please sign in to comment.