diff --git a/.changeset/pre.json b/.changeset/pre.json index 88e04ea614..5595226dfc 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -93,6 +93,7 @@ "fifty-squids-eat", "fifty-suits-itch", "fifty-suits-shout", + "five-emus-battle", "flat-trainers-marry", "fluffy-days-carry", "fluffy-moles-march", @@ -133,6 +134,7 @@ "large-sloths-camp", "late-cobras-ring", "late-geese-guess", + "late-rats-hide", "late-spies-cover", "lazy-ladybugs-return", "lemon-zoos-mate", @@ -157,6 +159,7 @@ "mighty-eels-type", "mighty-years-whisper", "modern-bikes-build", + "modern-brooms-rule", "modern-hornets-jam", "modern-stingrays-kneel", "modern-trains-remain", @@ -188,6 +191,7 @@ "poor-waves-occur", "popular-coins-invent", "pretty-hotels-drop", + "pretty-toys-rescue", "proud-insects-perform", "proud-turkeys-compete", "purple-ghosts-hear", @@ -309,6 +313,7 @@ "witty-tigers-rest", "yellow-bags-learn", "young-crabs-rest", - "young-pandas-explode" + "young-pandas-explode", + "young-poets-beam" ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 85c776c8f9..c7cc9bc6a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,73 @@ +## Version 2.0.0-next.16 + +Release date: Thu Jan 11 2024 + +### Major changes + +**[feat(world): require namespace to exist before registering systems/tables in it [C-01] (#2007)](https://github.com/latticexyz/mud/commit/063daf80ef9aa9151903061fc7d80c170a96cb07)** (@latticexyz/cli, @latticexyz/world-modules, @latticexyz/world) + +Previously `registerSystem` and `registerTable` had a side effect of registering namespaces if the system or table's namespace didn't exist yet. +This caused a possible frontrunning issue, where an attacker could detect a `registerSystem`/`registerTable` transaction in the mempool, +insert a `registerNamespace` transaction before it, grant themselves access to the namespace, transfer ownership of the namespace to the victim, +so that the `registerSystem`/`registerTable` transactions still went through successfully. +To mitigate this issue, the side effect of registering a namespace in `registerSystem` and `registerTable` has been removed. +Calls to these functions now expect the respective namespace to exist and the caller to own the namespace, otherwise they revert. + +Changes in consuming projects are only necessary if tables or systems are registered manually. +If only the MUD deployer is used to register tables and systems, no changes are necessary, as the MUD deployer has been updated accordingly. + +```diff ++ world.registerNamespace(namespaceId); + world.registerSystem(systemId, system, true); +``` + +```diff ++ world.registerNamespace(namespaceId); + MyTable.register(); +``` + +**[feat(store-indexer, store-sync): improve query performance and enable compression, add new api (#2026)](https://github.com/latticexyz/mud/commit/4c1dcd81eae44c37f66bd80871daf02834c04fb5)** (@latticexyz/store-sync) + +Postgres storage adapter now uses snake case for decoded table names and column names. This allows for better SQL ergonomics when querying these tables. + +To avoid naming conflicts for now, schemas are still case-sensitive and need to be queried with double quotes. We may change this in the future with [namespace validation](https://github.com/latticexyz/mud/issues/1991). + +### Minor changes + +**[feat(store): improve FieldLayout errors [N-03] (#2114)](https://github.com/latticexyz/mud/commit/103f635ebc20ac1aecc5c526c4bcb928e860a7ed)** (@latticexyz/store) + +Improved error messages for invalid `FieldLayout`s + +```diff +-error FieldLayoutLib_InvalidLength(uint256 length); ++error FieldLayoutLib_TooManyFields(uint256 numFields, uint256 maxFields); ++error FieldLayoutLib_TooManyDynamicFields(uint256 numFields, uint256 maxFields); ++error FieldLayoutLib_Empty(); +``` + +### Patch changes + +**[refactor(world): use \_getSystem when fetching system addresses [N-11] (#2022)](https://github.com/latticexyz/mud/commit/c207d35e822afe5f04225d6854fb039116cc7840)** (@latticexyz/world) + +Optimised `StoreRegistrationSystem` and `WorldRegistrationSystem` by fetching individual fields instead of entire records where possible. + +**[fix(world): module supports world context consumer id [L-12] (#2032)](https://github.com/latticexyz/mud/commit/f6f402896d8256da3b868f865a960db68393caf4)** (@latticexyz/world) + +Added the WorldContextConsumer interface ID to `supportsInterface` in the Module contract. + +**[refactor(store): order load function arguments [N-02] (#2033)](https://github.com/latticexyz/mud/commit/9f8b84e733412323103fdd81067f8edc9d681a17)** (@latticexyz/store) + +Aligned the order of function arguments in the `Storage` library. + +```solidity +store(uint256 storagePointer, uint256 offset, bytes memory data) +store(uint256 storagePointer, uint256 offset, uint256 length, uint256 memoryPointer) +load(uint256 storagePointer, uint256 offset, uint256 length) +load(uint256 storagePointer, uint256 offset, uint256 length, uint256 memoryPointer) +``` + +--- + ## Version 2.0.0-next.15 Release date: Wed Jan 03 2024 diff --git a/docs/pages/changelog.mdx b/docs/pages/changelog.mdx index 85c776c8f9..c7cc9bc6a4 100644 --- a/docs/pages/changelog.mdx +++ b/docs/pages/changelog.mdx @@ -1,3 +1,73 @@ +## Version 2.0.0-next.16 + +Release date: Thu Jan 11 2024 + +### Major changes + +**[feat(world): require namespace to exist before registering systems/tables in it [C-01] (#2007)](https://github.com/latticexyz/mud/commit/063daf80ef9aa9151903061fc7d80c170a96cb07)** (@latticexyz/cli, @latticexyz/world-modules, @latticexyz/world) + +Previously `registerSystem` and `registerTable` had a side effect of registering namespaces if the system or table's namespace didn't exist yet. +This caused a possible frontrunning issue, where an attacker could detect a `registerSystem`/`registerTable` transaction in the mempool, +insert a `registerNamespace` transaction before it, grant themselves access to the namespace, transfer ownership of the namespace to the victim, +so that the `registerSystem`/`registerTable` transactions still went through successfully. +To mitigate this issue, the side effect of registering a namespace in `registerSystem` and `registerTable` has been removed. +Calls to these functions now expect the respective namespace to exist and the caller to own the namespace, otherwise they revert. + +Changes in consuming projects are only necessary if tables or systems are registered manually. +If only the MUD deployer is used to register tables and systems, no changes are necessary, as the MUD deployer has been updated accordingly. + +```diff ++ world.registerNamespace(namespaceId); + world.registerSystem(systemId, system, true); +``` + +```diff ++ world.registerNamespace(namespaceId); + MyTable.register(); +``` + +**[feat(store-indexer, store-sync): improve query performance and enable compression, add new api (#2026)](https://github.com/latticexyz/mud/commit/4c1dcd81eae44c37f66bd80871daf02834c04fb5)** (@latticexyz/store-sync) + +Postgres storage adapter now uses snake case for decoded table names and column names. This allows for better SQL ergonomics when querying these tables. + +To avoid naming conflicts for now, schemas are still case-sensitive and need to be queried with double quotes. We may change this in the future with [namespace validation](https://github.com/latticexyz/mud/issues/1991). + +### Minor changes + +**[feat(store): improve FieldLayout errors [N-03] (#2114)](https://github.com/latticexyz/mud/commit/103f635ebc20ac1aecc5c526c4bcb928e860a7ed)** (@latticexyz/store) + +Improved error messages for invalid `FieldLayout`s + +```diff +-error FieldLayoutLib_InvalidLength(uint256 length); ++error FieldLayoutLib_TooManyFields(uint256 numFields, uint256 maxFields); ++error FieldLayoutLib_TooManyDynamicFields(uint256 numFields, uint256 maxFields); ++error FieldLayoutLib_Empty(); +``` + +### Patch changes + +**[refactor(world): use \_getSystem when fetching system addresses [N-11] (#2022)](https://github.com/latticexyz/mud/commit/c207d35e822afe5f04225d6854fb039116cc7840)** (@latticexyz/world) + +Optimised `StoreRegistrationSystem` and `WorldRegistrationSystem` by fetching individual fields instead of entire records where possible. + +**[fix(world): module supports world context consumer id [L-12] (#2032)](https://github.com/latticexyz/mud/commit/f6f402896d8256da3b868f865a960db68393caf4)** (@latticexyz/world) + +Added the WorldContextConsumer interface ID to `supportsInterface` in the Module contract. + +**[refactor(store): order load function arguments [N-02] (#2033)](https://github.com/latticexyz/mud/commit/9f8b84e733412323103fdd81067f8edc9d681a17)** (@latticexyz/store) + +Aligned the order of function arguments in the `Storage` library. + +```solidity +store(uint256 storagePointer, uint256 offset, bytes memory data) +store(uint256 storagePointer, uint256 offset, uint256 length, uint256 memoryPointer) +load(uint256 storagePointer, uint256 offset, uint256 length) +load(uint256 storagePointer, uint256 offset, uint256 length, uint256 memoryPointer) +``` + +--- + ## Version 2.0.0-next.15 Release date: Wed Jan 03 2024 diff --git a/packages/abi-ts/CHANGELOG.md b/packages/abi-ts/CHANGELOG.md index 2d7c62a3b7..7ef1deccbc 100644 --- a/packages/abi-ts/CHANGELOG.md +++ b/packages/abi-ts/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/abi-ts +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/abi-ts/package.json b/packages/abi-ts/package.json index af7a5bdbe8..25c70bc8dc 100644 --- a/packages/abi-ts/package.json +++ b/packages/abi-ts/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/abi-ts", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.", "repository": { "type": "git", diff --git a/packages/block-logs-stream/CHANGELOG.md b/packages/block-logs-stream/CHANGELOG.md index d569e4b1f8..a486f7b315 100644 --- a/packages/block-logs-stream/CHANGELOG.md +++ b/packages/block-logs-stream/CHANGELOG.md @@ -1,5 +1,11 @@ # @latticexyz/block-logs-stream +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/common@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 7bf1c53a90..3361b4987c 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/block-logs-stream", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Create a stream of EVM block logs for events", "repository": { "type": "git", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 5d7467f4c7..29027d9ad8 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,46 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- 063daf80: Previously `registerSystem` and `registerTable` had a side effect of registering namespaces if the system or table's namespace didn't exist yet. + This caused a possible frontrunning issue, where an attacker could detect a `registerSystem`/`registerTable` transaction in the mempool, + insert a `registerNamespace` transaction before it, grant themselves access to the namespace, transfer ownership of the namespace to the victim, + so that the `registerSystem`/`registerTable` transactions still went through successfully. + To mitigate this issue, the side effect of registering a namespace in `registerSystem` and `registerTable` has been removed. + Calls to these functions now expect the respective namespace to exist and the caller to own the namespace, otherwise they revert. + + Changes in consuming projects are only necessary if tables or systems are registered manually. + If only the MUD deployer is used to register tables and systems, no changes are necessary, as the MUD deployer has been updated accordingly. + + ```diff + + world.registerNamespace(namespaceId); + world.registerSystem(systemId, system, true); + ``` + + ```diff + + world.registerNamespace(namespaceId); + MyTable.register(); + ``` + +- Updated dependencies [c207d35e] +- Updated dependencies [f6f40289] +- Updated dependencies [063daf80] +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/world@2.0.0-next.16 + - @latticexyz/world-modules@2.0.0-next.16 + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/abi-ts@2.0.0-next.16 + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/config@2.0.0-next.16 + - @latticexyz/gas-report@2.0.0-next.16 + - @latticexyz/protocol-parser@2.0.0-next.16 + - @latticexyz/schema-type@2.0.0-next.16 + - @latticexyz/services@2.0.0-next.16 + - @latticexyz/utils@2.0.0-next.16 + ## 2.0.0-next.15 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 00d29ef8ab..3867c1bcdc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/cli", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Command line interface for mud", "repository": { "type": "git", diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 7e9b5a1ddf..ef40e2b793 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Minor Changes diff --git a/packages/common/package.json b/packages/common/package.json index d1210cab66..12cc8d3f4f 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/common", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Common low level logic shared between packages", "repository": { "type": "git", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index e56ccb1e9a..8b2ca78ebd 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/common@2.0.0-next.16 +- @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/config/package.json b/packages/config/package.json index 09d81ca858..5a6bb45837 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/config", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Config for Store and World", "repository": { "type": "git", diff --git a/packages/create-mud/CHANGELOG.md b/packages/create-mud/CHANGELOG.md index 05c0ad0903..1ac2caf09b 100644 --- a/packages/create-mud/CHANGELOG.md +++ b/packages/create-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Minor Changes diff --git a/packages/create-mud/package.json b/packages/create-mud/package.json index fd8231abea..d0eefb5833 100644 --- a/packages/create-mud/package.json +++ b/packages/create-mud/package.json @@ -1,6 +1,6 @@ { "name": "create-mud", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Create a new MUD project", "license": "MIT", "author": "Lattice ", diff --git a/packages/dev-tools/CHANGELOG.md b/packages/dev-tools/CHANGELOG.md index 349a38a7f9..4dd16dfae5 100644 --- a/packages/dev-tools/CHANGELOG.md +++ b/packages/dev-tools/CHANGELOG.md @@ -1,5 +1,23 @@ # @latticexyz/dev-tools +## 2.0.0-next.16 + +### Patch Changes + +- Updated dependencies [c207d35e] +- Updated dependencies [f6f40289] +- Updated dependencies [063daf80] +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/world@2.0.0-next.16 + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/store-sync@2.0.0-next.16 + - @latticexyz/react@2.0.0-next.16 + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/recs@2.0.0-next.16 + - @latticexyz/schema-type@2.0.0-next.16 + - @latticexyz/utils@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index f344d49660..9bd7f657bc 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/dev-tools", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "MUD developer tools", "repository": { "type": "git", @@ -51,12 +51,12 @@ "vitest": "0.31.4" }, "peerDependencies": { - "@latticexyz/common": "2.0.0-next.15", - "@latticexyz/recs": "2.0.0-next.15", - "@latticexyz/store": "2.0.0-next.15", - "@latticexyz/store-sync": "2.0.0-next.15", - "@latticexyz/utils": "2.0.0-next.15", - "@latticexyz/world": "2.0.0-next.15" + "@latticexyz/common": "2.0.0-next.16", + "@latticexyz/recs": "2.0.0-next.16", + "@latticexyz/store": "2.0.0-next.16", + "@latticexyz/store-sync": "2.0.0-next.16", + "@latticexyz/utils": "2.0.0-next.16", + "@latticexyz/world": "2.0.0-next.16" }, "publishConfig": { "access": "public" diff --git a/packages/ecs-browser/CHANGELOG.md b/packages/ecs-browser/CHANGELOG.md index af0e916506..e352e37742 100644 --- a/packages/ecs-browser/CHANGELOG.md +++ b/packages/ecs-browser/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/ecs-browser +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/ecs-browser/package.json b/packages/ecs-browser/package.json index 04e8d5ddfc..d8b1a38079 100644 --- a/packages/ecs-browser/package.json +++ b/packages/ecs-browser/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/ecs-browser", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "private": true } diff --git a/packages/faucet/CHANGELOG.md b/packages/faucet/CHANGELOG.md index ef8fdb4e53..cbccac65c1 100644 --- a/packages/faucet/CHANGELOG.md +++ b/packages/faucet/CHANGELOG.md @@ -1,5 +1,11 @@ # @latticexyz/faucet +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/common@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/faucet/package.json b/packages/faucet/package.json index c8d7f1d2f4..095228f3d0 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/faucet", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Faucet API for Lattice testnet", "repository": { "type": "git", diff --git a/packages/gas-report/CHANGELOG.md b/packages/gas-report/CHANGELOG.md index ae4fe7e56f..b2e74e5bc8 100644 --- a/packages/gas-report/CHANGELOG.md +++ b/packages/gas-report/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/gas-report/package.json b/packages/gas-report/package.json index 15bd01c24e..1a907d65bf 100644 --- a/packages/gas-report/package.json +++ b/packages/gas-report/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/gas-report", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Gas reporter for specific lines within forge tests", "repository": { "type": "git", diff --git a/packages/network/CHANGELOG.md b/packages/network/CHANGELOG.md index 7cb74ca85d..7e26a657e2 100644 --- a/packages/network/CHANGELOG.md +++ b/packages/network/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/network +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/network/package.json b/packages/network/package.json index 83d0f3cb12..80e98015fd 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/network", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "private": true } diff --git a/packages/noise/CHANGELOG.md b/packages/noise/CHANGELOG.md index 819bf65e11..790b66408c 100644 --- a/packages/noise/CHANGELOG.md +++ b/packages/noise/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/noise/package.json b/packages/noise/package.json index 271fc3d5cf..bf7ef3696a 100644 --- a/packages/noise/package.json +++ b/packages/noise/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/noise", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "license": "MIT", "type": "module", "exports": { diff --git a/packages/phaserx/CHANGELOG.md b/packages/phaserx/CHANGELOG.md index 1f0941a1e4..b951e18cbd 100644 --- a/packages/phaserx/CHANGELOG.md +++ b/packages/phaserx/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/utils@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/phaserx/package.json b/packages/phaserx/package.json index d542a65479..d3719f652e 100644 --- a/packages/phaserx/package.json +++ b/packages/phaserx/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/phaserx", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/protocol-parser/CHANGELOG.md b/packages/protocol-parser/CHANGELOG.md index 41d4cbeec1..59ce694b37 100644 --- a/packages/protocol-parser/CHANGELOG.md +++ b/packages/protocol-parser/CHANGELOG.md @@ -1,5 +1,12 @@ # @latticexyz/protocol-parser +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/common@2.0.0-next.16 +- @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 5998ab0796..8c6e45c892 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/protocol-parser", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Parser utilities for the MUD protocol", "repository": { "type": "git", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index f9f54d0d45..b56e0fcf3c 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/recs@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 1e10e97e20..fdf802cf97 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/react", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "React tools for MUD client.", "repository": { "type": "git", diff --git a/packages/recs/CHANGELOG.md b/packages/recs/CHANGELOG.md index 5a804cfe50..e055f7e24c 100644 --- a/packages/recs/CHANGELOG.md +++ b/packages/recs/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- @latticexyz/schema-type@2.0.0-next.16 +- @latticexyz/utils@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/recs/package.json b/packages/recs/package.json index 5bbf1f2dbe..3399f2ea5e 100644 --- a/packages/recs/package.json +++ b/packages/recs/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/recs", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/schema-type/CHANGELOG.md b/packages/schema-type/CHANGELOG.md index fc71a534b2..46c5d522cc 100644 --- a/packages/schema-type/CHANGELOG.md +++ b/packages/schema-type/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index 1cd8e70608..c5ab1fa746 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/schema-type", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "SchemaType enum for various languages", "repository": { "type": "git", diff --git a/packages/services/CHANGELOG.md b/packages/services/CHANGELOG.md index 7231f25b1c..7edb1b1d50 100644 --- a/packages/services/CHANGELOG.md +++ b/packages/services/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/services/package.json b/packages/services/package.json index b6a161967c..30bfa5a347 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/services", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "MUD services for enhanced interactions with on-chain ECS state", "repository": { "type": "git", diff --git a/packages/solecs/CHANGELOG.md b/packages/solecs/CHANGELOG.md index 5305ff9ccd..b669f5248f 100644 --- a/packages/solecs/CHANGELOG.md +++ b/packages/solecs/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/solecs +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/solecs/package.json b/packages/solecs/package.json index 2765d4a0b9..5a71b5d759 100644 --- a/packages/solecs/package.json +++ b/packages/solecs/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/solecs", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "private": true } diff --git a/packages/solhint-config-mud/CHANGELOG.md b/packages/solhint-config-mud/CHANGELOG.md index a3e220abf6..048b83363b 100644 --- a/packages/solhint-config-mud/CHANGELOG.md +++ b/packages/solhint-config-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/solhint-config-mud/package.json b/packages/solhint-config-mud/package.json index f1e4414595..07f238e97e 100644 --- a/packages/solhint-config-mud/package.json +++ b/packages/solhint-config-mud/package.json @@ -1,6 +1,6 @@ { "name": "solhint-config-mud", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/solhint-plugin-mud/CHANGELOG.md b/packages/solhint-plugin-mud/CHANGELOG.md index a3e220abf6..048b83363b 100644 --- a/packages/solhint-plugin-mud/CHANGELOG.md +++ b/packages/solhint-plugin-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/solhint-plugin-mud/package.json b/packages/solhint-plugin-mud/package.json index cd0068329f..131ae4263c 100644 --- a/packages/solhint-plugin-mud/package.json +++ b/packages/solhint-plugin-mud/package.json @@ -1,6 +1,6 @@ { "name": "solhint-plugin-mud", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/std-client/CHANGELOG.md b/packages/std-client/CHANGELOG.md index eb9510f9bb..30f9cae59e 100644 --- a/packages/std-client/CHANGELOG.md +++ b/packages/std-client/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/std-client +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/std-client/package.json b/packages/std-client/package.json index 21e5ce2973..b5bc843426 100644 --- a/packages/std-client/package.json +++ b/packages/std-client/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/std-client", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "private": true } diff --git a/packages/std-contracts/CHANGELOG.md b/packages/std-contracts/CHANGELOG.md index 583bc95046..dabff6b285 100644 --- a/packages/std-contracts/CHANGELOG.md +++ b/packages/std-contracts/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/std-contracts +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/std-contracts/package.json b/packages/std-contracts/package.json index e7438be91a..3f2f6d1413 100644 --- a/packages/std-contracts/package.json +++ b/packages/std-contracts/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/std-contracts", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "private": true } diff --git a/packages/store-cache/CHANGELOG.md b/packages/store-cache/CHANGELOG.md index 19b68e7882..bb8e646981 100644 --- a/packages/store-cache/CHANGELOG.md +++ b/packages/store-cache/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/store-cache +## 2.0.0-next.16 + ## 2.0.0-next.15 ## 2.0.0-next.14 diff --git a/packages/store-cache/package.json b/packages/store-cache/package.json index e6f6092e84..247d1aaa19 100644 --- a/packages/store-cache/package.json +++ b/packages/store-cache/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/store-cache", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "private": true } diff --git a/packages/store-indexer/CHANGELOG.md b/packages/store-indexer/CHANGELOG.md index b2caa28e7b..66639dfbda 100644 --- a/packages/store-indexer/CHANGELOG.md +++ b/packages/store-indexer/CHANGELOG.md @@ -1,5 +1,17 @@ # @latticexyz/store-indexer +## 2.0.0-next.16 + +### Patch Changes + +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/store-sync@2.0.0-next.16 + - @latticexyz/block-logs-stream@2.0.0-next.16 + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/protocol-parser@2.0.0-next.16 + ## 2.0.0-next.15 ### Major Changes diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index 112a5739b6..08ab6f246c 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store-indexer", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Minimal Typescript indexer for Store", "repository": { "type": "git", diff --git a/packages/store-sync/CHANGELOG.md b/packages/store-sync/CHANGELOG.md index 1874ad6d4e..e02cdd965d 100644 --- a/packages/store-sync/CHANGELOG.md +++ b/packages/store-sync/CHANGELOG.md @@ -1,5 +1,22 @@ # @latticexyz/store-sync +## 2.0.0-next.16 + +### Patch Changes + +- Updated dependencies [c207d35e] +- Updated dependencies [f6f40289] +- Updated dependencies [063daf80] +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/world@2.0.0-next.16 + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/block-logs-stream@2.0.0-next.16 + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/protocol-parser@2.0.0-next.16 + - @latticexyz/recs@2.0.0-next.16 + - @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Major Changes diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index e8600fce4d..75a392793f 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store-sync", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Utilities to sync MUD Store events with a client or cache", "repository": { "type": "git", diff --git a/packages/store/CHANGELOG.md b/packages/store/CHANGELOG.md index 6d3a3500c0..77712610f0 100644 --- a/packages/store/CHANGELOG.md +++ b/packages/store/CHANGELOG.md @@ -1,5 +1,33 @@ # Change Log +## 2.0.0-next.16 + +### Minor Changes + +- 103f635e: Improved error messages for invalid `FieldLayout`s + + ```diff + -error FieldLayoutLib_InvalidLength(uint256 length); + +error FieldLayoutLib_TooManyFields(uint256 numFields, uint256 maxFields); + +error FieldLayoutLib_TooManyDynamicFields(uint256 numFields, uint256 maxFields); + +error FieldLayoutLib_Empty(); + ``` + +### Patch Changes + +- 9f8b84e7: Aligned the order of function arguments in the `Storage` library. + + ```solidity + store(uint256 storagePointer, uint256 offset, bytes memory data) + store(uint256 storagePointer, uint256 offset, uint256 length, uint256 memoryPointer) + load(uint256 storagePointer, uint256 offset, uint256 length) + load(uint256 storagePointer, uint256 offset, uint256 length, uint256 memoryPointer) + ``` + + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/config@2.0.0-next.16 + - @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/store/package.json b/packages/store/package.json index 6f134c6652..5801260085 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "Store", "repository": { "type": "git", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 9012d6e6d0..06eaef412c 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index e699030564..b6add7f37e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/utils", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/world-modules/CHANGELOG.md b/packages/world-modules/CHANGELOG.md index a74ad2b6f7..432b1d24cf 100644 --- a/packages/world-modules/CHANGELOG.md +++ b/packages/world-modules/CHANGELOG.md @@ -1,5 +1,40 @@ # Change Log +## 2.0.0-next.16 + +### Patch Changes + +- 063daf80: Previously `registerSystem` and `registerTable` had a side effect of registering namespaces if the system or table's namespace didn't exist yet. + This caused a possible frontrunning issue, where an attacker could detect a `registerSystem`/`registerTable` transaction in the mempool, + insert a `registerNamespace` transaction before it, grant themselves access to the namespace, transfer ownership of the namespace to the victim, + so that the `registerSystem`/`registerTable` transactions still went through successfully. + To mitigate this issue, the side effect of registering a namespace in `registerSystem` and `registerTable` has been removed. + Calls to these functions now expect the respective namespace to exist and the caller to own the namespace, otherwise they revert. + + Changes in consuming projects are only necessary if tables or systems are registered manually. + If only the MUD deployer is used to register tables and systems, no changes are necessary, as the MUD deployer has been updated accordingly. + + ```diff + + world.registerNamespace(namespaceId); + world.registerSystem(systemId, system, true); + ``` + + ```diff + + world.registerNamespace(namespaceId); + MyTable.register(); + ``` + +- Updated dependencies [c207d35e] +- Updated dependencies [f6f40289] +- Updated dependencies [063daf80] +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/world@2.0.0-next.16 + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/config@2.0.0-next.16 + - @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/world-modules/package.json b/packages/world-modules/package.json index df07b475d6..45505f1312 100644 --- a/packages/world-modules/package.json +++ b/packages/world-modules/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/world-modules", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "World modules", "repository": { "type": "git", diff --git a/packages/world/CHANGELOG.md b/packages/world/CHANGELOG.md index 9c48d58f6a..a7b0b6a0bf 100644 --- a/packages/world/CHANGELOG.md +++ b/packages/world/CHANGELOG.md @@ -1,5 +1,40 @@ # Change Log +## 2.0.0-next.16 + +### Major Changes + +- 063daf80: Previously `registerSystem` and `registerTable` had a side effect of registering namespaces if the system or table's namespace didn't exist yet. + This caused a possible frontrunning issue, where an attacker could detect a `registerSystem`/`registerTable` transaction in the mempool, + insert a `registerNamespace` transaction before it, grant themselves access to the namespace, transfer ownership of the namespace to the victim, + so that the `registerSystem`/`registerTable` transactions still went through successfully. + To mitigate this issue, the side effect of registering a namespace in `registerSystem` and `registerTable` has been removed. + Calls to these functions now expect the respective namespace to exist and the caller to own the namespace, otherwise they revert. + + Changes in consuming projects are only necessary if tables or systems are registered manually. + If only the MUD deployer is used to register tables and systems, no changes are necessary, as the MUD deployer has been updated accordingly. + + ```diff + + world.registerNamespace(namespaceId); + world.registerSystem(systemId, system, true); + ``` + + ```diff + + world.registerNamespace(namespaceId); + MyTable.register(); + ``` + +### Patch Changes + +- c207d35e: Optimised `StoreRegistrationSystem` and `WorldRegistrationSystem` by fetching individual fields instead of entire records where possible. +- f6f40289: Added the WorldContextConsumer interface ID to `supportsInterface` in the Module contract. +- Updated dependencies [9f8b84e7] +- Updated dependencies [103f635e] + - @latticexyz/store@2.0.0-next.16 + - @latticexyz/common@2.0.0-next.16 + - @latticexyz/config@2.0.0-next.16 + - @latticexyz/schema-type@2.0.0-next.16 + ## 2.0.0-next.15 ### Patch Changes diff --git a/packages/world/package.json b/packages/world/package.json index d19d01d1d6..65cd8e2ac7 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/world", - "version": "2.0.0-next.15", + "version": "2.0.0-next.16", "description": "World framework", "repository": { "type": "git",