Skip to content

Commit

Permalink
Version Packages (next)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 12, 2023
1 parent 51914d6 commit 25a59b4
Show file tree
Hide file tree
Showing 59 changed files with 403 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"clever-rats-sip",
"cool-snakes-reply",
"dirty-items-retire",
"dry-chicken-love",
"eighty-tigers-argue",
"empty-planes-kiss",
"fast-ears-hug",
Expand Down Expand Up @@ -70,6 +71,7 @@
"mean-pans-study",
"metal-cats-double",
"metal-wombats-judge",
"mighty-eels-type",
"modern-bikes-build",
"modern-hornets-jam",
"nasty-waves-divide",
Expand All @@ -80,6 +82,7 @@
"perfect-mangos-cry",
"pink-fans-nail",
"pink-horses-deny",
"pink-tips-give",
"pretty-hotels-drop",
"quick-numbers-flash",
"quiet-squids-share",
Expand All @@ -106,13 +109,15 @@
"tame-lemons-play",
"thin-buses-reply",
"tricky-carrots-talk",
"tricky-comics-remain",
"tricky-frogs-beam",
"tricky-kangaroos-love",
"tricky-olives-stare",
"tricky-oranges-pump",
"twenty-birds-scream",
"unlucky-guests-cover",
"weak-mails-cross",
"wicked-tigers-return",
"wild-gorillas-care",
"witty-jokes-serve",
"witty-tigers-rest"
Expand Down
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
## Version 2.0.0-next.8

### Major changes

