Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move starknet settlement to zaun #125

Merged
merged 109 commits into from
Oct 5, 2024
Merged

move starknet settlement to zaun #125

merged 109 commits into from
Oct 5, 2024

Conversation

byteZorvin
Copy link
Member

  • Orchestrator now uses zaun types now to interact with starknet core contract.

@apoorvsadana apoorvsadana marked this pull request as draft September 26, 2024 04:30
@byteZorvin byteZorvin marked this pull request as ready for review September 28, 2024 06:39
@coveralls
Copy link

coveralls commented Oct 4, 2024

Coverage Status

coverage: 66.28% (+2.2%) from 64.061%
when pulling 4e68523 on zaun
into 7b85453 on main.

.env.example Outdated


##### STARKNET SETTLEMENT TEST #####
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
##### STARKNET SETTLEMENT TEST #####
##### STARKNET SETTLEMENT (L3s) #####

Comment on lines 83 to 84
repository: madara-alliance/madara # Replace with your first repository
ref: "0c821aecd1cafc516d00548473fcaddaa4dc0ce4" # Replace with your branch name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repository: madara-alliance/madara # Replace with your first repository
ref: "0c821aecd1cafc516d00548473fcaddaa4dc0ce4" # Replace with your branch name
repository: madara-alliance/madara
ref: "0c821aecd1cafc516d00548473fcaddaa4dc0ce4"

crates/settlement-clients/starknet/Cargo.toml Outdated Show resolved Hide resolved
@@ -197,11 +206,26 @@ impl SettlementClient for StarknetSettlementClient {
if block_number.is_empty() {
return Err(eyre!("Could not fetch last block number from core contract."));
}
Ok(block_number[0].try_into()?)

Ok(u64::from_le_bytes(block_number[0].to_bytes_le()[0..8].try_into().unwrap()))
}

/// Returns the nonce for the wallet in use.
async fn get_nonce(&self) -> Result<u64> {
todo!("Yet to impl nonce call for Starknet.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would ideally add a small test case for this :)

crates/settlement-clients/starknet/src/conversion.rs Outdated Show resolved Hide resolved
crates/settlement-clients/starknet/src/lib.rs Outdated Show resolved Hide resolved
node
}

async fn wait_for_tx_success(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending?

use utils::settings::Settings;

pub async fn spin_up_madara() -> MadaraCmd {
println!("Spinning up madara");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are some println! pending, can you check

@byteZorvin byteZorvin merged commit 60768cc into main Oct 5, 2024
9 checks passed
@byteZorvin byteZorvin deleted the zaun branch October 5, 2024 10:10
ocdbytes pushed a commit that referenced this pull request Oct 16, 2024
* 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 <95699312+apoorvsadana@users.noreply.github.com>

* resolve comments

* fix e2e test flow

* fix toml lint

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

Co-authored-by: Apoorv Sadana <95699312+apoorvsadana@users.noreply.github.com>

* 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 <95699312+apoorvsadana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants