-
Notifications
You must be signed in to change notification settings - Fork 196
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,world): use user-types for ResourceId
, FieldLayout
and Schema
in table libraries
#1586
Changes from 14 commits
f2876e1
2cd3c92
24efe6a
15a0310
f95a317
6d98eb1
c8ea47b
4c3747c
af6d13a
3e7c5fb
65febd5
9b8440b
eeb0635
6cbab10
55ddc6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@latticexyz/store-sync": patch | ||
"@latticexyz/store": patch | ||
"@latticexyz/world": patch | ||
--- | ||
|
||
All `Store` and `World` tables now use the appropriate user-types for `ResourceId`, `FieldLayout` and `Schema` to avoid manual `wrap`/`unwrap`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@latticexyz/cli": patch | ||
"@latticexyz/common": patch | ||
"@latticexyz/store": major | ||
--- | ||
|
||
Changed the `userTypes` property to accept `{ filePath: string, internalType: SchemaAbiType }` to enable strong inference of types from the config. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -603,73 +603,73 @@ | |
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetDynamicFieldSlice", | ||
"name": "get field slice (cold, 1 slot)", | ||
"gasUsed": 10240 | ||
"gasUsed": 5609 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these gas changes come from not loading the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same for all tests or just this one? I noticed some other gas improvements below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetDynamicFieldSlice", | ||
"name": "get field slice (warm, 1 slot)", | ||
"gasUsed": 2308 | ||
"gasUsed": 1677 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetDynamicFieldSlice", | ||
"name": "get field slice (semi-cold, 1 slot)", | ||
"gasUsed": 4313 | ||
"gasUsed": 3680 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetDynamicFieldSlice", | ||
"name": "get field slice (warm, 2 slots)", | ||
"gasUsed": 4539 | ||
"gasUsed": 3907 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetSecondFieldLength", | ||
"name": "get field length (cold, 1 slot)", | ||
"gasUsed": 7795 | ||
"gasUsed": 3163 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetSecondFieldLength", | ||
"name": "get field length (warm, 1 slot)", | ||
"gasUsed": 1790 | ||
"gasUsed": 1160 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetThirdFieldLength", | ||
"name": "get field length (warm due to , 2 slots)", | ||
"gasUsed": 7794 | ||
"gasUsed": 3163 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testGetThirdFieldLength", | ||
"name": "get field length (warm, 2 slots)", | ||
"gasUsed": 1790 | ||
"gasUsed": 1160 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testPopFromSecondField", | ||
"name": "pop from field (cold, 1 slot, 1 uint32 item)", | ||
"gasUsed": 18728 | ||
"gasUsed": 18097 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testPopFromSecondField", | ||
"name": "pop from field (warm, 1 slot, 1 uint32 item)", | ||
"gasUsed": 12736 | ||
"gasUsed": 12104 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testPopFromThirdField", | ||
"name": "pop from field (cold, 2 slots, 10 uint32 items)", | ||
"gasUsed": 16496 | ||
"gasUsed": 15865 | ||
}, | ||
{ | ||
"file": "test/StoreCoreDynamic.t.sol", | ||
"test": "testPopFromThirdField", | ||
"name": "pop from field (warm, 2 slots, 10 uint32 items)", | ||
"gasUsed": 12504 | ||
"gasUsed": 11872 | ||
}, | ||
{ | ||
"file": "test/StoreCoreGas.t.sol", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of annoying, but we need this workaround for now to land the contract changes (until we have a better way to resolve the user type config with strong types)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully coming in #1561 (but still a lot of work left to do)