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) #2088

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Version Packages (next) #2088

merged 1 commit into from
Jan 23, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 4, 2024

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

  • 57d8965: Separated core systems deployment from CoreModule, and added the systems as arguments to CoreModule

Patch Changes

  • 063daf8: 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.

    +  world.registerNamespace(namespaceId);
       world.registerSystem(systemId, system, true);
    +  world.registerNamespace(namespaceId);
       MyTable.register();
  • Updated dependencies [c6c13f2]

  • Updated dependencies [eaa766e]

  • Updated dependencies [0f27afd]

  • Updated dependencies [865253d]

  • Updated dependencies [e6c03a8]

  • Updated dependencies [c207d35]

  • Updated dependencies [d00c4a9]

  • Updated dependencies [37c228c]

  • Updated dependencies [1bf2e90]

  • Updated dependencies [f6f4028]

  • Updated dependencies [08b4221]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [063daf8]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [2bfee92]

  • Updated dependencies [7b28d32]

  • Updated dependencies [9f8b84e]

  • Updated dependencies [aee8020]

  • Updated dependencies [ad4ac44]

  • Updated dependencies [57d8965]

  • Updated dependencies [e4a6189]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [3ac68ad]

  • Updated dependencies [c642ff3]

  • Updated dependencies [37c228c]

  • Updated dependencies [103f635]

@latticexyz/[email protected]

Major Changes

  • 0f27afd: World function signatures for namespaced systems have changed from {namespace}_{systemName}_{functionName} to {namespace}__{functionName} (double underscore, no system name). This is more ergonomic and is more consistent with namespaced resources in other parts of the codebase (e.g. MUD config types, table names in the schemaful indexer).

    If you have a project using the namespace key in your mud.config.ts or are manually registering systems and function selectors on a namespace, you will likely need to codegen your system interfaces (pnpm build) and update any calls to these systems through the world's namespaced function signatures.

  • 865253d: Refactored InstalledModules to key modules by addresses instead of pre-defined names. Previously, modules could report arbitrary names, meaning misconfigured modules could be installed under a name intended for another module.

  • 063daf8: 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.

    +  world.registerNamespace(namespaceId);
       world.registerSystem(systemId, system, true);
    +  world.registerNamespace(namespaceId);
       MyTable.register();
  • 57d8965: - Split CoreSystem into AccessManagementSystem, BalanceTransferSystem, BatchCallSystem, CoreRegistrationSystem

    • Changed CoreModule to receive the addresses of these systems as arguments, instead of deploying them
    • Replaced CORE_SYSTEM_ID constant with ACCESS_MANAGEMENT_SYSTEM_ID, BALANCE_TRANSFER_SYSTEM_ID, BATCH_CALL_SYSTEM_ID, CORE_REGISTRATION_SYSTEM_ID, for each respective system

    These changes separate the initcode of CoreModule from the bytecode of core systems, which effectively removes a limit on the total bytecode of all core systems.

  • c642ff3: Namespaces are not allowed to contain double underscores ("__") anymore, as this sequence of characters is used to separate the namespace and function selector in namespaced systems.
    This is to prevent signature clashes of functions in different namespaces.

    (Example: If namespaces were allowed to contain this separator string, a function "function" in namespace "namespace__my" would result in the namespaced function selector "namespace__my__function",
    and would clash with a function "my__function" in namespace "namespace".)

Patch Changes

  • e6c03a8: Renamed the requireNoCallback modifier to prohibitDirectCallback.
  • c207d35: Optimised StoreRegistrationSystem and WorldRegistrationSystem by fetching individual fields instead of entire records where possible.
  • d00c4a9: Removed ROOT_NAMESPACE_STRING and ROOT_NAME_STRING exports in favor of inlining these constants, to avoid reuse as they're meant for internal error messages and debugging.
  • 37c228c: Refactored various files to specify integers in a hex base instead of decimals.
  • f6f4028: Added the WorldContextConsumer interface ID to supportsInterface in the Module contract.
  • 08b4221: Systems are expected to be always called via the central World contract.
    Depending on whether it is a root or non-root system, the call is performed via delegatecall or call.
    Since Systems are expected to be stateless and only interact with the World state, it is not necessary to prevent direct calls to the systems.
    However, since the CoreSystem is known to always be registered as a root system in the World, it is always expected to be delegatecalled,
    so we made this expectation explicit by reverting if it is not delegatecalled.
  • 37c228c: Made the coreModule variable in WorldFactory immutable.
  • 37c228c: Removed the unnecessary extcodesize check from the Create2 library.
  • 37c228c: Refactored ResourceId to use a global Solidity using statement.
  • 37c228c: Refactored EIP165 usages to use the built-in interfaceId property instead of pre-defined constants.
  • 2bfee92: Added a table to track the CoreModule address the world was initialised with.
  • aee8020: Namespace balances can no longer be transferred to non-existent namespaces.
  • e4a6189: Prevented invalid delegations by performing full validation regardless of whether initCallData is empty. Added an unregisterDelegation function which allows explicit unregistration, as opposed of passing in zero bytes into registerDelegation.
  • 37c228c: Refactored various Solidity files to not explicitly initialise variables to zero.
  • 37c228c: Refactored WorldContext to get the world address from WorldContextConsumerLib instead of StoreSwitch.
  • Updated dependencies [c6c13f2]
  • Updated dependencies [e6c03a8]
  • Updated dependencies [37c228c]
  • Updated dependencies [1bf2e90]
  • Updated dependencies [37c228c]
  • Updated dependencies [37c228c]
  • Updated dependencies [7b28d32]
  • Updated dependencies [9f8b84e]
  • Updated dependencies [ad4ac44]
  • Updated dependencies [37c228c]
  • Updated dependencies [37c228c]
  • Updated dependencies [37c228c]
  • Updated dependencies [3ac68ad]
  • Updated dependencies [37c228c]
  • Updated dependencies [103f635]

@latticexyz/[email protected]

Major Changes

  • 865253d: Refactored InstalledModules to key modules by addresses instead of pre-defined names. Previously, modules could report arbitrary names, meaning misconfigured modules could be installed under a name intended for another module.

Patch Changes

  • eaa766e: Removed IUniqueEntitySystem in favor of calling getUniqueEntity via world.call instead of the world function selector. This had a small gas improvement.

  • 0f27afd: World function signatures for namespaced systems have changed from {namespace}_{systemName}_{functionName} to {namespace}__{functionName} (double underscore, no system name). This is more ergonomic and is more consistent with namespaced resources in other parts of the codebase (e.g. MUD config types, table names in the schemaful indexer).

    If you have a project using the namespace key in your mud.config.ts or are manually registering systems and function selectors on a namespace, you will likely need to codegen your system interfaces (pnpm build) and update any calls to these systems through the world's namespaced function signatures.

  • 063daf8: 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.

    +  world.registerNamespace(namespaceId);
       world.registerSystem(systemId, system, true);
    +  world.registerNamespace(namespaceId);
       MyTable.register();
  • 37c228c: Refactored ResourceId to use a global Solidity using statement.

  • 37c228c: Refactored EIP165 usages to use the built-in interfaceId property instead of pre-defined constants.

  • 37c228c: Refactored various Solidity files to not explicitly initialise variables to zero.

  • Updated dependencies [c6c13f2]

  • Updated dependencies [0f27afd]

  • Updated dependencies [865253d]

  • Updated dependencies [e6c03a8]

  • Updated dependencies [c207d35]

  • Updated dependencies [d00c4a9]

  • Updated dependencies [37c228c]

  • Updated dependencies [1bf2e90]

  • Updated dependencies [f6f4028]

  • Updated dependencies [08b4221]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [063daf8]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [2bfee92]

  • Updated dependencies [7b28d32]

  • Updated dependencies [9f8b84e]

  • Updated dependencies [aee8020]

  • Updated dependencies [ad4ac44]

  • Updated dependencies [57d8965]

  • Updated dependencies [e4a6189]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [37c228c]

  • Updated dependencies [3ac68ad]

  • Updated dependencies [c642ff3]

  • Updated dependencies [37c228c]

  • Updated dependencies [103f635]

@latticexyz/[email protected]

Minor Changes

  • 3ac68ad: Removed allowEmpty option from FieldLayout.validate() as field layouts should never be empty.

  • 103f635: Improved error messages for invalid FieldLayouts

    -error FieldLayoutLib_InvalidLength(uint256 length);
    +error FieldLayoutLib_TooManyFields(uint256 numFields, uint256 maxFields);
    +error FieldLayoutLib_TooManyDynamicFields(uint256 numFields, uint256 maxFields);
    +error FieldLayoutLib_Empty();

Patch Changes

  • c6c13f2: Storage events are now emitted after "before" hooks, so that the resulting logs are now correctly ordered and reflect onchain logic. This resolves issues with store writes and event emissions happening in "before" hooks.

  • e6c03a8: Renamed the requireNoCallback modifier to prohibitDirectCallback.

  • 37c228c: Refactored various files to specify integers in a hex base instead of decimals.

  • 1bf2e90: Updated codegen to not render push and pop methods for static arrays. The length method now returns the hardcoded known length instead of calculating it like with a dynamic array.

  • 37c228c: Refactored ResourceId to use a global Solidity using statement.

  • 37c228c: Refactored EIP165 usages to use the built-in interfaceId property instead of pre-defined constants.

  • 7b28d32: Added a custom error Store_InvalidBounds for when the start:end slice in getDynamicFieldSlice is invalid (it used to revert with the default overflow error)

  • 9f8b84e: Aligned the order of function arguments in the Storage library.

    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)
  • ad4ac44: Added more validation checks for FieldLayout and Schema.

  • 37c228c: Refactored various Solidity files to not explicitly initialise variables to zero.

  • 37c228c: Refactored some Store functions to use a right bit mask instead of left.

  • 37c228c: Simplified a check in Slice.getSubslice.

  • 37c228c: Optimised the Schema.validate function to decrease gas use.

@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]

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 requested review from alvrs and holic as code owners January 4, 2024 14:45
@github-actions github-actions bot force-pushed the changeset-release/main branch from a564672 to 8f84efd Compare January 4, 2024 17:19
@github-actions github-actions bot force-pushed the changeset-release/main branch from 8f84efd to 46515f4 Compare January 8, 2024 13:37
@github-actions github-actions bot force-pushed the changeset-release/main branch from 46515f4 to fe6f227 Compare January 8, 2024 13:45
@github-actions github-actions bot force-pushed the changeset-release/main branch from fe6f227 to a064152 Compare January 8, 2024 13:52
@github-actions github-actions bot force-pushed the changeset-release/main branch from a064152 to 9147a9e Compare January 8, 2024 13:59
@github-actions github-actions bot force-pushed the changeset-release/main branch from 9147a9e to e595bd1 Compare January 10, 2024 17:59
@github-actions github-actions bot force-pushed the changeset-release/main branch from e595bd1 to d8dcbc2 Compare January 11, 2024 09:37
@github-actions github-actions bot force-pushed the changeset-release/main branch from d8dcbc2 to 0686f8d Compare January 11, 2024 09:53
@github-actions github-actions bot force-pushed the changeset-release/main branch from 0686f8d to 2fddd45 Compare January 11, 2024 11:35
@github-actions github-actions bot force-pushed the changeset-release/main branch from 2fddd45 to 2373c6a Compare January 11, 2024 11:46
@github-actions github-actions bot force-pushed the changeset-release/main branch from 2373c6a to 67eb2cb Compare January 11, 2024 12:16
@github-actions github-actions bot force-pushed the changeset-release/main branch from 67eb2cb to cf98eaa Compare January 11, 2024 14:42
@github-actions github-actions bot force-pushed the changeset-release/main branch from cf98eaa to 1d7a071 Compare January 11, 2024 14:50
@github-actions github-actions bot force-pushed the changeset-release/main branch from 1d7a071 to 25baf4d Compare January 11, 2024 14:57
@github-actions github-actions bot force-pushed the changeset-release/main branch from 57ea8ff to 4e213b0 Compare January 18, 2024 17:36
@github-actions github-actions bot force-pushed the changeset-release/main branch from 4e213b0 to 57b4a14 Compare January 18, 2024 19:06
@github-actions github-actions bot force-pushed the changeset-release/main branch from 57b4a14 to e9a4684 Compare January 19, 2024 13:09
@github-actions github-actions bot force-pushed the changeset-release/main branch from e9a4684 to af4ca1d Compare January 19, 2024 13:17
@github-actions github-actions bot force-pushed the changeset-release/main branch from af4ca1d to 91fdc0e Compare January 19, 2024 14:13
@github-actions github-actions bot force-pushed the changeset-release/main branch from 91fdc0e to 9c28b75 Compare January 19, 2024 15:09
@github-actions github-actions bot force-pushed the changeset-release/main branch from 9c28b75 to fa2e8a0 Compare January 22, 2024 19:21
@github-actions github-actions bot force-pushed the changeset-release/main branch from fa2e8a0 to 271ded8 Compare January 22, 2024 19:43
@github-actions github-actions bot force-pushed the changeset-release/main branch from 271ded8 to 610b710 Compare January 22, 2024 20:30
@github-actions github-actions bot force-pushed the changeset-release/main branch from 610b710 to 3d0dee4 Compare January 22, 2024 20:39
@github-actions github-actions bot force-pushed the changeset-release/main branch from 3d0dee4 to e6b73e6 Compare January 22, 2024 20:55
@github-actions github-actions bot force-pushed the changeset-release/main branch from e6b73e6 to 54f518b Compare January 22, 2024 21:11
@github-actions github-actions bot force-pushed the changeset-release/main branch from 54f518b to 1cc85c0 Compare January 23, 2024 14:47
@yonadaa yonadaa merged commit 64611aa into main Jan 23, 2024
1 check passed
@yonadaa yonadaa deleted the changeset-release/main branch January 23, 2024 16:57
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