Skip to content

Commit

Permalink
move starknet settlement to zaun (#125)
Browse files Browse the repository at this point in the history
* update dependencies

* update imports

* updated changelog

* added testcase for bytes conversion

* fix clippy error

* use zaun for starknet

* add simple test for settlement

* add sepolia issue

* to be fixed: validation error

* add madara update state test

* use relative path

* add ci for settlement client

* fix workflow debug

* fix workflow debug

* add scarb build

* ignore flaky test

* fix threads issue

* add scarb build for madara

* check if tool version present

* fix workflow debug

* fix workflwo

* fix directory

* should fix it

* fix bash command

* fix bash command

* make scarb installation separate step

* use swm action

* fix ci path

* lint fixed

* fix env path for tests

* fix lint

* remove extra path

* try checking structure

* check

* fix env path

* fix the directory

* try go into

* fix path

* remove working directory

* final fix

* fix: gets triggered multiple times

* fix path

* fix prettier

* change calldata type to (#133)

* update workflow

* fix lints

* Update crates/settlement-clients/starknet/src/tests/test.rs

Co-authored-by: Apoorv Sadana <[email protected]>

* resolve comments

* fix e2e test flow

* fix toml lint

* Update crates/settlement-clients/starknet/src/tests/test.rs

Co-authored-by: Apoorv Sadana <[email protected]>

* changed envs

* add conversion function and test

* remove redundant test

* update workflow commit hash

* change commit and add prettierignore

* nonce implementaion and optimise code

* remove coverage bin env

* changed to logs

* added preset file

* update versioned constants path

* fix current_path

* should do inplace replacement

* fix base path

* fix final coverage workflow

* update preset

* change runner

* install dependencies

* run linter

* remove path

* reword

* change default rust

* rerun

* install libclang

* install more dependencies

* install yq

* install via snap

* install snap first

* add y flag

* no y flag

* enable snapd service

* use gh action for yq

* yq action

* remove working-directory

* check env variable

* fix ci

* remove override in e2e

* dotenvy::from_filename

* should also build

* env override

* ignore flaky test

* restart ci

* enable cargo build

* override in starknet client

* only starknet

* retry running

* test settle should work

* remove fail fast

* update blocktime

* change commit

* run all tests

* resolve comments

* added test for get nonce

* remove log

---------

Co-authored-by: Apoorv Sadana <[email protected]>
  • Loading branch information
byteZorvin and apoorvsadana authored Oct 5, 2024
1 parent 7b85453 commit 60768cc
Show file tree
Hide file tree
Showing 38 changed files with 3,098 additions and 210 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ PRIVATE_KEY=
ETHEREUM_PRIVATE_KEY=
STARKNET_SOLIDITY_CORE_CONTRACT_ADDRESS=

##### STARKNET SETTLEMENT (L3s) #####
STARKNET_PRIVATE_KEY=
STARKNET_ACCOUNT_ADDRESS=

##### Instrumentation #####
OTEL_SERVICE_NAME=
OTEL_COLLECTOR_ENDPOINT=
TRACING_LEVEL=
TRACING_LEVEL=
8 changes: 7 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ TEST_DUMMY_CONTRACT_ADDRESS="0xE5b6F5e695BA6E4aeD92B68c4CC8Df1160D69A81"
STARKNET_OPERATOR_ADDRESS="0x2C169DFe5fBbA12957Bdd0Ba47d9CEDbFE260CA7"
ETHEREUM_BLAST_RPC_URL="https://eth-mainnet.public.blastapi.io"


##### STARKNET SETTLEMENT TEST #####
STARKNET_PRIVATE_KEY=0x76f2ccdb23f29bc7b69278e947c01c6160a31cf02c19d06d0f6e5ab1d768b86
STARKNET_ACCOUNT_ADDRESS=0x3bb306a004034dba19e6cf7b161e7a4fef64bc1078419e8ad1876192f0b8cd1
MADARA_BINARY_PATH="/path/to/madara"

## Instrumentation
OTEL_SERVICE_NAME="madara_orchestrator"
OTEL_COLLECTOR_ENDPOINT=""
TRACING_LEVEL="info"
TRACING_LEVEL="info"
38 changes: 35 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
coverage:
runs-on: ubuntu-latest
runs-on: karnot-arc-runner-set

services:
localstack:
Expand All @@ -30,14 +30,18 @@ jobs:

# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- run: rustup show
- name: Install necessary dependencies
run: |
sudo apt update
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler gcc g++ build-essential libssl-dev pkg-config curl wget git libclang-dev
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
default: true

- name: Rust Cache
uses: Swatinem/rust-cache@v2
Expand All @@ -62,14 +66,42 @@ jobs:
- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Setup scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.2"

- name: Build Mock Contracts using Scarb
run: |
cd crates/settlement-clients/starknet/src/tests/mock_contracts
scarb fmt --check
scarb build
- name: Checkout Madara
uses: actions/checkout@v4
with:
repository: madara-alliance/madara
ref: "0c821aecd1cafc516d00548473fcaddaa4dc0ce4"
path: madara

- name: Build Madara
working-directory: madara
run: |
cargo build
mv target/debug/madara ../madara-binary
cd ..
echo -e "
MADARA_BINARY_PATH=\"$(pwd)/madara-binary\"" >> .env.test
cat .env.test
- name: Getting neccesary files for testing
run: |
wget -P ./crates/prover-services/sharp-service/tests/artifacts https://madara-orchestrator-sharp-pie.s3.amazonaws.com/238996-SN.zip
- name: Run llvm-cov tests
env:
ETHEREUM_BLAST_RPC_URL: ${{ secrets.ETHEREUM_BLAST_RPC_URL }}
run: RUST_LOG=debug RUST_BACKTRACE=1 cargo llvm-cov nextest --release --features testing --lcov --output-path lcov.info --test-threads=1 --workspace --exclude=e2e-tests
run: RUST_LOG=debug RUST_BACKTRACE=1 cargo llvm-cov nextest --release --features testing --lcov --output-path lcov.info --test-threads=1 --workspace --exclude=e2e-tests --no-fail-fast

- name: Coveralls
uses: coverallsapp/github-action@v2
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.code-workspace
.vscode


lcov.info

**/*-SN.zip
**/*-SN.zip
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dashboards
target/
dashboards
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## Changed

- Bumped dependencies, and associated api changes done
- ethereum DA client builder
- AWS config built from TestConfigBuilder.
- Better TestConfigBuilder, with sync config clients.
Expand Down
Loading

0 comments on commit 60768cc

Please sign in to comment.