Skip to content

Releases: dojoengine/dojo

v1.0.0-alpha.4

02 Aug 00:47
d08c461
Compare
Choose a tag to compare
v1.0.0-alpha.4 Pre-release
Pre-release

Mostly bug fixes in this release

  • Controller integration with Sozo.
  • Fix bug when testing contracts where TEST_CLASS_HASH wasn't found.
  • Katana internal refactoring and hash computation fixes.

What's Changed

  • Update devcontainer image: v1.0.0-alpha.3 by @tarrencev in #2211
  • refactor(katana-rpc): move API implementations from Sequencer to their dedicated server struct by @kariy in #2209
  • refactor(katana): remove unneccessary level of abstraction due to KatanaSequencer by @kariy in #2214
  • fix: ensure event messages are emitted with the correct selector by @glihm in #2217
  • feat(dojo-core): add selector_from_names for cairo runtime by @glihm in #2219
  • tests: unit tests for hash computations in transaction.rs by @g4titanx in #2216
  • refactor(katana): flatten the logic of starting the node by @kariy in #2232
  • update permission api by @remybar in #2224
  • fix calldata issue by @ponderingdemocritus in #2213
  • fix(sozo): events subcommand by @lambda-0x in #2215
  • fix: ensure correct compilation unit is picked up by @glihm in #2220
  • feat(katana-db): database stats by @kariy in #2235
  • fix(sozo): upgrade_contract use selector instead of contract_address by @notV4l in #2234
  • refactor(cli): katana cli module by @kariy in #2236
  • feat(katana): db stats cli by @kariy in #2237
  • refactor(sozo): fetch writes from events and calculate diff for that + some refactor by @lambda-0x in #2203
  • Bump account_sdk to rev 512ff89 by @kariy in #2240
  • chore(katana-primitives): pleasing clippy by @kariy in #2241
  • katana: include freelist in stats by @kariy in #2243
  • Export setup module under test-utils feature by @kariy in #2247
  • fix(sozo): block can contain multiple event of same type for same address by @lambda-0x in #2245
  • refactor(sozo): deploy controller account if not exist by @kariy in #2242
  • feat(torii-core): store update member by @Larkooo in #2182
  • Prepare release: v1.0.0-alpha.4 by @tarrencev in #2249

Full Changelog: v1.0.0-alpha.3...v1.0.0-alpha.4

v1.0.0-alpha.3

25 Jul 05:21
a6a7724
Compare
Choose a tag to compare
v1.0.0-alpha.3 Pre-release
Pre-release

Important changes

  • Sozo now supports workspaces with packages. However, only one package with [[target.dojo]] is supported into a workspace. This unlock the possibility of organizing a dojo project with some packages (crates) that can be easily imported by other projects, and having the world to deploy in the same repository.
  • Default namespaces are now supported for libraries.
  • Work on Typescript bindgen to work with namespaces and better Enum support.

What's Changed

  • Remove starknet_in_rust executor support by @kariy in #2200
  • test(katana-executor): katana to blockifier chain id invariant by @kariy in #2204
  • refactor(katana-rpc): starknet rpc clean up by @kariy in #2205
  • Cleaning/Refactoring of the dojo-core crate. by @remybar in #2187
  • fix(dojo-lang): ensure compiler tests have unique id to not avoid output conflicts by @glihm in #2206
  • refactor(katana-rpc): rename trait methods to their exact names in the api spec by @kariy in #2208
  • feat(sozo): add full workspace and accept non-dojo targets by @glihm in #2207
  • fix(sozo): adjust typescript bindgen to v1 by @ponderingdemocritus in #2202
  • Prepare release: v1.0.0-alpha.3 by @tarrencev in #2210

Full Changelog: v1.0.0-alpha.2...v1.0.0-alpha.3

v0.7.4

22 Jul 18:19
Compare
Choose a tag to compare

Backported few bug fixes to 0.7.x

Full Changelog: v0.7.3...v0.7.4

v1.0.0-alpha.2

20 Jul 23:07
8a1a652
Compare
Choose a tag to compare
v1.0.0-alpha.2 Pre-release
Pre-release

Important changes

  • ⚠️breaking ⚠️ Support for Cairo 2.7.0-rc.3 for both dojo-lang and katana.
  • Subscriptions with Torii can now be updated by providing an array of clauses.

