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

feat(store-sync): byte array type in decoded indexer #2251

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

yonadaa
Copy link
Contributor

@yonadaa yonadaa commented Feb 10, 2024

address, byteX arrays now use array column types instead of JSON blobs in the decoded indexer.

Seems like the drivers are incorrectly set up as the indexer errors when trying to store a byte array:
PostgresError: column "hooks" is of type bytea[] but expression is of type bytea

Copy link

changeset-bot bot commented Feb 10, 2024

🦋 Changeset detected

Latest commit: 5607081

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@latticexyz/store-sync Patch
@latticexyz/dev-tools Patch
@latticexyz/store-indexer Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/cli Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/ecs-browser Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/network Patch
@latticexyz/noise Patch
@latticexyz/phaserx Patch
@latticexyz/protocol-parser Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
@latticexyz/solecs Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/std-client Patch
@latticexyz/std-contracts Patch
@latticexyz/store-cache Patch
@latticexyz/store Patch
@latticexyz/utils Patch
@latticexyz/world-modules Patch
@latticexyz/world Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines 66 to 71
toDriver(data: boolean[]): string[] {
return data.map((datum) => String(datum));
},
fromDriver(driverData: string[]): boolean[] {
return driverData.map((datum) => Boolean(datum));
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@holic do you have any intuition why these drivers don't work?

As Uint8Array is interpreted as bytea, I would expect Uint8Array[] to be interpreted as bytea[]. Yet this errors with PostgresError: column "value" is of type bytea[] but expression is of type bytea. Test run:

https://github.com/latticexyz/mud/actions/runs/7889740453/job/21530302035?pr=2251#step:6:1813

Copy link
Member

@holic holic Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure! I do recall seeing some weird behavior with drizzle driver and the way it translates between types, but can't recall when/where/why.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi to future readers: I meant to highlight the bytes drivers, not boolean.

@yonadaa yonadaa changed the title feat(store-sync): byte and boolean array type for in decoded indexer feat(store-sync): byte array type in decoded indexer Feb 20, 2024
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.

2 participants