MUD is a framework for building ambitious onchain applications
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] 10 months ago
isInstalled
and requireNotInstalled
helpers to Module
base contract..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.tokenAddress
Published by github-actions[bot] 10 months ago
mud.config.ts
source file was not included in the package, causing TS errors downstream.internal
visibility to the coreSystem
variable in CoreModule
.requireInterface
to correctly specify ERC165.isInstalled
and requireNotInstalled
helpers to Module
base contract.World
now correctly registers the FunctionSignatures
table..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.store
and world
packages.Published by github-actions[bot] 10 months ago
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.
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.
trpc
for more granular control over the transport layer./api/logs
endpoint using the new query and gzip compression for 40x less data transferred over the wire./trpc/getLogs
and /trpc/findAll
endpoints.createIndexerClient
client for the new /api
indexer API exported from @latticexyz/store-sync/indexer-client
.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);
debug
logs were going to stderr
, which made it hard to find the unexpected errors.debug
logs go to stdout
and we can add explicit stderr
logs.createStoreSync
now correctly creates table registration logs from indexer records..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.debug
util to pipe to stdout
and added an additional util to explicitly pipe to stderr
when needed.postgres-decoded
storage adapterPublished by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
logIndex
of the last update of a record to be able to return the snapshot logs in the order they were emitted onchain.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.
trpc
for more granular control over the transport layer./api/logs
endpoint using the new query and gzip compression for 40x less data transferred over the wire./trpc/getLogs
and /trpc/findAll
endpoints.createIndexerClient
client for the new /api
indexer API exported from @latticexyz/store-sync/indexer-client
.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.
lastUpdatedBlockNumber
at the Postgres SQL query leveldebug
logs were going to stderr
, which made it hard to find the unexpected errors.debug
logs go to stdout
and we can add explicit stderr
logs.SENTRY_DNS
environment variable to the postgres indexer.pgBouncer
.debug
util to pipe to stdout
and added an additional util to explicitly pipe to stderr
when needed./api/logs
is now stringifying the filter instead of logging [object Object]
.postgres-decoded
indexer.Published by github-actions[bot] 10 months ago
slice4
function to bytes4
.mud.config.ts
source file was not included in the package, causing TS errors downstream..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.StoreCore
to pass previousEncodedLengths
into onBeforeSpliceDynamicData
.debug
util to pipe to stdout
and added an additional util to explicitly pipe to stderr
when needed.Storage.load
with a memoryPointer
argumentstore
and world
packages.Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
.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.useComponentValue
would not detect a change and re-render if the component value was immediately removed.Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
.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.Published by github-actions[bot] 10 months ago
window
global in vanilla JS template with an event listener on the button..gitignore
filesPublished by github-actions[bot] 10 months ago
.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.debug
util to pipe to stdout
and added an additional util to explicitly pipe to stderr
when needed.sendTransaction
, which does a better of managing nonces for higher volumes of transactions.Published by github-actions[bot] 10 months ago
mud build
command that generates table libraries, system interfaces, and typed ABIs.mud set-version --link
will no longer attempt to fetch the latest version from npm.IWorld.sol
interface (a workaround for https://github.com/foundry-rs/foundry/issues/6241)debug
util to pipe to stdout
and added an additional util to explicitly pipe to stderr
when needed.Published by github-actions[bot] 10 months ago
.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.