From 5c7e4829595feb311ed975b2a30bc6d5f4fa638e Mon Sep 17 00:00:00 2001 From: alvrs Date: Tue, 15 Aug 2023 13:32:28 +0200 Subject: [PATCH] fix test and gas-report --- packages/store/gas-report.json | 956 ++++++++++++++++++++++++++++ packages/store/test/StoreCore.t.sol | 18 +- packages/world/gas-report.json | 22 +- 3 files changed, 976 insertions(+), 20 deletions(-) create mode 100644 packages/store/gas-report.json diff --git a/packages/store/gas-report.json b/packages/store/gas-report.json new file mode 100644 index 0000000000..37e64dd333 --- /dev/null +++ b/packages/store/gas-report.json @@ -0,0 +1,956 @@ +[ + { + "file": "test/Bytes.t.sol", + "test": "testEquals", + "name": "compare equal bytes", + "gasUsed": 196 + }, + { + "file": "test/Bytes.t.sol", + "test": "testEqualsFalse", + "name": "compare unequal bytes", + "gasUsed": 196 + }, + { + "file": "test/Bytes.t.sol", + "test": "testSetBytes1", + "name": "set bytes1 in bytes32", + "gasUsed": 16 + }, + { + "file": "test/Bytes.t.sol", + "test": "testSetBytes2", + "name": "set bytes2 in bytes32", + "gasUsed": 16 + }, + { + "file": "test/Bytes.t.sol", + "test": "testSetBytes4", + "name": "set bytes4 in bytes32", + "gasUsed": 16 + }, + { + "file": "test/Bytes.t.sol", + "test": "testSetBytes4Memory", + "name": "set bytes4 in bytes memory", + "gasUsed": 37 + }, + { + "file": "test/Bytes.t.sol", + "test": "testSlice3", + "name": "slice bytes3 with offset 1", + "gasUsed": 68 + }, + { + "file": "test/Bytes.t.sol", + "test": "testSlice32", + "name": "slice bytes32 with offset 10", + "gasUsed": 68 + }, + { + "file": "test/Bytes.t.sol", + "test": "testToBytes32", + "name": "create bytes32 from bytes memory with offset 0", + "gasUsed": 25 + }, + { + "file": "test/Bytes.t.sol", + "test": "testToBytes32CrossWord", + "name": "create bytes32 from bytes memory with offset 16", + "gasUsed": 36 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareAbiEncodeVsCustom", + "name": "abi encode", + "gasUsed": 949 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareAbiEncodeVsCustom", + "name": "abi decode", + "gasUsed": 1738 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareAbiEncodeVsCustom", + "name": "custom encode", + "gasUsed": 2806 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareAbiEncodeVsCustom", + "name": "custom decode", + "gasUsed": 2707 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareAbiEncodeVsCustom", + "name": "pass abi encoded bytes to external contract", + "gasUsed": 6551 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareAbiEncodeVsCustom", + "name": "pass custom encoded bytes to external contract", + "gasUsed": 1445 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteMUD", + "name": "MUD storage write (cold, 1 word)", + "gasUsed": 22339 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteMUD", + "name": "MUD storage write (cold, 1 word, partial)", + "gasUsed": 22406 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteMUD", + "name": "MUD storage write (cold, 10 words)", + "gasUsed": 199795 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteMUD", + "name": "MUD storage write (warm, 1 word)", + "gasUsed": 339 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteMUD", + "name": "MUD storage write (warm, 1 word, partial)", + "gasUsed": 506 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteMUD", + "name": "MUD storage write (warm, 10 words)", + "gasUsed": 1795 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteSolidity", + "name": "solidity storage write (cold, 1 word)", + "gasUsed": 22107 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteSolidity", + "name": "solidity storage write (cold, 1 word, partial)", + "gasUsed": 22136 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteSolidity", + "name": "solidity storage write (cold, 10 words)", + "gasUsed": 199902 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteSolidity", + "name": "solidity storage write (warm, 1 word)", + "gasUsed": 107 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteSolidity", + "name": "solidity storage write (warm, 1 word, partial)", + "gasUsed": 236 + }, + { + "file": "test/Gas.t.sol", + "test": "testCompareStorageWriteSolidity", + "name": "solidity storage write (warm, 10 words)", + "gasUsed": 1988 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadMUD", + "name": "MUD storage load (cold, 1 word)", + "gasUsed": 2411 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadMUD", + "name": "MUD storage load (cold, 1 word, partial)", + "gasUsed": 2460 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadMUD", + "name": "MUD storage load (cold, 10 words)", + "gasUsed": 19911 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadMUD", + "name": "MUD storage load (warm, 1 word)", + "gasUsed": 412 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadMUD", + "name": "MUD storage load (warm, 1 word, partial)", + "gasUsed": 460 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadMUD", + "name": "MUD storage load (warm, 10 words)", + "gasUsed": 1914 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadSolidity", + "name": "solidity storage load (cold, 1 word)", + "gasUsed": 2109 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadSolidity", + "name": "solidity storage load (cold, 1 word, partial)", + "gasUsed": 2126 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadSolidity", + "name": "solidity storage load (cold, 10 words)", + "gasUsed": 19894 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadSolidity", + "name": "solidity storage load (warm, 1 word)", + "gasUsed": 109 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadSolidity", + "name": "solidity storage load (warm, 1 word, partial)", + "gasUsed": 126 + }, + { + "file": "test/GasStorageLoad.t.sol", + "test": "testCompareStorageLoadSolidity", + "name": "solidity storage load (warm, 10 words)", + "gasUsed": 1897 + }, + { + "file": "test/KeyEncoding.t.sol", + "test": "testRegisterAndGetSchema", + "name": "register KeyEncoding schema", + "gasUsed": 65010 + }, + { + "file": "test/Mixed.t.sol", + "test": "testCompareSolidity", + "name": "store Mixed struct in storage (native solidity)", + "gasUsed": 92038 + }, + { + "file": "test/Mixed.t.sol", + "test": "testRegisterAndGetSchema", + "name": "register Mixed schema", + "gasUsed": 61992 + }, + { + "file": "test/Mixed.t.sol", + "test": "testSetAndGet", + "name": "set record in Mixed", + "gasUsed": 111113 + }, + { + "file": "test/Mixed.t.sol", + "test": "testSetAndGet", + "name": "get record from Mixed", + "gasUsed": 12406 + }, + { + "file": "test/PackedCounter.t.sol", + "test": "testAtIndex", + "name": "get value at index of PackedCounter", + "gasUsed": 255 + }, + { + "file": "test/PackedCounter.t.sol", + "test": "testSetAtIndex", + "name": "set value at index of PackedCounter", + "gasUsed": 793 + }, + { + "file": "test/PackedCounter.t.sol", + "test": "testTotal", + "name": "pack uint40 array into PackedCounter", + "gasUsed": 2146 + }, + { + "file": "test/PackedCounter.t.sol", + "test": "testTotal", + "name": "get total of PackedCounter", + "gasUsed": 27 + }, + { + "file": "test/Schema.t.sol", + "test": "testEncodeDecodeSchema", + "name": "encode schema with 6 entries", + "gasUsed": 5639 + }, + { + "file": "test/Schema.t.sol", + "test": "testEncodeDecodeSchema", + "name": "get schema type at index", + "gasUsed": 185 + }, + { + "file": "test/Schema.t.sol", + "test": "testGetNumDynamicFields", + "name": "get number of dynamic fields from schema", + "gasUsed": 74 + }, + { + "file": "test/Schema.t.sol", + "test": "testGetNumStaticFields", + "name": "get number of static fields from schema", + "gasUsed": 85 + }, + { + "file": "test/Schema.t.sol", + "test": "testGetStaticSchemaLength", + "name": "get static data length from schema", + "gasUsed": 33 + }, + { + "file": "test/Schema.t.sol", + "test": "testIsEmptyFalse", + "name": "check if schema is empty (non-empty schema)", + "gasUsed": 7 + }, + { + "file": "test/Schema.t.sol", + "test": "testIsEmptyTrue", + "name": "check if schema is empty (empty schema)", + "gasUsed": 7 + }, + { + "file": "test/Schema.t.sol", + "test": "testValidate", + "name": "validate schema", + "gasUsed": 16381 + }, + { + "file": "test/Slice.t.sol", + "test": "testFromBytes", + "name": "make Slice from bytes", + "gasUsed": 31 + }, + { + "file": "test/Slice.t.sol", + "test": "testFromBytes", + "name": "get Slice length", + "gasUsed": 10 + }, + { + "file": "test/Slice.t.sol", + "test": "testFromBytes", + "name": "get Slice pointer", + "gasUsed": 33 + }, + { + "file": "test/Slice.t.sol", + "test": "testSubslice", + "name": "subslice bytes (no copy) [1:4]", + "gasUsed": 311 + }, + { + "file": "test/Slice.t.sol", + "test": "testSubslice", + "name": "subslice bytes (no copy) [4:37]", + "gasUsed": 311 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes", + "name": "Slice (0 bytes) to bytes memory", + "gasUsed": 298 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes", + "name": "Slice (2 bytes) to bytes memory", + "gasUsed": 534 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes", + "name": "Slice (32 bytes) to bytes memory", + "gasUsed": 545 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes", + "name": "Slice (34 bytes) to bytes memory", + "gasUsed": 750 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes", + "name": "Slice (1024 bytes) to bytes memory", + "gasUsed": 7264 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes", + "name": "Slice (1024x1024 bytes) to bytes memory", + "gasUsed": 9205065 + }, + { + "file": "test/Slice.t.sol", + "test": "testToBytes32", + "name": "Slice to bytes32", + "gasUsed": 81 + }, + { + "file": "test/Storage.t.sol", + "test": "testStoreLoad", + "name": "store 1 storage slot", + "gasUsed": 22339 + }, + { + "file": "test/Storage.t.sol", + "test": "testStoreLoad", + "name": "store 34 bytes over 3 storage slots (with offset and safeTrail))", + "gasUsed": 23009 + }, + { + "file": "test/Storage.t.sol", + "test": "testStoreLoad", + "name": "load 34 bytes over 3 storage slots (with offset and safeTrail))", + "gasUsed": 865 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetFieldSlice", + "name": "get field slice (cold, 1 slot)", + "gasUsed": 7996 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetFieldSlice", + "name": "get field slice (warm, 1 slot)", + "gasUsed": 2065 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetFieldSlice", + "name": "get field slice (semi-cold, 1 slot)", + "gasUsed": 4070 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetFieldSlice", + "name": "get field slice (warm, 2 slots)", + "gasUsed": 4296 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetSecondFieldLength", + "name": "get field length (cold, 1 slot)", + "gasUsed": 7959 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetSecondFieldLength", + "name": "get field length (warm, 1 slot)", + "gasUsed": 1956 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetThirdFieldLength", + "name": "get field length (warm due to , 2 slots)", + "gasUsed": 7959 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testGetThirdFieldLength", + "name": "get field length (warm, 2 slots)", + "gasUsed": 1955 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testPopFromSecondField", + "name": "pop from field (cold, 1 slot, 1 uint32 item)", + "gasUsed": 25220 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testPopFromSecondField", + "name": "pop from field (warm, 1 slot, 1 uint32 item)", + "gasUsed": 17251 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testPopFromThirdField", + "name": "pop from field (cold, 2 slots, 10 uint32 items)", + "gasUsed": 26970 + }, + { + "file": "test/StoreCoreDynamic.t.sol", + "test": "testPopFromThirdField", + "name": "pop from field (warm, 2 slots, 10 uint32 items)", + "gasUsed": 17001 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testAccessEmptyData", + "name": "access non-existing record", + "gasUsed": 6085 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testAccessEmptyData", + "name": "access static field of non-existing record", + "gasUsed": 1569 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testAccessEmptyData", + "name": "access dynamic field of non-existing record", + "gasUsed": 2227 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testAccessEmptyData", + "name": "access length of dynamic field of non-existing record", + "gasUsed": 1327 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testAccessEmptyData", + "name": "access slice of dynamic field of non-existing record", + "gasUsed": 1201 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testDeleteData", + "name": "delete record (complex data, 3 slots)", + "gasUsed": 8973 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHasSchema", + "name": "Check for existence of table (existent)", + "gasUsed": 1127 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHasSchema", + "name": "check for existence of table (non-existent)", + "gasUsed": 3129 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooks", + "name": "register subscriber", + "gasUsed": 64193 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooks", + "name": "set record on table with subscriber", + "gasUsed": 71618 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooks", + "name": "set static field on table with subscriber", + "gasUsed": 27532 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooks", + "name": "delete record on table with subscriber", + "gasUsed": 20037 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooksDynamicData", + "name": "register subscriber", + "gasUsed": 64193 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooksDynamicData", + "name": "set (dynamic) record on table with subscriber", + "gasUsed": 164922 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooksDynamicData", + "name": "set (dynamic) field on table with subscriber", + "gasUsed": 30414 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testHooksDynamicData", + "name": "delete (dynamic) record on table with subscriber", + "gasUsed": 21597 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testPushToField", + "name": "push to field (1 slot, 1 uint32 item)", + "gasUsed": 14866 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testPushToField", + "name": "push to field (2 slots, 10 uint32 items)", + "gasUsed": 37512 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testRegisterAndGetSchema", + "name": "StoreCore: register schema", + "gasUsed": 54509 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testRegisterAndGetSchema", + "name": "StoreCore: get schema (warm)", + "gasUsed": 1128 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testRegisterAndGetSchema", + "name": "StoreCore: get key schema (warm)", + "gasUsed": 2324 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicData", + "name": "set complex record with dynamic data (4 slots)", + "gasUsed": 105598 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicData", + "name": "get complex record with dynamic data (4 slots)", + "gasUsed": 5089 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicData", + "name": "compare: Set complex record with dynamic data using native solidity", + "gasUsed": 116842 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicData", + "name": "compare: Set complex record with dynamic data using abi.encode", + "gasUsed": 267368 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicDataLength", + "name": "set dynamic length of dynamic index 0", + "gasUsed": 23610 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicDataLength", + "name": "set dynamic length of dynamic index 1", + "gasUsed": 1711 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetDynamicDataLength", + "name": "reduce dynamic length of dynamic index 0", + "gasUsed": 1699 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "set static field (1 slot)", + "gasUsed": 35914 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "get static field (1 slot)", + "gasUsed": 1569 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "set static field (overlap 2 slot)", + "gasUsed": 32849 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "get static field (overlap 2 slot)", + "gasUsed": 2383 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "set dynamic field (1 slot, first dynamic field)", + "gasUsed": 55302 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "get dynamic field (1 slot, first dynamic field)", + "gasUsed": 2404 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "set dynamic field (1 slot, second dynamic field)", + "gasUsed": 33420 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetField", + "name": "get dynamic field (1 slot, second dynamic field)", + "gasUsed": 2411 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetStaticData", + "name": "set static record (1 slot)", + "gasUsed": 35388 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetStaticData", + "name": "get static record (1 slot)", + "gasUsed": 1266 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetStaticDataSpanningWords", + "name": "set static record (2 slots)", + "gasUsed": 57893 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetAndGetStaticDataSpanningWords", + "name": "get static record (2 slots)", + "gasUsed": 1455 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testSetMetadata", + "name": "StoreCore: set table metadata", + "gasUsed": 248815 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testUpdateInField", + "name": "update in field (1 slot, 1 uint32 item)", + "gasUsed": 14402 + }, + { + "file": "test/StoreCoreGas.t.sol", + "test": "testUpdateInField", + "name": "push to field (2 slots, 6 uint64 items)", + "gasUsed": 15431 + }, + { + "file": "test/StoreMetadata.t.sol", + "test": "testSetAndGet", + "name": "set record in StoreMetadataTable", + "gasUsed": 247577 + }, + { + "file": "test/StoreMetadata.t.sol", + "test": "testSetAndGet", + "name": "get record from StoreMetadataTable", + "gasUsed": 11544 + }, + { + "file": "test/StoreSwitch.t.sol", + "test": "testDelegatecall", + "name": "get Store address", + "gasUsed": 2170 + }, + { + "file": "test/StoreSwitch.t.sol", + "test": "testNoDelegatecall", + "name": "get Store address", + "gasUsed": 2173 + }, + { + "file": "test/tables/Callbacks.t.sol", + "test": "testSetAndGet", + "name": "Callbacks: set field", + "gasUsed": 59929 + }, + { + "file": "test/tables/Callbacks.t.sol", + "test": "testSetAndGet", + "name": "Callbacks: get field (warm)", + "gasUsed": 5278 + }, + { + "file": "test/tables/Callbacks.t.sol", + "test": "testSetAndGet", + "name": "Callbacks: push 1 element", + "gasUsed": 39797 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: set field (cold)", + "gasUsed": 61928 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: get field (warm)", + "gasUsed": 5281 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: push 1 element (cold)", + "gasUsed": 39799 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: pop 1 element (warm)", + "gasUsed": 16265 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: push 1 element (warm)", + "gasUsed": 17957 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: update 1 element (warm)", + "gasUsed": 17736 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: delete record (warm)", + "gasUsed": 11002 + }, + { + "file": "test/tables/Hooks.t.sol", + "test": "testTable", + "name": "Hooks: set field (warm)", + "gasUsed": 34154 + }, + { + "file": "test/tables/HooksColdLoad.t.sol", + "test": "testDelete", + "name": "Hooks: delete record (cold)", + "gasUsed": 19797 + }, + { + "file": "test/tables/HooksColdLoad.t.sol", + "test": "testGet", + "name": "Hooks: get field (cold)", + "gasUsed": 11270 + }, + { + "file": "test/tables/HooksColdLoad.t.sol", + "test": "testGetItem", + "name": "Hooks: get 1 element (cold)", + "gasUsed": 7786 + }, + { + "file": "test/tables/HooksColdLoad.t.sol", + "test": "testLength", + "name": "Hooks: get length (cold)", + "gasUsed": 7536 + }, + { + "file": "test/tables/HooksColdLoad.t.sol", + "test": "testPop", + "name": "Hooks: pop 1 element (cold)", + "gasUsed": 26387 + }, + { + "file": "test/tables/HooksColdLoad.t.sol", + "test": "testUpdate", + "name": "Hooks: update 1 element (cold)", + "gasUsed": 27309 + }, + { + "file": "test/tightcoder/DecodeSlice.t.sol", + "test": "testToArrayUint32", + "name": "decode packed uint32[]", + "gasUsed": 563 + }, + { + "file": "test/tightcoder/DecodeSlice.t.sol", + "test": "testToBytes32Array", + "name": "decode packed bytes32[]", + "gasUsed": 552 + }, + { + "file": "test/tightcoder/EncodeArray.t.sol", + "test": "testEncodeUint16Array", + "name": "encode packed uint16[]", + "gasUsed": 595 + }, + { + "file": "test/tightcoder/EncodeArray.t.sol", + "test": "testEncodeUint32Array", + "name": "encode packed uint32[]", + "gasUsed": 504 + }, + { + "file": "test/tightcoder/EncodeArray.t.sol", + "test": "testEncodeUint8Array", + "name": "encode packed uint8[]", + "gasUsed": 493 + }, + { + "file": "test/tightcoder/TightCoder.t.sol", + "test": "testFromAndToUint32Array", + "name": "decode packed uint32[]", + "gasUsed": 563 + }, + { + "file": "test/tightcoder/TightCoder.t.sol", + "test": "testToAndFromBytes24Array", + "name": "encode packed bytes24[]", + "gasUsed": 501 + }, + { + "file": "test/tightcoder/TightCoder.t.sol", + "test": "testToAndFromBytes24Array", + "name": "decode packed bytes24[]", + "gasUsed": 563 + }, + { + "file": "test/Vector2.t.sol", + "test": "testRegisterAndGetSchema", + "name": "register Vector2 schema", + "gasUsed": 59169 + }, + { + "file": "test/Vector2.t.sol", + "test": "testSetAndGet", + "name": "set Vector2 record", + "gasUsed": 36699 + }, + { + "file": "test/Vector2.t.sol", + "test": "testSetAndGet", + "name": "get Vector2 record", + "gasUsed": 4548 + } +] diff --git a/packages/store/test/StoreCore.t.sol b/packages/store/test/StoreCore.t.sol index ba0e42e191..ed558a19ec 100644 --- a/packages/store/test/StoreCore.t.sol +++ b/packages/store/test/StoreCore.t.sol @@ -51,7 +51,7 @@ contract StoreCoreTest is Test, StoreMock { Schema loadedKeySchema = IStore(this).getKeySchema(table); assertEq(loadedKeySchema.unwrap(), keySchema.unwrap()); - Schema schemaTableSchema = SchemaLib.encode(SchemaType.BYTES32, SchemaType.BYTES32); + Schema schemaTableSchema = SchemaEncodeHelper.encode(SchemaType.BYTES32, SchemaType.BYTES32); bytes memory schemaRecord = IStore(this).getRecord(StoreCoreInternal.SCHEMA_TABLE, key, schemaTableSchema); assertEq(schemaRecord, abi.encodePacked(schema.unwrap(), keySchema.unwrap())); } @@ -321,14 +321,14 @@ contract StoreCoreTest is Test, StoreMock { function testSetAndGetField() public { bytes32 table = keccak256("some.table"); - // Register table's schema - Schema schema = SchemaEncodeHelper.encode( - SchemaType.UINT128, - SchemaType.UINT256, - SchemaType.UINT32_ARRAY, - SchemaType.UINT32_ARRAY - ); - IStore(this).registerSchema(table, schema, defaultKeySchema); + // Register table's schema + Schema schema = SchemaEncodeHelper.encode( + SchemaType.UINT128, + SchemaType.UINT256, + SchemaType.UINT32_ARRAY, + SchemaType.UINT32_ARRAY + ); + IStore(this).registerSchema(table, schema, defaultKeySchema); bytes16 firstDataBytes = bytes16(0x0102030405060708090a0b0c0d0e0f10); diff --git a/packages/world/gas-report.json b/packages/world/gas-report.json index ca04e1b592..5effd07616 100644 --- a/packages/world/gas-report.json +++ b/packages/world/gas-report.json @@ -3,13 +3,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallComposite", "name": "install keys in table module", - "gasUsed": 1245581 + "gasUsed": 1245500 }, { "file": "test/KeysInTableModule.t.sol", "test": "testInstallGas", "name": "install keys in table module", - "gasUsed": 1245581 + "gasUsed": 1245500 }, { "file": "test/KeysInTableModule.t.sol", @@ -21,13 +21,13 @@ "file": "test/KeysInTableModule.t.sol", "test": "testInstallSingleton", "name": "install keys in table module", - "gasUsed": 1245581 + "gasUsed": 1245500 }, { "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookCompositeGas", "name": "install keys in table module", - "gasUsed": 1245581 + "gasUsed": 1245500 }, { "file": "test/KeysInTableModule.t.sol", @@ -45,7 +45,7 @@ "file": "test/KeysInTableModule.t.sol", "test": "testSetAndDeleteRecordHookGas", "name": "install keys in table module", - "gasUsed": 1245581 + "gasUsed": 1245500 }, { "file": "test/KeysInTableModule.t.sol", @@ -63,7 +63,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testGetKeysWithValueGas", "name": "install keys with value module", - "gasUsed": 598341 + "gasUsed": 598260 }, { "file": "test/KeysWithValueModule.t.sol", @@ -81,7 +81,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testInstall", "name": "install keys with value module", - "gasUsed": 598341 + "gasUsed": 598260 }, { "file": "test/KeysWithValueModule.t.sol", @@ -93,7 +93,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetAndDeleteRecordHook", "name": "install keys with value module", - "gasUsed": 598341 + "gasUsed": 598260 }, { "file": "test/KeysWithValueModule.t.sol", @@ -111,7 +111,7 @@ "file": "test/KeysWithValueModule.t.sol", "test": "testSetField", "name": "install keys with value module", - "gasUsed": 598341 + "gasUsed": 598260 }, { "file": "test/KeysWithValueModule.t.sol", @@ -207,7 +207,7 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstall", "name": "install unique entity module", - "gasUsed": 780797 + "gasUsed": 780716 }, { "file": "test/UniqueEntityModule.t.sol", @@ -219,7 +219,7 @@ "file": "test/UniqueEntityModule.t.sol", "test": "testInstallRoot", "name": "installRoot unique entity module", - "gasUsed": 752572 + "gasUsed": 752491 }, { "file": "test/UniqueEntityModule.t.sol",