What's Changed

  • Update devcontainer image: v1.0.0-alpha.1 by @tarrencev in #2181
  • rm useless alloy patches by @tcoratger in #2183
  • move to edition 2023_11 by @remybar in #2179
  • Update Katana benchmark CI by @kariy in #2184
  • feat: update subscription by subscription id & multiple clauses by @Larkooo in #2176
  • fix: ensure the snake case is only applied to model name by @glihm in #2185
  • Bump blockifier to support Cairo 2.7 by @kariy in #2180
  • bench(katana-executor): measure cached state concurrency by @kariy in #2190
  • fix(dojo-lang): bump to cairo 2.7.0-rc.3 by @glihm in #2189
  • fix: ensure scarb points to the correct plugin version by @glihm in #2194
  • feat(dojo-bindgen): signed integers & typescript by @Larkooo in #2191
  • Prepare release: v1.0.0-alpha.2 by @tarrencev in #2195
  • fix(sozo): update some clap arguments by @lambda-0x in #2196
  • fix(sozo): use Provider trait and avoid manifest read when possible by @glihm in #2197

Full Changelog: v1.0.0-alpha.1...v1.0.0-alpha.2

v1.0.0-alpha.1

16 Jul 19:31
Compare
Choose a tag to compare
v1.0.0-alpha.1 Pre-release
Pre-release

Important changes

This new alpha brings new capabilities for Dojo at different levels:

  • A new model API to interact with your models data. When a model is processed by the Dojo plugin, <ModelName>Trait and <ModelName>EntityTrait are generated. The <ModelName>Trait deals with the full model data (including the keys). The <ModelName>EntityTrait doesn't contain the key, only the data and the entity_id (currently stored with a __id field).
    They allow interacting with model's data in an efficient manner, without expanding more code at each use (which was the case using the macro):

    use path::to::MovesTrait;
    
    // Each key of the entity is a distinct parameter after the world.
    let mut moves = MovesTrait::get(world, player);
    moves.remaining -= 1;
    // They keys being present in the type, only the world is required to set the data.
    moves.set(world);
    moves.delete(world);

    If you only have to deal with entity_id instead of all the keys, you can use the <ModelName>EntityTrait:

    // The entity may come computed from the keys, or a simple `felt252` holding the value.
    let move_id = MovesTrait::entity_id_from_keys(player);
    let move_id = registered_moves[n];
    // Get in the same fashion as before, but only using the `entity_id`. This returns a `<ModelName>Entity` and not the full model with keys.
    let mut moves = MovesEntityTrait::get(world, move_id);
    moves.remaining -= 1;
    // `Update` is used over `set` to make the distinction here with a `set` where keys are used to ensure Torii
    // knows the full keys.
    moves.update(world);
    // You can also delete:
    moves.delete(world);

    Both of the traits are using the same Torii event (EntityUpdated), which makes them both usable right away in Torii with subscriptions.

    Even if available in the API, the get/set_member_name(...) are not yet available in Torii. They may not be used to now as it will compile, but Torii will not index such changes.

    The macros get!, set! and delete! are still available, and use the new functions under the hood (hence more efficient and producing less code).

    Examples: entity_id access and get.

  • Namespaces have been improved, to support the re-use of models from other libraries.
    The new way to configure namespace if the following:

    [tool.dojo.world.namespace]
    default = "dojo_examples"

    Having this instead of the package name as default namespace, allow configuration across profiles.
    Now, if you need to import a library, you may want to map the namespace to choose your own:

    [tool.dojo.world.namespace]
    default = "dojo_examples"
    mappings = { "armory-Flatbow" = "dojo_examples_weapons", "bestiary" = "dojo_examples_foes" }

    In this case, you can use the mappings. You can define a mapping for a very specific model/contract using its tag (armory-Flatbow) to define its namespace into your project. Or you can choose to remap all the models/contracts using the namespace name (bestiary).

    All the other models/contracts that don't have mappings, will be using the default namespace.

    Due to compiler limitations, there are two edge cases:

    • If in your project you want to change the namespace some models/contracts using the attribute #[dojo::contract(namespace: "nm") then you will have to use #[dojo::contract(namespace: "nm", nomapping: true)] to ensure it doesn't fallback into the default namespace.
    • When you write a library that exposes models, if you want the user to be able to define mappings specific for your library or targeted models/contracts, you must define an explicit namespace using the attribute #[dojo::model(namespace: "nm")]. This way, nm will be able to be remapped by the user of your library.

    Examples: defining a library model and remapping the model's namespace specifically.

    Remember that if you want the model to be registered by sozo, you will have to declare it inside the build-external-contract as shown here. Without this, you can still using the model/contract, but it will not be registered and managed by sozo.

  • Add support for Cairo features: you can now use the features (similar to rust for those familiar with the crab language). Using features, you can determine which part of a Cairo module has to be included at compile time.

    [features]
    # Default is a special feature, where you can enable some features by default without passing them explicitly.
    default = ["dungeon"]
    # Defining a feature is only adding a line like this.
    dungeon = []

    Then in the code, you can do the following:

    #[cfg(feature: 'dungeon')]
    use dungeon::Goblin;

    It is important to note that, in Cairo, you can't use the #[cfg(feature: ...)] inside a function to add/remove some statements. But can be use anywhere else (mod, use, struct, etc...).

  • A new macro selector_from_tag! to compute the selector of a model/contract based on it's tag, expanded at compile time.

    let selector = selector_from_tag!("dojo_examples-Moves");
  • World's contract registry: With the rework of the world to support the new model API, a contracts registry has also been added. This contract's registry allows you to query the world for a specific contract's address in a very deterministic manner.

    let (class_hash, address) = world.contract(selector_from_tag!("dojo_examples-Moves"));

    This avoid having to inject addresses during initialization, and not have to change the code each time contract's address may change.

  • Scarb now allows you to use a merge strategy when defining multiple profiles. This means, for each profile you declare, all the keys that are not found for a profile will fallback on the default profile (dev). Example here.

  • SDKs: With this new release, the SDKs will be updated, to ensure you have the tag as identifier for your queries and subscriptions to be compatible with the new changes.

