Skip to content

Releases: dojoengine/dojo

v0.7.0

14 Jun 03:38
Compare
Choose a tag to compare

Notable changes

  1. Stabilizing the toolchain components to support the new types, mainly on Torii database and subscriptions.
  2. Bug fix that prevented Torii client to work with gRPC on Firefox and Safari.
  3. ⚠️ BREAKING ⚠️ Enforce the use of world injection in both dojo interfaces and systems implementations. Also, the ABI generated for the Dojo contract will output the correct state mutability of the systems depending on if ref world: IWorldDispatcher or world: @IWorldDispatcher is injected. You can find an example in the repo where both the interface and the implementation injects the world to generate an external function (most systems will be external).
  4. You can now skip the migration of some contracts based on the profile.
  5. Saya scheduler is integrated to the toolchain.

Known issues

  • When a compilation error occur inside a Dojo contract, the diagnostic gives the line of the attribute instead of the accurate line.
  • The language server is still being worked on.

The book is being updated, and the next two weeks will have the focus mainly on shipping the namespaces and starknet foundry testing among other things.

What's Changed

  • Update devcontainer image: v0.7.0-alpha.5 by @tarrencev in #2019
  • fix: reenable metadata upload test by @glihm in #2022
  • feat(torii-grpc): finalize join sql query to support new layout by @Larkooo in #2017
  • feat(sozo): make few argument global by @lambda-0x in #2029
  • fix: metadata update use bytearray by @Larkooo in #2031
  • feat(torii-libp2p): support new layout types for SNIP-12 typed data by @Larkooo in #2032
  • feat(sozo): add a subcommand to generate overlay files by @lambda-0x in #2025
  • update dead links by @taikoonwang in #2036
  • [saya] Scheduler by @neotheprogramist in #1917
  • feat(spawn-and-move): modify example to take use of new layout for offchain msg by @Larkooo in #2042
  • [dev] add foundry tools to the dev container by @glihm in #2045
  • refactor(torii-libp2p): use cainome + integration test by @Larkooo in #2044
  • fix: fix RPC version checking by @glihm in #2048
  • fix(ci): add missing path to foundry binaries by @glihm in #2051
  • [trick] to unlock toriiClient with safari/firefox by @notV4l in #2038
  • feat(dojo-bindgen): 2d+ arrays, bytearrays and enums serialization by @Larkooo in #2028
  • feat(core): add state mutability computation from world param by @glihm in #2049
  • feat: ability to skip migration of certain contracts/models by @lambda-0x in #2026
  • Prepare release: v0.7.0 by @tarrencev in #2055
  • fix: ensure pkg-config is also installed by @glihm in #2056

New Contributors

Full Changelog: v0.7.0-alpha.5...v0.7.0

v0.7.0-alpha.5

29 May 20:51
328004d
Compare
Choose a tag to compare
v0.7.0-alpha.5 Pre-release
Pre-release

Notable changes

  1. Bug fix on dojoup script which was stuck after the installation of the binaries + help message not displayed.
  2. Bug fix to ensure any package of dojo can be built separately without error.
  3. Sozo now supports init calldata. The concept is the following: you can now define a dojo_init function into your dojo contracts. This function will be callable only once, at the moment where the contract is deployed (in the same transaction). Once again, the overlays inside manifests are used for that purpose. Only two variables are currently available, to get contract_address and class_hash of an other contract in the world. More info to come in the book.
  4. Sozo now supports some prefixes to pass call data with execute (use sozo execute --help for more info):
    • u256
    • sstr: short string (31 chars)
    • str: long string (ByteArray)
    • Any other item is processed as a felt
  5. Sozo model commands have been reworked + a new layout command:
    • sozo model schema <ModelName>: retrieves the schema of a model to see the types from the on-chain data.
    • sozo model layout <ModelName>: shows the computed layout in memory for your model. This gives you a detailed view of the number of bits used by each fields, and if packed, it gives you the exact bits layout. You can use this command on Position and Moves of the spawn-and-move example to see the differences between layouts.
    • sozo model get <ModelName> <KEYS>: retrieves the data on-chain from the dojo storage of the world for the given model and keys.
  6. A new derive attribute IntrospectPacked is now required to be derived on each struct inside a model you want to be packed by dojo. As a recall, IntrospectPacked models are stored with all the fields sequentially (as dojo did initially), which has the benefit of a very short footprint in the storage, but less flexibility for model upgrade. You have an example in the repo.
  7. Torii now supports indexing models with multidimensional arrays.

