Releases: dojoengine/dojo
v1.0.0-alpha.7
What's Changed
- Update devcontainer image: v1.0.0-alpha.6 by @tarrencev in #2313
- feat(katana-tasks): task manager by @kariy in #2318
- refactor(katana): update execution error message by @kariy in #2322
- feat(dojo-core): add world test capabilities by @glihm in #2323
- opt(torii): indexing model schema retrieval by @Larkooo in #2319
- feat(torii): make poll time configurable by @Larkooo in #2327
- Prepare release: v1.0.0-alpha.7 by @tarrencev in #2324
Full Changelog: v1.0.0-alpha.6...v1.0.0-alpha.7
v1.0.0-alpha.6
Important changes
- Fix a bug that prevented contracts from other libraries to be correctly imported during testing.
- Ensure accounts during migration use the
Pending
block tag. - Torii can now be started before the world is deployed.
- Contract's manifest has now a new
systems
entry with the list of systems found in the dojo contract. - Torii should now delete correctly the entities and return an empty array of models if the entity was deleted completely.
What's Changed
- feat(torii): enable any build (not just wasm) to connect to Slot by @caillef in #2147
- fix: ensure migrators are on block pending + display contract address by @glihm in #2293
- fix(dojo-lang): add all crates to test database for Cairo test runner by @glihm in #2296
- feat: improve world contract performance by @remybar in #2287
- refactor(torii): get rid of world class hash by @Larkooo in #2298
- refactor(torii): include model in entity deletion for filter & update member broadcast by @Larkooo in #2299
- feat(torii-core): log when engine syncing has been reestablished by @Larkooo in #2301
- refactor(torii-libp2p): use is_valid_signature for different sig impls by @Larkooo in #2302
- fix(torii-core): engine update cursor when world event by @Larkooo in #2300
- fix(torii-grpc): world class hash by @Larkooo in #2307
- refactor(torii): entity deletion logic for models by @Larkooo in #2306
- fix: improve world's error messages by @glihm in #2305
- feat(dojo-lang): add systems to contract's manifest and fix
DojoAuxData
gathering by @glihm in #2309 - feat(torii-libp2p): typed data from model by @Larkooo in #2308
- Prepare release: v1.0.0-alpha.6 by @tarrencev in #2312
New Contributors
Full Changelog: v1.0.0-alpha.5...v1.0.0-alpha.6
v1.0.0-alpha.5
important changes
- New configuration file
dojo_<PROFILE_NAME>.toml
, to place all dojo specific content. Must be placed at the same level asScarb.toml
. - Bug fixes on Torii for Graphql and GRPC for some types that were failing.
- ACLs revised to protect against malicious manipulation of permissions.
- Add a new Sozo command to compute hashes:
sozo hash
that can accept a tag or felts. - Sozo init is now correctly working with pinned versions.
- Torii full support for signed integers.
- An empty clause in Torii subscriptions is now again subscribing to every entity.
- Speed up migration with pre-deployed accounts on katana locally and slot.
What's Changed
- Update devcontainer image: v1.0.0-alpha.4 by @tarrencev in #2250
- bump metrics dependencies by @kariy in #2251
- fix(torii): only retrieve metadata for world by @lambda-0x in #2252
- feat: add --tag to dojoup by @glihm in #2265
- feat: stabilize cairo to
2.7.0
by @glihm in #2257 - katana: database metrics by @kariy in #2258
- refactor(torii-client): remove deprecated model storage and subscription by @Larkooo in #2267
- fix(torii): member clause escaped table name by @Larkooo in #2255
- fix(torii-grpc): deser from db for grpc enums by @Larkooo in #2259
- refactor(torii-grpc): subscribe to all for empty clauses by @Larkooo in #2269
- feat(torii-grpc): add signed integers to grpc proto by @Larkooo in #2239
- chore(katana): remove unused sequencer code by @kariy in #2279
- fix(controller): wait for controller to be deployed by @kariy in #2278
- feat: implement sozo init versioning by @EjembiEmmanuel in #2262
- refactor(torii-grpc): correct pagination logic for grpc query member by @Larkooo in #2256
- xtask: generate katana test db by @kariy in #2271
- remove computed attribute by @remybar in #2272
- expose resources through resource() function in world API by @remybar in #2266
- feat(sozo): selector from tag command on sozo by @Larkooo in #2282
- ACL rework to avoid "man in the middle" vulnerability by @remybar in #2254
- fix(katana): handle when database is None by @kariy in #2284
- refactor(katana): move pool into its own crate by @kariy in #2281
- feat: adding profile config by @glihm in #2285
- fix(sozo): add support for new ACLs workflow by @glihm in #2288
- fix: update migration error message about world_address in Scarb.toml by @remybar in #2286
- Prepare release: v1.0.0-alpha.5 by @tarrencev in #2289
- feat(torii-graphql): event messages update & subscription by @Larkooo in #2227
Full Changelog: v1.0.0-alpha.4...v1.0.0-alpha.5
v1.0.0-alpha.4
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 rev512ff89
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 undertest-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
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
v1.0.0-alpha.2
Important changes
⚠️ breaking⚠️ Support for Cairo2.7.0-rc.3
for bothdojo-lang
andkatana
.- 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
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 theentity_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!
anddelete!
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 bysozo
. - If in your project you want to change the namespace some models/contracts using the attribute
-
Add support for Cairo
features
: you can now use thefeatures
(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 rev199d87d
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
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 fromstarknet-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
- feat: sozo init remove git by @EjembiEmmanuel in #2139
- fix: override
block_id
method of ConnectedAccount for SozoAccount by @lambda-0x in #2140 - feat(katana): add better node bindings by @kariy in #2142
- refactor(katana-runner): use the new bindings by @kariy in #2143
- breaking:
Felt
type migration +0.7.1
RPC update by @kariy in #2126 - fix(katana-node-bindings): use new Felt by @glihm in #2146
- docs(katana-node-bindings): add json log docs by @kariy in #2145
- feat: namespaces by @glihm in #2148
- fix: ensure metadata loading errors are correctly logged by @glihm in #2149
- Prepare release: v1.0.0-alpha.0 by @tarrencev in #2150
New Contributors
- @EjembiEmmanuel made their first contribution in #2139
Full Changelog: v0.7.3...v1.0.0-alpha.0
v0.7.3
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