What's Changed

  • refactor: update manifest structure by @lambda-0x in #2153
  • refactor(torii-grpc): empty hashed keys in subscription match all entities by @Larkooo in #2154
  • feat: bump cairo and scarb to latest nightly by @glihm in #2152
  • feat(dojo-bindgen): add namespace to unity bindgen by @Larkooo in #2155
  • fix selector functions for models and contracts by @remybar in #2156
  • chore: use version sensitive deps from katana-cairo + some unused deps clean up by @kariy in #2163
  • added missing_debug_implementations lint by @g4titanx in #2016
  • bump account_sdk to rev 199d87d on main by @kariy in #2165
  • fix(compiler): use provided metadata to support feature flags by @lambda-0x in #2167
  • feat(sozo): support for feature flags by @lambda-0x in #2112
  • fix: use merge-strategy instead of copying profile by @lambda-0x in #2170
  • fix(sozo): remove generate overlay command by @lambda-0x in #2168
  • fix(sozo): ensure overlays can support any resource type by @glihm in #2169
  • refactor(katana-db): database transaction abstractions by @kariy in #2171
  • refactor(katana-db): main database trait by @kariy in #2173
  • refactor(torii): remove executor from world table & write class hash by @Larkooo in #2166
  • feat: add support for model from other libraries by @glihm in #2172
  • feat(core): model get/set functions by @remybar in #2159
  • fix cairo file metadata for contracts and models by @remybar in #2175
  • feat: add support for signed integers by @EjembiEmmanuel in #2161
  • Prepare release: v1.0.0-alpha.1 by @tarrencev in #2178

New Contributors

Full Changelog: v1.0.0-alpha.0...v1.0.0-alpha.1

v1.0.0-alpha.0

07 Jul 04:59
2e04f54
Compare
Choose a tag to compare
v1.0.0-alpha.0 Pre-release
Pre-release

1.0.0-alpha.0

Introduction to namespaces

First alpha for Dojo 1.0.0 comes with the namespaces for contracts and models, which is the latest major changes that was expected to walk toward stabilisation.

This implies that anytime one wants to refer to a contract or a model, the namespace + the name of the contract/model must be provided. For this, a new term is introduce: a tag.

A tag is a unique identifier of a contract/model containing the namespace and the name separated by -:
dojo_examples-actions or dojo_examples-Position.

For model names, the regex is [_a-zA-Z] enforced by Cairo syntax. The exact same regex is expected for the namespace, and will be enforced by sozo (currently not enforced by the contract, but torii will be updated to ignore any invalid namespace and sozo to emit error).

To provide a namespace:

#[dojo::model(namespace: "ns")]
struct MyModel {
...
}

#[dojo::contract(namespace: "ns2")]
mod actions {
...
}

Or at the project level, into the Scarb.toml:

[tool.dojo.world]
namespace = "my_ns"

sozo commands have been updated to take in account the tag, or if no namespace is given, the default namespace is used from the Scarb.toml.

# Before
sozo execute dojo_examples::actions::actions spawn

# Implicit default namespace
sozo execute actions spawn

# Explicit namespace
sozo execute nm2-other_contract spawn

torii has also been updated to use this tag in order to query a specific model, and every model returned by torii now contains the tag instead of the name of the model.

Other important updates

  • The compiler bug has been fixed, now the diagnostics are pointing correctly to the line with the actual error.
  • The new Felt type from starknet-io/types-rs is now supported all over the stack.
  • In the Scarb.tom, two new entries inside [tool.dojo.world] are required: namespace and seed. Before the seed was the package name. However, this package name is not configurable by profile. Now you can adjust it depending on the profile (same for namespace).
  • The overlays folder is now at the same level of the manifests one. This ensures nothing that is user-edited can be deleted while cleaning the manifests.

