Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages (next) #1444

Merged
merged 1 commit into from
Sep 12, 2023
Merged

Version Packages (next) #1444

merged 1 commit into from
Sep 12, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 11, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

main is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on main.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@latticexyz/[email protected]

Major Changes

  • #1458 b9e562d8 Thanks @alvrs! - The World now performs ERC165 interface checks to ensure that the StoreHook, SystemHook, System, DelegationControl and Module contracts to actually implement their respective interfaces before registering them in the World.

    The required supportsInterface methods are implemented on the respective base contracts.
    When creating one of these contracts, the recommended approach is to extend the base contract rather than the interface.

    - import { IStoreHook } from "@latticexyz/store/src/IStore.sol";
    + import { StoreHook } from "@latticexyz/store/src/StoreHook.sol";
    
    - contract MyStoreHook is IStoreHook {}
    + contract MyStoreHook is StoreHook {}
    - import { ISystemHook } from "@latticexyz/world/src/interfaces/ISystemHook.sol";
    + import { SystemHook } from "@latticexyz/world/src/SystemHook.sol";
    
    - contract MySystemHook is ISystemHook {}
    + contract MySystemHook is SystemHook {}
    - import { IDelegationControl } from "@latticexyz/world/src/interfaces/IDelegationControl.sol";
    + import { DelegationControl } from "@latticexyz/world/src/DelegationControl.sol";
    
    - contract MyDelegationControl is IDelegationControl {}
    + contract MyDelegationControl is DelegationControl {}
    - import { IModule } from "@latticexyz/world/src/interfaces/IModule.sol";
    + import { Module } from "@latticexyz/world/src/Module.sol";
    
    - contract MyModule is IModule {}
    + contract MyModule is Module {}

Minor Changes

  • #1422 1d60930d Thanks @alvrs! - It is now possible to unregister Store hooks and System hooks.

    interface IStore {
      function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external;
      // ...
    }
    
    interface IWorld {
      function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external;
      // ...
    }
  • #1443 5e71e1cb Thanks @holic! - Moved KeySchema, ValueSchema, SchemaToPrimitives and TableRecord types into @latticexyz/protocol-parser

Patch Changes

@latticexyz/[email protected]

Major Changes

  • #1458 b9e562d8 Thanks @alvrs! - The World now performs ERC165 interface checks to ensure that the StoreHook, SystemHook, System, DelegationControl and Module contracts to actually implement their respective interfaces before registering them in the World.

    The required supportsInterface methods are implemented on the respective base contracts.
    When creating one of these contracts, the recommended approach is to extend the base contract rather than the interface.

    - import { IStoreHook } from "@latticexyz/store/src/IStore.sol";
    + import { StoreHook } from "@latticexyz/store/src/StoreHook.sol";
    
    - contract MyStoreHook is IStoreHook {}
    + contract MyStoreHook is StoreHook {}
    - import { ISystemHook } from "@latticexyz/world/src/interfaces/ISystemHook.sol";
    + import { SystemHook } from "@latticexyz/world/src/SystemHook.sol";
    
    - contract MySystemHook is ISystemHook {}
    + contract MySystemHook is SystemHook {}
    - import { IDelegationControl } from "@latticexyz/world/src/interfaces/IDelegationControl.sol";
    + import { DelegationControl } from "@latticexyz/world/src/DelegationControl.sol";
    
    - contract MyDelegationControl is IDelegationControl {}
    + contract MyDelegationControl is DelegationControl {}
    - import { IModule } from "@latticexyz/world/src/interfaces/IModule.sol";
    + import { Module } from "@latticexyz/world/src/Module.sol";
    
    - contract MyModule is IModule {}
    + contract MyModule is Module {}
  • #1457 51914d65 Thanks @alvrs! - - 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.

    - 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.
  • #1425 2ca75f9b Thanks @alvrs! - 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).

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

Minor Changes

  • #1422 1d60930d Thanks @alvrs! - It is now possible to unregister Store hooks and System hooks.

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

Patch Changes

@latticexyz/[email protected]

Minor Changes

  • #1443 5e71e1cb Thanks @holic! - 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.

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

Patch Changes

@latticexyz/[email protected]

[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

[email protected]

[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@latticexyz/[email protected]

@github-actions github-actions bot force-pushed the changeset-release/main branch from d40145f to b4fd230 Compare September 11, 2023 10:34
@github-actions github-actions bot force-pushed the changeset-release/main branch from b4fd230 to 8b5b422 Compare September 11, 2023 10:45
@github-actions github-actions bot force-pushed the changeset-release/main branch from 8b5b422 to 95c2f0e Compare September 11, 2023 22:57
@github-actions github-actions bot force-pushed the changeset-release/main branch from 95c2f0e to 0cc633a Compare September 12, 2023 09:21
@github-actions github-actions bot force-pushed the changeset-release/main branch from 0cc633a to 8a14e29 Compare September 12, 2023 11:37
@github-actions github-actions bot force-pushed the changeset-release/main branch from 8a14e29 to 4fa61b9 Compare September 12, 2023 15:26
@github-actions github-actions bot force-pushed the changeset-release/main branch from 4fa61b9 to b154cb9 Compare September 12, 2023 17:13
@github-actions github-actions bot force-pushed the changeset-release/main branch from b154cb9 to 25a59b4 Compare September 12, 2023 21:16
@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from a0311c3 to 018fdea Compare September 12, 2023 21:50
@github-actions github-actions bot force-pushed the changeset-release/main branch from 018fdea to ed5af5f Compare September 12, 2023 21:52
@alvrs alvrs merged commit 1efccab into main Sep 12, 2023
@alvrs alvrs deleted the changeset-release/main branch September 12, 2023 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant