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

Sync with main branch #2

Merged
merged 98 commits into from
May 27, 2024
Merged

Sync with main branch #2

merged 98 commits into from
May 27, 2024

Conversation

fishseabowl
Copy link
Owner

Description

Related issue

Tests

  • Yes
  • No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed

Checklist

  • I've formatted my code (scripts/prettier.sh, scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

kariy and others added 30 commits April 19, 2024 08:20
…hash is default value (dojoengine#1850)

* invalidate default value in cache

* more comment

* invalidate at local storage level as well
* Updated imports

* Filled in default values for rpc, torii and relay

* Removed invalid older setter

* Fixed incorrectly setting relayUrl

* Updated test

---------

Co-authored-by: glihm <[email protected]>
* sozo keystore, sozo account

* STARKNET_POLL_INTERVAL default 5000 -> 1000

* Prompt password instead of error

* Remove num-bigint dependency

* Mention starkli license in sozo README

* Remove dead code

* Add dojo-utils crate

* Revert "Add dojo-utils crate"

This reverts commit 43a1f6e.

* Use TransactionWaiter

* Remove unwraps

* Add sozo account fetch

* Add keystore tests

* Add account tests

* Remove test_account_deploy

* output -> file

* add --no-confirmation flag and refactor deploy function

* fix typo

* add `no_wait` for test

---------

Co-authored-by: lambda-0x <[email protected]>
…ojoengine#1853)

* fix(ci): exit with non-zero status code if any function call fails

* fix: clippy lints

* fix: more clippy lints
…ers (dojoengine#1852)

* fix: ensure transaction executions are stored with fork and db providers

* feat: add implementation for TxExecutions into mdbx

* fix: ensure tests now include TxExecInfo and add missing implementations

* tests: add empty block testing

* fix: rename TxExecutions to TxTraces

* fix: use consistent naming to access tables

* fix: use 0 as default transaction hash for empty testing

* fix: enhance readability of iter with zip

* fix: use `Range` implementation

Co-authored-by: Ammar Arif <[email protected]>

---------

Co-authored-by: Ammar Arif <[email protected]>
* feat(grpc): client event messages

* feat: add event messages to torii client

* fmt

* feat: fix event message request

* chore: types

* chors:subscription

* refactor: remove event messages types
…ace (dojoengine#1862)

fix event/messages using wrong `from_address` value. 

we use the contract address (or storage address on blockifier types) for the current call execution context as the `from_address`. `caller_address` will be zero if the call is a top level call (ie the first call in the transaction)

ref dojoengine#1279
…1863)

add test for tx execution info conversion from `blockifier` type to `katana-primitives` counterpart.
* fix: ensure correct subdmodule path and rev for solidity forge-std

* fix: adjust messaging guide for L1-L2 messaging

* fix: adjust messaging guide for L1-L3 messaging
* feat: add raw max fee to

* chore: change field to max_fee_raw

* chore: update field name

* chore: remove long help message for max-raw-fee

* chore: add implementation for max_fee_raw

* add clap restriction and comment

---------

Co-authored-by: lambda-0x <[email protected]>
bump database version to `1` for the next release due to breaking changes introduced in dojoengine#1773, dojoengine#1774, dojoengine#1775
* feat: spawn event message service

* fmt

* refactor: grpc event message subscriptions and queries

* refactor: global consts

* fmt
* feat: enable global flag for TransactionOptions

* set global flag on all options

* remove short from args
…ngine#1848)

* refactor: move `load_world_manifest` to utils

* add class_hash suffix

* refactor: clean up MigrateArgs

* fix: enforce seed matches the provided world_address

* refactor: print chain_id inside `setup_env` instead of passing it around

* move functions to migrate.rs

* refactor: some function names

* refactor!: don't mutate `MigrationStrategy` use the `MigrationOutput` instead

* move update_manifests_and_abi function to migration

* refactor: make `name/seed` non optional

* remove duplicate test file

* add test for seed issue

* fix clippy lints

* fix formatting

* make suggested improvements

* fix err string in test

* fix formatting

---------

Co-authored-by: glihm <[email protected]>
* Bump alloy to 0.7.0

* fix clippy
* fix: updates bug. use own eventmessage type for broker

* fmt
* feat: process pending block

* err

* feat: process pending block with cursor

* feat: update head

* refactor: tx cursor use hash

* refactor; migration

* feat: optimized sync range with events pages & dedup logic

* feat: correct logic

* fix: skipping

* fix: test

* fix

* refactor: dedup into for loop

* refactor: dont error out if no p[ending block

* fix: pending indexing inf loop

* refactor: pending transaction fetch error feedback

* fmt

* chore: clippy

* refactor: migrations

* refacort: simplify migrations

* chore: cleanup code
* CI: add workflow_dispatch for devcontainer.yml

* CI: add docker tag as input for manual dispatch of devcontainer
…oengine#1894)

* put schema module under `client` feature

* dont use client error in schema module
lambda-0x and others added 29 commits May 16, 2024 14:03
* fix: remove max_bytecode_size limitation

* fix: stale error message

* remove limitation from katana too
…#1939)

* bump versions of starknet and cainome

* use rev instead of tag for cainome version

* bump more libraries

* bump reqwest

* bump futures-util

* move more dependencies to workspace and bump where possible

* more updates
* fix: add more logic on semver check of Starknet API

* fix: use matches functionality from semver crate

* fix: fix typo
# Description

Test utilities for when we need to instantiate the providers with predefined initial states that are useful for testing/benchmarking purposes.

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [x] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [ ] [Dojo Book](https://github.com/dojoengine/book)
- [x] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [x] I've commented my code
- [ ] I've requested a review after addressing the comments
…e function (dojoengine#1968)

# Description

put all the logic that is required for every tx execution (ie building the receipt, exec info, etc) into a single unit of execution (ie `transact`). 

this allow us to simplify testing/benchmarking tx execution, bcs all the necessary steps are now included in a single function that we can easily test, without having to create the entire `BlockExecutor` trait.

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [x] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [ ] [Dojo Book](https://github.com/dojoengine/book)
- [x] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [ ] I've commented my code
- [ ] I've requested a review after addressing the comments
# Description

a simple benchmark for the smallest unit of execution that. we use the `pprof` profiler to output a flamegraph.

we can later extend this to `sir` once we have it re-enabled it.

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [x] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [ ] [Dojo Book](https://github.com/dojoengine/book)
- [x] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [x] I've commented my code
- [ ] I've requested a review after addressing the comments
* draft

* world_addres and contract_address print

* fix

* s

* fix

* world_addres and contract_address print

* fix

* fix

* formatting

* fix implementation and clean up

* revert cargo.lock changes

* clippy lints

* fix CI

* restore unnecessary changes

---------

Co-authored-by: Steven <[email protected]>
Co-authored-by: lambda-0x <[email protected]>
remove unused sozo dep in `katana-runner` crate
… w/o affecting the actual class hash (dojoengine#1975)

* resolving issue dojoengine#1502

* run clippy

* create custom deserializer

* Fills up name_classes HashMap after hash classes computation

* stuff

---------

Co-authored-by: Ammar Arif <[email protected]>
…mplicity (dojoengine#1986)

# Description

currently, the `saya_getTransactionsExecutions` API is based on a cursor to determine how the traces are being fetched. 

https://github.com/dojoengine/dojo/blob/855da3112c87faea87646db5a406ac77b4daf149/crates/saya/provider/src/rpc/mod.rs#L160-L175

one issue it currently has it that the api params does not put any constraint on whether the returned traces are guarantee to only be from a specific block. however, the implementation seems to indicate otherwise.

anyway, this pr basically want to remove the complexity of the pagination logic (which we dont even need!) and to replace it with a basic `get Xs from block Y` api instead.


so we can simplify the endpoint itself to just return the traces per block instead of based on a cursor. the cursor is only adding more complexity to the api itself.

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [ ] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [x] [Dojo Book](https://github.com/dojoengine/book)
- [ ] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [x] I've commented my code
- [ ] I've requested a review after addressing the comments
# Description

basically refactor the tx traces fetching logic to using the new API introduced in dojoengine#1986.

ref: dojoengine#1986 (comment) 

to simplify the process of extracting the l1 -> l2 messages bcs currently we have to compute the message hash in order to find the corresponding tx as seen here:

https://github.com/dojoengine/dojo/blob/855da3112c87faea87646db5a406ac77b4daf149/crates/saya/core/src/prover/program_input.rs#L54-L74

these changes (including dojoengine#1986) make the process more straightforward as we can just filter based on the tx hash which is more straightforward.

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [x] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [ ] [Dojo Book](https://github.com/dojoengine/book)
- [x] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [x] I've commented my code
- [ ] I've requested a review after addressing the comments
# Description

<!--
A description of what this PR is solving.
-->

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [x] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [ ] [Dojo Book](https://github.com/dojoengine/book)
- [x] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [ ] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [x] I've commented my code
- [ ] I've requested a review after addressing the comments
# Description

l1 -> l2 messaging should be using a different hash computation, but instead we were using the hash computation for l2 -> l1 message.

this pr adds a new `compute_l1_to_l2_message_hash` function for computing the hash of a l1 -> l2 message.

ref : https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/messaging-mechanism/#l1-l2-messages

## Related issue

<!--
Please link related issues: Fixes #<issue_number>
More info: https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Tests

<!--
Please refer to the CONTRIBUTING.md file to know more about the testing process. Ensure you've tested at least the package you're modifying if running all the tests consumes too much memory on your system.
-->

- [ ] Yes
- [ ] No, because they aren't needed
- [ ] No, because I need help

## Added to documentation?

<!--
If the changes are small, code comments are enough, otherwise, the documentation is needed. It
may be a README.md file added to your module/package, a DojoBook PR or both.
-->

- [ ] README.md
- [ ] [Dojo Book](https://github.com/dojoengine/book)
- [x] No documentation needed

## Checklist

- [x] I've formatted my code (`scripts/prettier.sh`, `scripts/rust_fmt.sh`, `scripts/cairo_fmt.sh`)
- [x] I've linted my code (`scripts/clippy.sh`, `scripts/docs.sh`)
- [x] I've commented my code
- [ ] I've requested a review after addressing the comments
* Use name hash for model identifiers

* Dojo layout rework

* support nested tuple/array/bytearray

* new Layout::Enum to support enum with different variant data

* merge from storage-layout branch

* cleaning

* support direct array/span introspect instead of generating it during code compilation

* fix Copy trait implementation for Array<u64>

* generate the model/field selector value instead of selector!(...)

* feat: start implementing new layout on torii wip

* update: cainome for serde & serialize layout

* feat: handle bytearray in ty

* feat: add new layout types (tuple/array/bytearray) to types & grpc

* fix: gql

* fix: model id for processors

* featr: start handling sql new tytpes

* feat: make tuple and bytearray work

* feat: store set record for tuples

* feat: start working on array

* feat: set support for bytearray & tuples

* feat: primitive arrays working

* feat: complex array types

* feat: start work on graphql for arrays

* fix: tuples for graphql

* fix: sanitize member type names gql

* feat: remove tuple from scalar types

* chore: fetch row by idx

* feat: add new type data for array

* feat: add updated_at for entity models data

* feat: start handle array type datalogic

* refactor: use list typedata

* refactor: modela data recursive

* feat: get list with new type data correctly

* feat: finished array support with nested types ✨

* fix: schema

* feat: torii packing

* integrates scarb nightly (dojoengine#1971)

wip with scarb nightly

* fix: fmt + regenerate world bindings

* fix: remove serialization workaround

* fix: remove cairo warnings for build

* Storage layout improvement (dojoengine#1965)

* Finalize the storage layout rework

- As the type recursion issue was fixed by Starkware, Layout/FieldLayout
  can be simplified.
- Update introspect size() and ty() methods
- Remove old model layout parsing in model.rs
- Split and reorganize introspect.rs code

* fix fmt+clippy

* update ABI binding

* fix cairo fmt

* feat: new parse schema function using cainome for model

* feat: complex enum supported ✨

* chore: bump blockifier and patch deps to use scarb nightly

* fix: run CAIRO_FIX tests and rebuild artifacts

* fix: use Tricks for dojo language server

* fix: remove async for language server

* wip: fix tests

* feat: add union type data for enums

* feat: continue work on type unions for enums

* feat: refactor complex enums

* feat: completely switch to using nested types for enums

* fmt

* clippy

* chore

* Automatically add Introspect derive attribute for Dojo models (dojoengine#1982)

* Automatically add Introspect derive attribute for Dojo models

* fix fmt+clippy

* fix warning about trait path in Impl

* update dojo-lang tests

* fix dojo-lang system

* fix dojo-world model test

* fix option<T> introspect

* fix: ensure all models are correctly derived

---------

Co-authored-by: glihm <[email protected]>

* fix: adjust tests with missing model

* wip: auth tests debug

* fix: ensure auth is using selector

* fix: fix some tests

* fix: models tests enum

* fix: other tests

* chore: tuple for u256

* refactor: u256 struct

* feat: simple enum types non nested + fix texts

* fmt

* fix: filtering by enum type name

* chore: clippy

* fmt

* fix: sql test

* refactor: packed size in tests &  simply functions

* fix: switch back u256 to primitive

* feat: use correct primitive u256 type & filtering

* wip

* chore: subscription test

* migration clippy

* wip

* feat: add new example with more types

* fix: strip enum variant type inf

* fix: nested tuples

* chore

* chore: remove debug logs

* fix: fix tests with new model

* fix: add missing manifests

* fix: fix cairo fmt

* fix: arrays

* fix: add tests and enhance error messages

* fix: fix build test and disable typescript for now

* fix: avoid race on manifest file for sql test

* feat: refactor schema deser from db & handle nested arrays

* chore: delete array elements on update

* fmt

* feat: add sozo prefix parsing for calldata

* fix: ensure migration for sql test waits for transactions

* fix: ensure build test works on a copy project

* fix: add missing transaction wait

* temp-fix: arrays

---------

Co-authored-by: Tarrence van As <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: glihm <[email protected]>
* fix: path to Argent account compiled contracts in declare script

* fix: allow some headers in CORS layer of Katana to work with ArgentX wallet

* refactor: clean forgotten logs in declare-argent-account.sh script and remove unnecessary var

* fix: remove vec in favor of array

---------

Co-authored-by: glihm <[email protected]>
* unified cairo crate forr katana

* update

* remove license file field
docs: update error message for more context
@fishseabowl fishseabowl merged commit 89316a7 into 1466_non_state May 27, 2024
3 of 11 checks passed
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.