**[feat(world): change requireOwnerOrSelf to requireOwner (#1457)](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670)** (@latticexyz/world)

- The access control library no longer allows calls by the `World` contract to itself to bypass the ownership check.
This is a breaking change for root modules that relied on this mechanism to register root tables, systems or function selectors.
To upgrade, root modules must use `delegatecall` instead of a regular `call` to install root tables, systems or function selectors.

```diff
- world.registerSystem(rootSystemId, rootSystemAddress);
+ address(world).delegatecall(abi.encodeCall(world.registerSystem, (rootSystemId, rootSystemAddress)));
```

- An `installRoot` method was added to the `IModule` interface.
This method is now called when installing a root module via `world.installRootModule`.
When installing non-root modules via `world.installModule`, the module's `install` function continues to be called.

**[feat(world): add Balance table and BalanceTransferSystem (#1425)](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0)** (@latticexyz/world)

The World now maintains a balance per namespace.
When a system is called with value, the value stored in the World contract and credited to the system's namespace.

Previously, the World contract did not store value, but passed it on to the system contracts.
However, as systems are expected to be stateless (reading/writing state only via the calling World) and can be registered in multiple Worlds, this could have led to exploits.

Any address with access to a namespace can use the balance of that namespace.
This allows all systems registered in the same namespace to work with the same balance.

There are two new World methods to transfer balance between namespaces (`transferBalanceToNamespace`) or to an address (`transferBalanceToAddress`).

```solidity
interface IBaseWorld {
function transferBalanceToNamespace(bytes16 fromNamespace, bytes16 toNamespace, uint256 amount) external;
function transferBalanceToAddress(bytes16 fromNamespace, address toAddress, uint256 amount) external;
}
```

### Minor changes

**[feat(store,world): add ability to unregister hooks (#1422)](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7)** (@latticexyz/store, @latticexyz/world)

It is now possible to unregister Store hooks and System hooks.

```solidity
interface IStore {
function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external;
// ...
}
interface IWorld {
function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external;
// ...
}
```

**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/store)

Moved `KeySchema`, `ValueSchema`, `SchemaToPrimitives` and `TableRecord` types into `@latticexyz/protocol-parser`

**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/protocol-parser)

Adds `decodeKey`, `decodeValue`, `encodeKey`, and `encodeValue` helpers to decode/encode from key/value schemas. Deprecates previous methods that use a schema object with static/dynamic field arrays, originally attempting to model our on-chain behavior but ended up not very ergonomic when working with table configs.

---

## Version 2.0.0-next.7

### Major changes
Expand Down
68 changes: 68 additions & 0 deletions docs/pages/changelog.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
## Version 2.0.0-next.8

### Major changes

**[feat(world): change requireOwnerOrSelf to requireOwner (#1457)](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670)** (@latticexyz/world)

- The access control library no longer allows calls by the `World` contract to itself to bypass the ownership check.
This is a breaking change for root modules that relied on this mechanism to register root tables, systems or function selectors.
To upgrade, root modules must use `delegatecall` instead of a regular `call` to install root tables, systems or function selectors.

```diff
- world.registerSystem(rootSystemId, rootSystemAddress);
+ address(world).delegatecall(abi.encodeCall(world.registerSystem, (rootSystemId, rootSystemAddress)));
```

- An `installRoot` method was added to the `IModule` interface.
This method is now called when installing a root module via `world.installRootModule`.
When installing non-root modules via `world.installModule`, the module's `install` function continues to be called.

**[feat(world): add Balance table and BalanceTransferSystem (#1425)](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0)** (@latticexyz/world)

The World now maintains a balance per namespace.
When a system is called with value, the value stored in the World contract and credited to the system's namespace.

Previously, the World contract did not store value, but passed it on to the system contracts.
However, as systems are expected to be stateless (reading/writing state only via the calling World) and can be registered in multiple Worlds, this could have led to exploits.

Any address with access to a namespace can use the balance of that namespace.
This allows all systems registered in the same namespace to work with the same balance.

There are two new World methods to transfer balance between namespaces (`transferBalanceToNamespace`) or to an address (`transferBalanceToAddress`).

```solidity
interface IBaseWorld {
function transferBalanceToNamespace(bytes16 fromNamespace, bytes16 toNamespace, uint256 amount) external;
function transferBalanceToAddress(bytes16 fromNamespace, address toAddress, uint256 amount) external;
}
```

### Minor changes

**[feat(store,world): add ability to unregister hooks (#1422)](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7)** (@latticexyz/store, @latticexyz/world)

It is now possible to unregister Store hooks and System hooks.

```solidity
interface IStore {
function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external;
// ...
}
interface IWorld {
function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external;
// ...
}
```

**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/store)

Moved `KeySchema`, `ValueSchema`, `SchemaToPrimitives` and `TableRecord` types into `@latticexyz/protocol-parser`

**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/protocol-parser)

Adds `decodeKey`, `decodeValue`, `encodeKey`, and `encodeValue` helpers to decode/encode from key/value schemas. Deprecates previous methods that use a schema object with static/dynamic field arrays, originally attempting to model our on-chain behavior but ended up not very ergonomic when working with table configs.

---

## Version 2.0.0-next.7

### Major changes
Expand Down
2 changes: 2 additions & 0 deletions packages/abi-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @latticexyz/abi-ts

## 2.0.0-next.8

## 2.0.0-next.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/abi-ts",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.",
"repository": {
"type": "git",
Expand Down
9 changes: 9 additions & 0 deletions packages/block-logs-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @latticexyz/block-logs-stream

## 2.0.0-next.8

### Patch Changes

- Updated dependencies []:
- @latticexyz/common@2.0.0-next.8
- @latticexyz/config@2.0.0-next.8
- @latticexyz/schema-type@2.0.0-next.8

## 2.0.0-next.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/block-logs-stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/block-logs-stream",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Create a stream of EVM block logs for events",
"repository": {
"type": "git",
Expand Down
16 changes: 16 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## 2.0.0-next.8

### Patch Changes

- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`51914d65`](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670), [`2ca75f9b`](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]:
- @latticexyz/store@2.0.0-next.8
- @latticexyz/world@2.0.0-next.8
- @latticexyz/protocol-parser@2.0.0-next.8
- @latticexyz/abi-ts@2.0.0-next.8
- @latticexyz/common@2.0.0-next.8
- @latticexyz/config@2.0.0-next.8
- @latticexyz/gas-report@2.0.0-next.8
- @latticexyz/schema-type@2.0.0-next.8
- @latticexyz/services@2.0.0-next.8
- @latticexyz/utils@2.0.0-next.8

## 2.0.0-next.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/cli",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Command line interface for mud",
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 2.0.0-next.8

### Patch Changes

- Updated dependencies []:
- @latticexyz/schema-type@2.0.0-next.8

## 2.0.0-next.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/common",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Common low level logic shared between packages",
"repository": {
"type": "git",
Expand Down
8 changes: 8 additions & 0 deletions packages/config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.0-next.8

### Patch Changes

- Updated dependencies []:
- @latticexyz/common@2.0.0-next.8
- @latticexyz/schema-type@2.0.0-next.8

## 2.0.0-next.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/config",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Config for Store and World",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions packages/create-mud/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 2.0.0-next.8

## 2.0.0-next.7

## 2.0.0-next.6
Expand Down
2 changes: 1 addition & 1 deletion packages/create-mud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-mud",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Create a new MUD project",
"license": "MIT",
"author": "Lattice <[email protected]>",
Expand Down
13 changes: 13 additions & 0 deletions packages/dev-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @latticexyz/dev-tools

## 2.0.0-next.8

### Patch Changes

- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`51914d65`](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670), [`2ca75f9b`](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]:
- @latticexyz/store@2.0.0-next.8
- @latticexyz/world@2.0.0-next.8
- @latticexyz/react@2.0.0-next.8
- @latticexyz/store-sync@2.0.0-next.8
- @latticexyz/common@2.0.0-next.8
- @latticexyz/recs@2.0.0-next.8
- @latticexyz/utils@2.0.0-next.8

## 2.0.0-next.7

### Patch Changes
Expand Down
14 changes: 7 additions & 7 deletions packages/dev-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/dev-tools",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "MUD developer tools",
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,12 +51,12 @@
"vitest": "0.31.4"
},
"peerDependencies": {
"@latticexyz/common": "2.0.0-next.7",
"@latticexyz/recs": "2.0.0-next.7",
"@latticexyz/store": "2.0.0-next.7",
"@latticexyz/store-sync": "2.0.0-next.7",
"@latticexyz/utils": "2.0.0-next.7",
"@latticexyz/world": "2.0.0-next.7"
"@latticexyz/common": "2.0.0-next.8",
"@latticexyz/recs": "2.0.0-next.8",
"@latticexyz/store": "2.0.0-next.8",
"@latticexyz/store-sync": "2.0.0-next.8",
"@latticexyz/utils": "2.0.0-next.8",
"@latticexyz/world": "2.0.0-next.8"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 2 additions & 0 deletions packages/ecs-browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @latticexyz/ecs-browser

## 2.0.0-next.8

## 2.0.0-next.7

## 2.0.0-next.6
Expand Down
2 changes: 1 addition & 1 deletion packages/ecs-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@latticexyz/ecs-browser",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"private": true
}
2 changes: 2 additions & 0 deletions packages/gas-report/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 2.0.0-next.8

## 2.0.0-next.7

## 2.0.0-next.6
Expand Down
2 changes: 1 addition & 1 deletion packages/gas-report/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@latticexyz/gas-report",
"version": "2.0.0-next.7",
"version": "2.0.0-next.8",
"description": "Gas reporter for specific lines within forge tests",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions packages/network/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @latticexyz/network

## 2.0.0-next.8

## 2.0.0-next.7

## 2.0.0-next.6
Expand Down
Loading

0 comments on commit 25a59b4

Please sign in to comment.