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

Merge dev/katana branch #1697

Merged
merged 20 commits into from
Mar 26, 2024
Merged

Merge dev/katana branch #1697

merged 20 commits into from
Mar 26, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Mar 25, 2024

Merging katana development branch with breaking changes due to huge rework on katana-executor

kariy and others added 16 commits March 18, 2024 21:28
Both `blockifier` and `starknet_in_rust` use their own proprietary contract class types. So need to have a type where the types from those two crates can be derived from.
implement the executor traits introduced in #1561 based on `blockifier`
integrate the new executor traits introduced in #1561 to katana
- add tests for each executor's CachedState
- improve test in executor.rs
- fix sir not enough gas error
- fix test in simulate.rs
* chore: bump dependencies

* fix: update cairo-lang

* fix: add missing run_profiler

* fix: fmt

* update cairo-vm rev

* wip

* wip

* fmt

* fix: ensure semantics analyzer plugin is registered

* chore(katana): make ethers non optional since U256 is used outside messaging

* fix: run CAIRO_FIX_TESTS

* fix(dojo-core): remove compiler warnings

* git: add sozo generated bindings to gitignore

* fix: fix class hash

* fix: class hash generated code

* fix(dojo-core): fix tests and compilation warnings

* chore: integrate snos on cairo2.5

* chore: update Cargo.lock

* wip: work on integration of katana types

* wip: fetch strategy

* fix

* feat: add parsing of state diff for genesis block

* wip

* wip

* fix: rework provider for saya and RPC implem

* wip

* wip: snos types

* wip txs

* wip: fix snos parsing need to complete inputs

* chore: switch back to git snos

* chore: bump blockifier to use Serde on TransactionExecutionInfo

* feat: add saya RPC namespace

* feat: add transaction execution info to in memory db

* fix: remove unused code covered by other test

* fix: add logic for small requests to get transactions executions info

* fix: fetch transactions executions info instead of running blockifier

* fix: fmt and clippy

* docs: fix unused type

* fix: add tests for new transactions execution retrieval

* fix: add correct test to check no pending support

* fix: restore unchanged file

* fix: rename new provider trait to TransactionTraceProvider