Coming work

  • Language server is now better as all macros are recognized, but still not fully functional (not giving in red all errors inside dojo contract). We need to wait some updates on that from dependencies.
  • SDKs are currently being updated, soon they will offer full support for 1.0.0-alpha.x.
  • Support for libraries (like Origami), to ensure that a namespace can be override to ease the re-use of models declared in an other library.
  • A big bump to the devX with a new syntax that will come to complement macro usage: #2138.
  • Support for signed integers.
  • Contract registry to not hard code addresses and call an other system easily.

What's Changed

New Contributors

Full Changelog: v0.7.3...v1.0.0-alpha.0

v0.7.3

04 Jul 00:43
e8539d5
Compare
Choose a tag to compare

Important notes

This release is mostly for Torii stability and availability on Slot.

  • New composite clause support.
  • More flexibility on the key filtering for subscriptions.
  • Fix pending block indexing when receipt is missing, mostly for public networks.

What's Changed

  • chore(torii-libp2p): use rev by @Larkooo in #2104
  • test(katana): messaging e2e test by @fabrobles92 in #1925
  • fix(torii): ensure torii doesn't stop on model processor fail by @glihm in #2093
  • feat(katana): always include Controller class by default by @kariy in #2107
  • feat(torii-core): add entities deletions to susbcription broker by @Larkooo in #2106
  • Prepare release: v0.7.3-alpha.1 by @tarrencev in #2110
  • feat(torii-grpc): support multiple entity models in queries & complex keys clause for subscriptions + queries by @Larkooo in #2095
  • dev: clean up dependencies by @lambda-0x in #2102
  • fix(torii-client): emtpty sub for event message by @Larkooo in #2115
  • feat(saya): load starknet account from CLI by @neotheprogramist in #2054
  • feat(torii-grpc): composite query by @Larkooo in #2113
  • fix(torii-core): update entity timestamp on update by @Larkooo in #2118
  • refactor(torii-client): remove storage packed size check by @Larkooo in #2116
  • refactor(torii-grpc): use Option for felt as keys wildcard by @Larkooo in #2119
  • fix(torii-core): silently retry fetching pending txn until we have it by @Larkooo in #2125
  • fix unsafe precondition check by @tcoratger in #2129
  • chore: remove dbg! macro by @kariy in #2131
  • Prepare release: v0.7.3 by @tarrencev in #2133

Full Changelog: v0.7.3-alpha.0...v0.7.3

v0.7.3-alpha.0

25 Jun 13:59
962579b
Compare
Choose a tag to compare
v0.7.3-alpha.0 Pre-release
Pre-release

What's Changed

Full Changelog: v0.7.2...v0.7.3-alpha.0

v0.7.2

20 Jun 04:16
3da5cad
Compare
Choose a tag to compare

Notable changes

This release is mostly including Torii server updates to handle deletion or models and arrays inside models in a better way. Indexation do the pending block should also be enhanced.

What's Changed

  • Update devcontainer image: v0.7.1 by @tarrencev in #2077
  • fix(torii): handle array of unknown enum variants and empty arrays by @Larkooo in #2078
  • refactor(torii): delete entity in all tables & array references for entity delete! by @Larkooo in #2072
  • fix(katana-rpc): only include successful transactions in pending block by @kariy in #2082
  • refactor(torii-core): ignore invalid txs that are included in the pending block by @Larkooo in #2081
  • Prepare release: v0.7.2 by @tarrencev in #2090

Full Changelog: v0.7.1...v0.7.2

v0.7.1

18 Jun 04:56
c4a1fea
Compare
Choose a tag to compare

Notable changes:

  1. Fix of the namespace compilation issue for library like Origami. Now the sozo build command is supported again for namespaces, but other commands are not, which is expected for the moment. A future support for --package option will come.
  2. Fix of the Dojo binaries that had some dependencies not using rustls-tls, which caused issues with slot. This version should now be compatible and a new test in the CI will ensure this is correctly checked before the version can be released.
  3. self and world param can be used but in a exclusive manner. So until you need it, you should inject the world using world param. If required by some cairo trait like generate_trait, you can still use self inside a dojo::contract.
  4. Fix of array handling in unity SDK for Torii.

What's Changed

  • Update devcontainer image: v0.7.0 by @tarrencev in #2052
  • fix(dojo-bindgen): array length before array items by @Larkooo in #2060
  • fix(torii): fix table name using reserved sql keywords by @Larkooo in #2062
  • refactor(sozo): dont use explicit account type by @kariy in #2061
  • fix(sozo): allow sozo build in workspace and proper error for other cases by @glihm in #2059
  • fix(migrate): when init_calldata depends on contract that was already deployed by @lambda-0x in #2058
  • fix(ci): ensure katana runs in debian:bookworm-slim by @tarrencev in #2073
  • [dojo-core]: update gas logs by @notV4l in #1877
  • Prepare release: v0.7.1 by @tarrencev in #2076
  • fix: allow the use of self and world in an exclusive manner by @glihm in #2063

Full Changelog: v0.7.0...v0.7.1