Releases: latticexyz/mud
@latticexyz/dev-tools@2.0.0-next.4
@latticexyz/config@2.0.0-next.4
Patch Changes
- Updated dependencies []:
- @latticexyz/common@2.0.0-next.4
- @latticexyz/schema-type@2.0.0-next.4
@latticexyz/common@2.0.0-next.4
Patch Changes
- Updated dependencies []:
- @latticexyz/schema-type@2.0.0-next.4
@latticexyz/cli@2.0.0-next.4
Patch Changes
-
#1341
c32c8e8f
Thanks @holic! - Removesstd-contracts
package. These were v1 contracts, now entirely replaced by our v2 tooling. See the MUD docs for building with v2 or create a new project from our v2 templates withpnpm create mud@next your-app-name
. -
#1340
ce7125a1
Thanks @holic! - Removessolecs
package. These were v1 contracts, now entirely replaced by our v2 tooling. See the MUD docs for building with v2 or create a new project from our v2 templates withpnpm create mud@next your-app-name
. -
Updated dependencies []:
- @latticexyz/common@2.0.0-next.4
- @latticexyz/config@2.0.0-next.4
- @latticexyz/gas-report@2.0.0-next.4
- @latticexyz/protocol-parser@2.0.0-next.4
- @latticexyz/schema-type@2.0.0-next.4
- @latticexyz/services@2.0.0-next.4
- @latticexyz/store@2.0.0-next.4
- @latticexyz/utils@2.0.0-next.4
- @latticexyz/world@2.0.0-next.4
@latticexyz/block-logs-stream@2.0.0-next.4
Patch Changes
- Updated dependencies []:
- @latticexyz/common@2.0.0-next.4
- @latticexyz/config@2.0.0-next.4
- @latticexyz/schema-type@2.0.0-next.4
solhint-plugin-mud@2.0.0-next.3
solhint-plugin-mud@2.0.0-next.3
solhint-config-mud@2.0.0-next.3
solhint-config-mud@2.0.0-next.3
create-mud@2.0.0-next.3
Patch Changes
-
#1174
952cd534
Thanks @alvrs! - AllStore
methods now require the table's value schema to be passed in as an argument instead of loading it from storage.
This decreases gas cost and removes circular dependencies of the Schema table (where it was not possible to write to the Schema table before the Schema table was registered).function setRecord( bytes32 table, bytes32[] calldata key, bytes calldata data, + Schema valueSchema ) external;
The same diff applies to
getRecord
,getField
,setField
,pushToField
,popFromField
,updateInField
, anddeleteRecord
.This change only requires changes in downstream projects if the
Store
methods were accessed directly. In most cases it is fully abstracted in the generated table libraries,
so downstream projects only need to regenerate their table libraries after updating MUD. -
#1182
afaf2f5f
Thanks @alvrs! - -Store
's internal schema table is now a normal table instead of using special code paths. It is renamed to Tables, and the table ID changed frommudstore:schema
tomudstore:Tables
-
Store
'sregisterSchema
andsetMetadata
are combined into a singleregisterTable
method. This means metadata (key names, field names) is immutable and indexers can create tables with this metadata when a new table is registered on-chain.- function registerSchema(bytes32 table, Schema schema, Schema keySchema) external; - - function setMetadata(bytes32 table, string calldata tableName, string[] calldata fieldNames) external; + function registerTable( + bytes32 table, + Schema keySchema, + Schema valueSchema, + string[] calldata keyNames, + string[] calldata fieldNames + ) external;
-
World
'sregisterTable
method is updated to match theStore
interface,setMetadata
is removed -
The
getSchema
method is renamed togetValueSchema
on all interfaces- function getSchema(bytes32 table) external view returns (Schema schema); + function getValueSchema(bytes32 table) external view returns (Schema valueSchema);
-
The
store-sync
andcli
packages are updated to integrate the breaking protocol changes. Downstream projects only need to manually integrate these changes if they access low levelStore
orWorld
functions. Otherwise, a fresh deploy with the latest MUD will get you these changes.
-
-
#1311
331f0d63
Thanks @alvrs! - MovecreateFaucetService
from@latticexyz/network
to@latticexyz/services/faucet
.- import { createFaucetService } from "@latticexyz/network"; + import { createFaucetService } from "@latticexyz/services/faucet";
-
#1311
331f0d63
Thanks @alvrs! - Deprecate@latticexyz/std-client
and remove v1 network dependencies.-
getBurnerWallet
is replaced bygetBurnerPrivateKey
from@latticexyz/common
. It now returns aHex
string instead of anrxjs
BehaviorSubject
.- import { getBurnerWallet } from "@latticexyz/std-client"; + import { getBurnerPrivateKey } from "@latticexyz/common"; - const privateKey = getBurnerWallet().value; - const privateKey = getBurnerPrivateKey();
-
All functions from
std-client
that depended on v1 network code are removed (most notablysetupMUDNetwork
andsetupMUDV2Network
). Consumers should upgrade to v2 networking code from@latticexyz/store-sync
. -
The following functions are removed from
std-client
because they are very use-case specific and depend on deprecated code:getCurrentTurn
,getTurnAtTime
,getGameConfig
,isUntraversable
,getPlayerEntity
,resolveRelationshipChain
,findEntityWithComponentInRelationshipChain
,findInRelationshipChain
. Consumers should vendor these functions if they are still needed. -
Remaining exports from
std-client
are moved to/deprecated
. The package will be removed in a future release (once there are replacements for the deprecated exports).- import { ... } from "@latticexyz/std-client"; + import { ... } from "@latticexyz/std-client/deprecated";
-
@latticexyz/world@2.0.0-next.3
Major Changes
-
#1174
952cd534
Thanks @alvrs! - AllStore
methods now require the table's value schema to be passed in as an argument instead of loading it from storage.
This decreases gas cost and removes circular dependencies of the Schema table (where it was not possible to write to the Schema table before the Schema table was registered).function setRecord( bytes32 table, bytes32[] calldata key, bytes calldata data, + Schema valueSchema ) external;
The same diff applies to
getRecord
,getField
,setField
,pushToField
,popFromField
,updateInField
, anddeleteRecord
.This change only requires changes in downstream projects if the
Store
methods were accessed directly. In most cases it is fully abstracted in the generated table libraries,
so downstream projects only need to regenerate their table libraries after updating MUD. -
#1208
c32a9269
Thanks @alvrs! - - AllWorld
function selectors that previously hadbytes16 namespace, bytes16 name
arguments now usebytes32 resourceSelector
instead.
This includessetRecord
,setField
,pushToField
,popFromField
,updateInField
,deleteRecord
,call
,grantAccess
,revokeAccess
,registerTable
,
registerStoreHook
,registerSystemHook
,registerFunctionSelector
,registerSystem
andregisterRootFunctionSelector
.
This change aligns theWorld
function selectors with theStore
function selectors, reduces clutter, reduces gas cost and reduces theWorld
's contract size.-
The
World
'sregisterHook
function is removed. UseregisterStoreHook
orregisterSystemHook
instead. -
The
deploy
script is updated to integrate the World interface changes
-
-
#1311
331f0d63
Thanks @alvrs! - TheSnapSyncModule
is removed. The recommended way of loading the initial state of a MUD app is via the newstore-indexer
. Loading state via contract getter functions is not recommended, as it's computationally heavy on the RPC, can't be cached, and is an easy way to shoot yourself in the foot with exploding RPC costs.The
@latticexyz/network
package was deprecated and is now removed. All consumers should upgrade to the new sync stack from@latticexyz/store-sync
. -
#1182
afaf2f5f
Thanks @alvrs! - -Store
's internal schema table is now a normal table instead of using special code paths. It is renamed to Tables, and the table ID changed frommudstore:schema
tomudstore:Tables
-
Store
'sregisterSchema
andsetMetadata
are combined into a singleregisterTable
method. This means metadata (key names, field names) is immutable and indexers can create tables with this metadata when a new table is registered on-chain.- function registerSchema(bytes32 table, Schema schema, Schema keySchema) external; - - function setMetadata(bytes32 table, string calldata tableName, string[] calldata fieldNames) external; + function registerTable( + bytes32 table, + Schema keySchema, + Schema valueSchema, + string[] calldata keyNames, + string[] calldata fieldNames + ) external;
-
World
'sregisterTable
method is updated to match theStore
interface,setMetadata
is removed -
The
getSchema
method is renamed togetValueSchema
on all interfaces- function getSchema(bytes32 table) external view returns (Schema schema); + function getValueSchema(bytes32 table) external view returns (Schema valueSchema);
-
The
store-sync
andcli
packages are updated to integrate the breaking protocol changes. Downstream projects only need to manually integrate these changes if they access low levelStore
orWorld
functions. Otherwise, a fresh deploy with the latest MUD will get you these changes.
-
Patch Changes
-
#1231
433078c5
Thanks @dk1a! - Reverse PackedCounter encoding, to optimize gas for bitshifts.
Ints are right-aligned, shifting using an index is straightforward if they are indexed right-to-left.- Previous encoding: (7 bytes | accumulator),(5 bytes | counter 1),...,(5 bytes | counter 5)
- New encoding: (5 bytes | counter 5),...,(5 bytes | counter 1),(7 bytes | accumulator)
-
#1252
0d12db8c
Thanks @dk1a! - Optimize Schema methods.
Returnuint256
instead ofuint8
in SchemaInstance numFields methods -
Updated dependencies [
952cd534
,bb6ada74
,d5b73b12
,433078c5
,afaf2f5f
,0d12db8c
,331f0d63
]:- @latticexyz/store@2.0.0-next.3
- @latticexyz/common@2.0.0-next.3
- @latticexyz/config@2.0.0-next.3
- @latticexyz/gas-report@2.0.0-next.3
- @latticexyz/schema-type@2.0.0-next.3
@latticexyz/utils@2.0.0-next.3
@latticexyz/utils@2.0.0-next.3