Targeted features for for the 0.7.0 (which will ends up being the first iteration for 1.0):

  • Cairo 2.6 support (currently only a CI problem to be fixed to ensure correct publication of the releases.
  • New storage layout [1/2] with: Nested structs, Array<T>, ByteArray.
  • New storage layout [2/2] with: Enums rework to fully support custom enumeration without the same type limitation we currently have.
  • Sozo support for constructor / initializer pattern with arguments.
  • Update of Torii to support the new types + the new storage layout.
  • Starknet foundry for testing
  • Namespaces to register / access models.

What's Changed

New Contributors

Full Changelog: v0.7.0-alpha.4...v0.7.0-alpha.5

v0.7.0-alpha.4

24 May 00:27
aa5b534
Compare
Choose a tag to compare
v0.7.0-alpha.4 Pre-release
Pre-release

⚠️ Breaking changes ⚠️

Before diving into the storage layout in detail, some breaking changes and features:

  1. Models are now defined with an attribute instead of a derive. #[dojo::model]. This will allow in the future to have some additional inputs to this attribute. Example in spawn-and-move.
  2. Before, the models were identified by their name. Now, they are identified by the selector of their name. This breaks the storage slot computation for a model. We will present in a subsequent PR/documentation how backward compatibility can be achieved if it’s still necessary.
  3. Sozo now supports from prefixes to pass a call data: u256, sstr for short string, str for ByteArray. sozo execute --help for details and examples. If you need an other prefix, please don't hesitate to open a PR by implementing the decode trait as shown here or an issue.

Important notes on the storage layout

The book will also be updated once the version is stabilized.

  1. You can now use ByteArray, Array and Option into models as show in the example. The nested level for array is for now 1 dimension (Torii limitation), but will soon be unlocked for arrays with multiple dimensions.
  2. Enumerations can now have variants with different types (including the new supported types).
  3. Introspect is now automatically derived for any struct with the model attributes. However, if you want to have the same behavior as the dojo storage before (all the fields packed sequentially), you should derive IntrospectPacked instead.
  4. At the moment, you can't have a model inside an other model. You should use intermediate structs instead.
  5. Models keys are only primitive type for now. You can’t use a ByteArray, Array or an other structure as key. ByteArray should be unlocked in the future.
  6. In an Option<T>, the inner type T can’t be a tuple. An easy workaround is to use a struct instead.
  7. GraphQL is still in iteration to support any type combination, please report any model that is not indexed by Torii and served correctly with GraphQL schemas. Here are some example of new type query. Tuples are different than array, you must use the index prefixed with _.
# Array<Vec2>
array {
  x
  y
}

# Option<Vec2>
enum {
  # inner type
  Some {
    x
    y  
  }
  option
}

# (u8, Vec2)
tuple {
  _0
  _1 {
    x
    y
  }
}

# ByteArray
bytearray
  1. #1989 will be re-open targeting main to add new sozo commands and give more insights on the storage layout and schema for a model to ensure you can inspect how models are stored precisely.

Targeted features for for the 0.7.0 (which will ends up being the first iteration for 1.0):

  • Cairo 2.6 support (currently only a CI problem to be fixed to ensure correct publication of the releases.
  • New storage layout [1/2] with: Nested structs, Array<T>, ByteArray.
  • New storage layout [2/2] with: Enums rework to fully support custom enumeration without the same type limitation we currently have.
  • Sozo support for constructor / initializer pattern with arguments (#1964)
  • Update of Torii to support the new types + the new storage layout.
  • Starknet foundry for testing
  • Namespaces to register / access models.

What's Changed

  • Remove sozo as a dependency of katana-runner crate by @kariy in #1988
  • Update devcontainer image: v0.7.0-alpha.3 by @tarrencev in #1961
  • [Katana] Allow choosing the class in the genesis file without affecting the actual class hash by @Yogalholic in #1975
  • refactor(katana): replace cursor-based api with by block basis for simplicity by @kariy in #1986
  • Refactor saya to fetch the traces using the new API by @kariy in #1987
  • Add doc comments for L1HandlerTx by @kariy in #1980
  • fix(katana): l1/l2 messaging hash computations by @kariy in #1981
  • feat: new layout support by @Larkooo in #1970
  • Prepare release: v0.7.0-alpha.4 by @tarrencev in #1990

New Contributors

Full Changelog: v0.7.0-alpha.3...v0.7.0-alpha.4

v0.7.0-alpha.3

20 May 13:25
855da31
Compare
Choose a tag to compare
v0.7.0-alpha.3 Pre-release
Pre-release

Notable Changes

  • Remove limitation for the contract byte code max size.
  • Fix class hash computation while deploying on public network with upgrade of starknet-rs version.
  • Adjust starknet RPC version checks to ensure sozo can deploy on public network with backward compatible versions.

Targeted features for for the 0.7.0 (which will ends up being the first iteration for 1.0):

  • Cairo 2.6 support (currently only a CI problem to be fixed to ensure correct publication of the releases.
  • New storage layout [1/2] with: Nested structs, Array<T>, ByteArray.
  • New storage layout [2/2] with: Enums rework to fully support custom enumeration without the same type limitation we currently have.
  • Sozo support for constructor / initializer pattern with arguments (#1964)
  • Update of Torii to support the new types + the new storage layout. (#1970)
  • Starknet foundry for testing
  • Namespaces to register / access models.

What's Changed

  • bump alloy to 0.7.2 by @tcoratger in #1962
  • fix(sozo/katana): remove max_bytecode_size limitation by @lambda-0x in #1963
  • dev: general cleanup, bumping of library versions, etc... by @lambda-0x in #1939
  • Remove forge-std submodule in katana by @ZaK3939 in #1974
  • chore: ensure Cargo.lock is committed by @glihm in #1976
  • fix: add more logic on semver check of Starknet API by @glihm in #1966
  • chore(katana): ignore forked backend thread spawn test by @kariy in #1977
  • test(katana): provider test utils by @kariy in #1967
  • refactor(katana): encapsulate all the tx execution logic into a single function by @kariy in #1968
  • Add simple benchmark for the transact function by @kariy in #1969
  • fix(sozo): handle edge case when base_class_hash is FieldElement::ZERO by @lambda-0x in #1978
  • display contract addresses in sozo migrate plan by @stevencartavia in #1926
  • Prepare release: v0.7.0-alpha.3 by @tarrencev in #1979

New Contributors

Full Changelog: v0.7.0-alpha.2...v0.7.0-alpha.3

v0.7.0-alpha.2

14 May 15:29
f648e87
Compare
Choose a tag to compare
v0.7.0-alpha.2 Pre-release
Pre-release

What's Changed

  • Fix katana multiple origins arg by @broody in #1937
  • feat(sozo): print-env subcommand by @lambda-0x in #1930
  • Simplify readme, add contextual warnings to dojoup by @tarrencev in #1938
  • Update devcontainer image: e95f86f by @tarrencev in #1922
  • Handle scarb install in dojoup by @tarrencev in #1940
  • chore(katana): clean up txn hash test by @kariy in #1941
  • refactor(katana): remove ContractInfoProvider by @kariy in #1943
  • Refactor forked provider backend APIs by @kariy in #1944
  • test(katana): ensure contract non-existent is validated properly on StateProvider::nonce() of forked provider by @kariy in #1947
  • fix(katana): include full fee info in primitive receipts by @kariy in #1948
  • feat(torii-graphql): add In and Like comparison operators by @Larkooo in #1949
  • dev(sozo): use TransationOption instead of FeeOption by @lambda-0x in #1927
  • Prepare release: v0.7.0-alpha.2 by @tarrencev in #1959

Full Changelog: v0.7.0-alpha.1...v0.7.0-alpha.2

v0.7.0-alpha.1

06 May 23:03
Compare
Choose a tag to compare
v0.7.0-alpha.1 Pre-release
Pre-release

Notable changes

  1. Cairo 2.6.3 is now the default version for Dojo.
  2. Torii supports indexing pending blocks with --index-pending flag.
  3. Torii and Katana by default do not add a CORS layer. You should enable it by passing --allowed-origins "*" for instance to explicitly add this CORS layer accordingly.
  4. Sozo now attempts to automatically grant the writer permissions to all the models that are declared into the writes entry of an overlay manifest file. The overlay manifest file will be firstly described here and should have a dedicated section soon with all the functionalities that will depend on it.

Targeted features for for the 0.7.0 (which will ends up being the first iteration for 1.0):

  • Cairo 2.6 support (currently only a CI problem to be fixed to ensure correct publication of the releases.
  • New storage layout [1/2] with: Nested structs, Array<T>, ByteArray.
  • New storage layout [2/2] with: Enums rework to fully support custom enumeration without the same type limitation we currently have.
  • Update of Torii to support the new types + the new storage layout.
  • Namespaces to register / access models.
  • Sozo support for constructor / initializer pattern with arguments.
  • Torii upgradeability of models.

What's Changed

Read more

v0.7.0-alpha.0

01 May 05:10
2b2dc1b
Compare
Choose a tag to compare
v0.7.0-alpha.0 Pre-release
Pre-release

What's Changed

  • Display default values for EnvironmentOptions in katana cli by @notV4l in #1861
  • docs(katana): update DB er diagram by @kariy in #1874
  • Bump alloy to 0.7.0 by @tcoratger in #1881
  • fix: event message subscription subscription broker by @Larkooo in #1885
  • feat(torii): process pending block by @Larkooo in #1798
  • fix(katana): invalid nonce values set in error by @Eikix in #1890
  • fix: ensure account defaults to block pending by @glihm in #1891
  • CI: add workflow_dispatch for devcontainer.yml by @glihm in #1882
  • refactor(torii): don't use feature-only type in non-feature code by @kariy in #1894
  • Fix dojoup script when installing from git by @kariy in #1895
  • Torii external-url arg to support https by @broody in #1898
  • fix(katana): place import inside its feature scope by @kariy in #1902
  • fix(torii): fallback invalid events & flag indexing pending blocks by @Larkooo in #1897
  • [sozo] add trace logs by @btirth in #1867
  • fix: allow ref self until sozo can handle starknet contracts by @glihm in #1879
  • feat: cli arg disable cors torii proxy server by @Larkooo in #1904
  • Prepare release: v0.7.0-alpha.0 by @tarrencev in #1905

New Contributors

Full Changelog: v0.6.1-alpha.4...v0.7.0-alpha.0

Important fixes:

  1. Torii should index correctly the pending block. There's a flag to toggle this feature.
  2. Katana has now a new DB version, which is not compatible with the 0.6.1-x version ⚠️ BREAKING ⚠️
  3. ref self can now be used in some edge cases for dojo contracts, as a temporary solution until sozo can manage starknet contracts (TBD).

Targeted features for for the 0.7.0 (which will ends up being the first iteration for 1.0):

  • Cairo 2.6 support (currently only a CI problem to be fixed to ensure correct publication of the releases.
  • New storage layout [1/2] with: Nested structs, Array<T>, ByteArray.
  • New storage layout [2/2] with: Enums rework to fully support custom enumeration without the same type limitation we currently have.
  • Update of Torii to support the new types + the new storage layout.
  • Namespaces to register / access models.
  • Sozo support for constructor / initializer pattern with arguments.
  • Torii upgradeability of models.

The 0.7.0 will be a version of iterations to reach the 1.0. The target date is end of May 24 for the 1.0.

Notes

About the versioning, we used to not stick to semver before the 1.0. This change to 0.7.0 was mostly to clearly remark the breaking changes at all the stack level, with the new Cairo version, Katana database changes and dojo core modifications.
After the 1.0 will be out, the semver rules will be more strictly applied to the dojo versioning.

v0.6.1-alpha.4

24 Apr 23:55
5ac6659
Compare
Choose a tag to compare
v0.6.1-alpha.4 Pre-release
Pre-release

What's Changed

  • [sozo] Deploy Account by @JimmyFate in #1601
  • fix(ci): exit with non-zero status code if any function call fails by @lambda-0x in #1853
  • fix: ensure transaction executions are stored with fork and db providers by @glihm in #1852
  • feat(torii-client): expose grpc event messages by @Larkooo in #1826
  • Replace block_time: None by default by @tcoratger in #1858
  • fix(katana): wrong from_address value taken from the transaction trace by @kariy in #1862
  • test(katana-executor): test tx execution info conversion by @kariy in #1863
  • test(katana-executor): test events/messages are extracted correctly from tx execution info by @kariy in #1864
  • fix: messaging tutorial data by @glihm in #1869
  • feat: add raw max fee to TransactionsOptions by @princeibs in #1856
  • Bump katana database version by @kariy in #1833
  • feat: spawn event message subscription service by @Larkooo in #1876
  • feat: enable global flag for all commands/options by @lambda-0x in #1875
  • refactor(sozo): migration logic to be more robust and testable by @lambda-0x in #1848
  • Prepare release: v0.6.1-alpha.4 by @tarrencev in #1872

New Contributors

Full Changelog: v0.6.1-alpha.3...v0.6.1-alpha.4

v0.6.1-alpha.3

19 Apr 02:40
a2412b3
Compare
Choose a tag to compare
v0.6.1-alpha.3 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.6.0...v0.6.1-alpha.3

v0.6.1-alpha.2

19 Apr 01:26
dbad879
Compare
Choose a tag to compare
v0.6.1-alpha.2 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.6.0...v0.6.1-alpha.2