* refactor(katana): change stored compiled class (#1559)

Both `blockifier` and `starknet_in_rust` use their own proprietary contract class types. So need to have a type where the types from those two crates can be derived from.

* refactor(katana-primitives): move class related types to a separate module (#1560)

* Katana executor traits (#1561)

* feat(katana-executor): add `blockifier` executor implementations (#1562)

implement the executor traits introduced in #1561 based on `blockifier`

* Refactor Katana to using the new executor traits (#1563)

integrate the new executor traits introduced in #1561 to katana

* feat(katana-executor): add starknet_in_rust executor (#1564)

* doc(katana-executor): add README

* test(katana-executor): add test for transaction simulation (#1593)

* test(katana-executor): refactor simulate tests (#1606)

refactor tests

* adjust new types for Katana blockchain and SNOS

* fix: clippy

* refactor(katana): change stored compiled class (#1559)

Both `blockifier` and `starknet_in_rust` use their own proprietary contract class types. So need to have a type where the types from those two crates can be derived from.

* refactor(katana-primitives): move class related types to a separate module (#1560)

* Katana executor traits (#1561)

* feat(katana-executor): add `blockifier` executor implementations (#1562)

implement the executor traits introduced in #1561 based on `blockifier`

* Refactor Katana to using the new executor traits (#1563)

integrate the new executor traits introduced in #1561 to katana

* feat(katana-executor): add starknet_in_rust executor (#1564)

* doc(katana-executor): add README

* test(katana-executor): add test for transaction simulation (#1593)

* test(katana-executor): refactor simulate tests (#1606)

refactor tests

* feat: add new primitive for trace and blockifier conversions

* feat: add TransactionExecutionInfo convert from blockifier

* feat: add executor trait method to retrieve the execution info

* fix: ensure tx execution info is passed in block producer

* chore: restore dependency on blockifier as we use TxExecInfo primitive

* refactor(katana): decouple `katana-primitives` from any executor impls (#1637)

* fix: clippy / fmt

* merge

* fix: clippy

---------

Co-authored-by: Kariy <[email protected]>
Co-authored-by: Ammar Arif <[email protected]>
@glihm
Copy link
Collaborator

glihm commented Mar 25, 2024

I didn't manage to have the CI passed, trying locally.

These are the issues I have on running the CI command for testing:

--- STDOUT:              katana-executor::executor sir::test_executor_with_valid_blocks ---

running 1 test
test sir::test_executor_with_valid_blocks ... FAILED

failures:

failures:
    sir::test_executor_with_valid_blocks

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 3.04s


--- STDERR:              katana-executor::executor sir::test_executor_with_valid_blocks ---
thread 'sir::test_executor_with_valid_blocks' panicked at /home/g2p/.cargo/git/checkouts/cairo_native-0bad8506281b7281/baf57d2/src/libfuncs.rs:299:51:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

   Canceling due to test failure: 11 tests still running
        PASS [   0.008s] katana-primitives event::test::parse_should_fail
        FAIL [   1.745s] katana-executor::simulate sir::test_simulate_tx::case_1_tx

--- STDOUT:              katana-executor::simulate sir::test_simulate_tx::case_1_tx ---

running 1 test
test sir::test_simulate_tx::case_1_tx ... FAILED

failures:

failures:
    sir::test_simulate_tx::case_1_tx

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 7 filtered out; finished in 1.72s


--- STDERR:              katana-executor::simulate sir::test_simulate_tx::case_1_tx ---
thread 'sir::test_simulate_tx::case_1_tx' panicked at /home/g2p/.cargo/git/checkouts/cairo_native-0bad8506281b7281/baf57d2/src/libfuncs.rs:299:51:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   3.523s] katana-executor::executor blockifier::test_executor_with_valid_blocks
        PASS [   0.531s] katana-primitives conversion::rpc::tests::legacy_rpc_to_inner_and_back
        PASS [   7.766s] dojo-lang semantics::tests::dojo_semantics::set
        FAIL [   1.989s] katana-executor::simulate sir::test_simulate_tx::case_3_tx_no_signature_skip_validate

--- STDOUT:              katana-executor::simulate sir::test_simulate_tx::case_3_tx_no_signature_skip_validate ---

running 1 test
test sir::test_simulate_tx::case_3_tx_no_signature_skip_validate ... FAILED

failures:

failures:
    sir::test_simulate_tx::case_3_tx_no_signature_skip_validate

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 7 filtered out; finished in 1.97s


--- STDERR:              katana-executor::simulate sir::test_simulate_tx::case_3_tx_no_signature_skip_validate ---
thread 'sir::test_simulate_tx::case_3_tx_no_signature_skip_validate' panicked at /home/g2p/.cargo/git/checkouts/cairo_native-0bad8506281b7281/baf57d2/src/libfuncs.rs:299:51:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   1.858s] katana-executor::simulate sir::test_simulate_tx::case_4_tx_no_signature
        FAIL [   2.037s] katana-executor::simulate sir::test_simulate_tx::case_2_tx_skip_validate

--- STDOUT:              katana-executor::simulate sir::test_simulate_tx::case_2_tx_skip_validate ---

running 1 test
test sir::test_simulate_tx::case_2_tx_skip_validate ... FAILED

failures:

failures:
    sir::test_simulate_tx::case_2_tx_skip_validate

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 7 filtered out; finished in 2.01s


--- STDERR:              katana-executor::simulate sir::test_simulate_tx::case_2_tx_skip_validate ---
thread 'sir::test_simulate_tx::case_2_tx_skip_validate' panicked at /home/g2p/.cargo/git/checkouts/cairo_native-0bad8506281b7281/baf57d2/src/libfuncs.rs:299:51:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

        PASS [   2.195s] katana-primitives conversion::rpc::tests::flattened_sierra_class_to_compiled_class
        PASS [  47.953s] dojo-world contracts::world::test::test_world_contract_reader
        PASS [  48.195s] dojo-world contracts::model::model_test::test_model
        FAIL [  48.256s] dojo-world manifest::test::fetch_remote_manifest

--- STDOUT:              dojo-world manifest::test::fetch_remote_manifest ---

running 1 test
test manifest::test::fetch_remote_manifest ... FAILED

failures:

failures:
    manifest::test::fetch_remote_manifest

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 17 filtered out; finished in 48.24s


--- STDERR:              dojo-world manifest::test::fetch_remote_manifest ---
thread 'manifest::test::fetch_remote_manifest' panicked at crates/dojo-world/src/manifest_test.rs:383:5:
assertion `left == right` failed
  left: 2
 right: 3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

------------
     Summary [  48.284s] 100/318 tests run: 95 passed, 5 failed, 1 skipped
        FAIL [  48.256s] dojo-world manifest::test::fetch_remote_manifest
        FAIL [   3.062s] katana-executor::executor sir::test_executor_with_valid_blocks
        FAIL [   1.745s] katana-executor::simulate sir::test_simulate_tx::case_1_tx
        FAIL [   2.037s] katana-executor::simulate sir::test_simulate_tx::case_2_tx_skip_validate
        FAIL [   1.989s] katana-executor::simulate sir::test_simulate_tx::case_3_tx_no_signature_skip_validate
error: test run failed

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 60.69029% with 1697 lines in your changes are missing coverage. Please review.

Project coverage is 62.33%. Comparing base (810b0f4) to head (0c67745).
Report is 3 commits behind head on main.

Files Patch % Lines
...es/katana/executor/src/implementation/sir/utils.rs 55.02% 273 Missing ⚠️
...na/executor/src/implementation/blockifier/utils.rs 63.31% 197 Missing ⚠️
crates/katana/rpc/rpc/src/starknet.rs 29.09% 156 Missing ⚠️
crates/saya/provider/src/rpc/transaction.rs 0.00% 132 Missing ⚠️
crates/katana/executor/src/implementation/noop.rs 17.75% 88 Missing ⚠️
crates/saya/provider/src/rpc/mod.rs 0.00% 88 Missing ⚠️
crates/katana/core/src/service/block_producer.rs 68.72% 76 Missing ⚠️
...na/executor/src/implementation/blockifier/state.rs 84.98% 68 Missing ⚠️
crates/katana/rpc/rpc-types/src/trace.rs 0.00% 58 Missing ⚠️
crates/katana/executor/src/abstraction/mod.rs 39.75% 50 Missing ⚠️
... and 44 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1697      +/-   ##
==========================================
- Coverage   68.09%   62.33%   -5.77%     
==========================================
  Files         273      295      +22     
  Lines       29509    33803    +4294     
==========================================
+ Hits        20095    21072     +977     
- Misses       9414    12731    +3317     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glihm glihm added the katana This issue is related to Katana label Mar 26, 2024
Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

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

Awesome work man. 🚀

Could you just open an issue or let somewhere a trace on why we have cairo native commented out for now? Thanks a lot mate.

@kariy kariy merged commit 5340720 into main Mar 26, 2024
10 of 12 checks passed
@kariy kariy deleted the dev/katana branch March 26, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
katana This issue is related to Katana
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants