mud

MUD is a framework for building ambitious onchain applications

MIT License

Downloads
318.4K
Stars
643
Committers
80

Bot releases are visible (Hide)

mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • eb384bb0: Added isInstalled and requireNotInstalled helpers to Module base contract.
  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • 747d8d1b: Renamed token address fields in ERC20 and ERC721 modules to tokenAddress
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [933b54b5]
  • Updated dependencies [f8dab733]
  • Updated dependencies [1a0fa797]
  • Updated dependencies [eb384bb0]
  • Updated dependencies [e5a962bc]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • d8c8f66b: Exclude ERC165 interface ID from custom interface ID's.
  • 1077c7f5: Fixed an issue where mud.config.ts source file was not included in the package, causing TS errors downstream.
  • f8dab733: Added explicit internal visibility to the coreSystem variable in CoreModule.
  • 1a0fa797: Fixed requireInterface to correctly specify ERC165.
  • eb384bb0: Added isInstalled and requireNotInstalled helpers to Module base contract.
  • e5a962bc: World now correctly registers the FunctionSignatures table.
  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • e4817174: Removed unused imports from various files in the store and world packages.
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [933b54b5]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Major Changes

  • 504e25dc: lastUpdatedBlockNumber columns in Postgres storage adapters are no longer nullable

  • e48fb3b0: Renamed singleton chain table to config table for clarity.

  • 85b94614: The postgres indexer is now storing the logIndex of the last update of a record to be able to return the snapshot logs in the order they were emitted onchain.

  • a4aff73c: Previously, all store-sync strategies were susceptible to a potential memory leak where the stream that fetches logs from the RPC would get ahead of the stream that stores the logs in the provided storage adapter. We saw this most often when syncing to remote Postgres servers, where inserting records was much slower than we retrieving them from the RPC. In these cases, the stream would build up a backlog of items until the machine ran out of memory.

    This is now fixed by waiting for logs to be stored before fetching the next batch of logs from the RPC. To make this strategy work, we no longer return blockLogs# @latticexyz/store-sync (stream of logs fetched from RPC but before they're stored) and instead just return storedBlockLogs# @latticexyz/store-sync (stream of logs fetched from RPC after they're stored).

  • 1b5eb0d0: syncToPostgres from @latticexyz/store-sync/postgres now uses a single table to store all records in their bytes form (staticData, encodedLengths, and dynamicData), more closely mirroring onchain state and enabling more scalability and stability for automatic indexing of many worlds.

    The previous behavior, where schemaful SQL tables are created and populated for each MUD table, has been moved to a separate @latticexyz/store-sync/postgres-decoded export bundle. This approach is considered less stable and is intended to be used for analytics purposes rather than hydrating clients. Some previous metadata columns on these tables have been removed in favor of the bytes records table as the source of truth for onchain state.

    This overhaul is considered breaking and we recommend starting a fresh database when syncing with either of these strategies.

  • 7b73f44d: 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.

Minor Changes

  • 5df1f31b: Refactored how we fetch snapshots from an indexer, preferring the new getLogs endpoint and falling back to the previous findAll if it isn't available. This refactor also prepares for an easier entry point for adding client caching of snapshots.

    The initialState option for various sync methods (syncToPostgres, syncToRecs, etc.) is now deprecated in favor of initialBlockLogs. For now, we'll automatically convert initialState into initialBlockLogs, but if you want to update your code, you can do:

    import { tablesWithRecordsToLogs } from "@latticexyz/store-sync";
    
    const initialBlockLogs = {
      blockNumber: initialState.blockNumber,
      logs: tablesWithRecordsToLogs(initialState.tables),
    };
    
  • 7eabd06f: Added and populated syncProgress key in Zustand store for sync progress, like we do for RECS sync. This will let apps using syncToZustand render a loading state while initial client hydration is in progress.

    const syncProgress = useStore((state) => state.syncProgress);
    
    if (syncProgress.step !== SyncStep.LIVE) {
      return <>Loading ({Math.floor(syncProgress.percentage)}%)</>;
    }
    
  • 4c1dcd81: - Improved query performance by 10x by moving from drizzle ORM to handcrafted SQL.

    • Moved away from trpc for more granular control over the transport layer.
      Added an /api/logs endpoint using the new query and gzip compression for 40x less data transferred over the wire.
      Deprecated the /trpc/getLogs and /trpc/findAll endpoints.
    • Added a createIndexerClient client for the new /api indexer API exported from @latticexyz/store-sync/indexer-client.
      The createIndexerClient export from @latticexyz/store-sync/trpc-indexer is deprecated.
    - import { createIndexerClient } from "@latticexyz/store-sync/trpc-indexer";
    + import { createIndexerClient } from "@latticexyz/store-sync/indexer-client";
    
    - const indexer = createIndexerClient({ url: "https://indexer.holesky.redstone.xyz/trpc" });
    + const indexer = createIndexerClient({ url: "https://indexer.holesky.redstone.xyz" });
    
    - const snapshot = indexer.getLogs.query(options);
    + const snapshot = indexer.getLogs(options);
    

Patch Changes

  • 0a3b9b1c: Added explicit error logs for unexpected situations.
    Previously all debug logs were going to stderr, which made it hard to find the unexpected errors.
    Now debug logs go to stdout and we can add explicit stderr logs.
  • 712866f5: createStoreSync now correctly creates table registration logs from indexer records.
  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • 5d737cf2: Updated the debug util to pipe to stdout and added an additional util to explicitly pipe to stderr when needed.
  • 34203e4e: Fixed invalid value when decoding records in postgres-decoded storage adapter
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [933b54b5]
  • Updated dependencies [f8dab733]
  • Updated dependencies [1a0fa797]
  • Updated dependencies [eb384bb0]
  • Updated dependencies [e5a962bc]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Major Changes

  • 85b94614: The postgres indexer is now storing the logIndex of the last update of a record to be able to return the snapshot logs in the order they were emitted onchain.

Minor Changes

  • 1b5eb0d0: The findAll method is now considered deprecated in favor of a new getLogs method. This is only implemented in the Postgres indexer for now, with SQLite coming soon. The new getLogs method will be an easier and more robust data source to hydrate the client and other indexers and will allow us to add streaming updates from the indexer in the near future.

    For backwards compatibility, findAll is now implemented on top of getLogs, with record key/value decoding done in memory at request time. This may not scale for large databases, so use wisely.

  • e48fb3b0: When the Postgres indexer starts up, it will now attempt to detect if the database is outdated and, if so, cleans up all MUD-related schemas and tables before proceeding.

  • 5df1f31b: Added getLogs query support to sqlite indexer

  • 4c1dcd81: - Improved query performance by 10x by moving from drizzle ORM to handcrafted SQL.

    • Moved away from trpc for more granular control over the transport layer.
      Added an /api/logs endpoint using the new query and gzip compression for 40x less data transferred over the wire.
      Deprecated the /trpc/getLogs and /trpc/findAll endpoints.
    • Added a createIndexerClient client for the new /api indexer API exported from @latticexyz/store-sync/indexer-client.
      The createIndexerClient export from @latticexyz/store-sync/trpc-indexer is deprecated.
    - import { createIndexerClient } from "@latticexyz/store-sync/trpc-indexer";
    + import { createIndexerClient } from "@latticexyz/store-sync/indexer-client";
    
    - const indexer = createIndexerClient({ url: "https://indexer.holesky.redstone.xyz/trpc" });
    + const indexer = createIndexerClient({ url: "https://indexer.holesky.redstone.xyz" });
    
    - const snapshot = indexer.getLogs.query(options);
    + const snapshot = indexer.getLogs(options);
    
  • f61b4bc0: The /api/logs indexer endpoint is now returning a 404 snapshot not found error when no snapshot is found for the provided filter instead of an empty 200 response.

Patch Changes

  • 504e25dc: Records are now ordered by lastUpdatedBlockNumber at the Postgres SQL query level
  • b00550ce: Added a script to run the decoded postgres indexer.
  • 0a3b9b1c: Added explicit error logs for unexpected situations.
    Previously all debug logs were going to stderr, which made it hard to find the unexpected errors.
    Now debug logs go to stdout and we can add explicit stderr logs.
  • 85d16e48: Added a Sentry middleware and SENTRY_DNS environment variable to the postgres indexer.
  • c314badd: Replaced Fastify with Koa for store-indexer frontends
  • 392c4b88: Disabled prepared statements for the postgres indexer, which led to issues in combination with pgBouncer.
  • 5d737cf2: Updated the debug util to pipe to stdout and added an additional util to explicitly pipe to stderr when needed.
  • 5ab67e33: The error log if no data is found in /api/logs is now stringifying the filter instead of logging [object Object].
  • 735d957c: Added a binary for the postgres-decoded indexer.
  • Updated dependencies [5df1f31b]
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [504e25dc]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [e48fb3b0]
  • Updated dependencies [0a3b9b1c]
  • Updated dependencies [85b94614]
  • Updated dependencies [a4aff73c]
  • Updated dependencies [933b54b5]
  • Updated dependencies [712866f5]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
  • Updated dependencies [34203e4e]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [7eabd06f]
  • Updated dependencies [5df1f31b]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [7b73f44d]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • d8c8f66b: Exclude ERC165 interface ID from custom interface ID's.
  • 1b86eac0: Changed the type of the output variable in the slice4 function to bytes4.
  • 1077c7f5: Fixed an issue where mud.config.ts source file was not included in the package, causing TS errors downstream.
  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • 6db95ce1: Fixed StoreCore to pass previousEncodedLengths into onBeforeSpliceDynamicData.
  • 5d737cf2: Updated the debug util to pipe to stdout and added an additional util to explicitly pipe to stderr when needed.
  • 5ac4c97f: Fixed M-04 Memory Corruption on Load From Storage
    It only affected external use of Storage.load with a memoryPointer argument
  • e4817174: Removed unused imports from various files in the store and world packages.
  • Updated dependencies [933b54b5]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • Updated dependencies [59054203]
mud - [email protected]

Published by github-actions[bot] 10 months ago

mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
mud - [email protected]

Published by github-actions[bot] 10 months ago

mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • Updated dependencies [933b54b5]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • 9ef3f9a7: Fixed an issue where useComponentValue would not detect a change and re-render if the component value was immediately removed.
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [59054203]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • Updated dependencies [59054203]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
mud - [email protected]

Published by github-actions[bot] 10 months ago

Minor Changes

  • f6133591: Replaced usage of window global in vanilla JS template with an event listener on the button.

Patch Changes

  • 6963a9e8: Templates now correctly include their respective .gitignore files
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • 5d737cf2: Updated the debug util to pipe to stdout and added an additional util to explicitly pipe to stderr when needed.
  • 9082c179: Updated to use MUD's sendTransaction, which does a better of managing nonces for higher volumes of transactions.
  • Updated dependencies [933b54b5]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Minor Changes

  • 59d78c93: Added a mud build command that generates table libraries, system interfaces, and typed ABIs.

Patch Changes

  • 854de076: Using mud set-version --link will no longer attempt to fetch the latest version from npm.
  • 2699630c: Deploys will now always rebuild IWorld.sol interface (a workaround for https://github.com/foundry-rs/foundry/issues/6241)
  • 5d737cf2: Updated the debug util to pipe to stdout and added an additional util to explicitly pipe to stderr when needed.
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [933b54b5]
  • Updated dependencies [f8dab733]
  • Updated dependencies [1a0fa797]
  • Updated dependencies [eb384bb0]
  • Updated dependencies [e5a962bc]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
  • Updated dependencies [747d8d1b]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [5df1f31b]
mud - @latticexyz/[email protected]

Published by github-actions[bot] 10 months ago

Patch Changes

  • 59054203: TS packages now generate their respective .d.ts type definition files for better compatibility when using MUD with moduleResolution set to bundler or node16 and fixes issues around missing type declarations for dependent packages.
  • Updated dependencies [5df1f31b]
  • Updated dependencies [d8c8f66b]
  • Updated dependencies [1b86eac0]
  • Updated dependencies [504e25dc]
  • Updated dependencies [1077c7f5]
  • Updated dependencies [e48fb3b0]
  • Updated dependencies [0a3b9b1c]
  • Updated dependencies [85b94614]
  • Updated dependencies [a4aff73c]
  • Updated dependencies [933b54b5]
  • Updated dependencies [f8dab733]
  • Updated dependencies [1a0fa797]
  • Updated dependencies [eb384bb0]
  • Updated dependencies [712866f5]
  • Updated dependencies [e5a962bc]
  • Updated dependencies [59054203]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [6db95ce1]
  • Updated dependencies [5d737cf2]
  • Updated dependencies [5ac4c97f]
  • Updated dependencies [e4817174]
  • Updated dependencies [9ef3f9a7]
  • Updated dependencies [34203e4e]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [7eabd06f]
  • Updated dependencies [5df1f31b]
  • Updated dependencies [1b5eb0d0]
  • Updated dependencies [4c1dcd81]
  • Updated dependencies [7b73f44d]