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(world): prevent calls to self #1564

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 45 additions & 45 deletions packages/world/gas-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,67 +33,67 @@
"file": "test/KeysInTableModule.t.sol",
"test": "testInstallComposite",
"name": "install keys in table module",
"gasUsed": 1414806
"gasUsed": 1414938
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testInstallGas",
"name": "install keys in table module",
"gasUsed": 1414806
"gasUsed": 1414938
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testInstallGas",
"name": "set a record on a table with keysInTableModule installed",
"gasUsed": 158250
"gasUsed": 158313
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testInstallSingleton",
"name": "install keys in table module",
"gasUsed": 1414806
"gasUsed": 1414938
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testSetAndDeleteRecordHookCompositeGas",
"name": "install keys in table module",
"gasUsed": 1414806
"gasUsed": 1414938
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testSetAndDeleteRecordHookCompositeGas",
"name": "change a composite record on a table with keysInTableModule installed",
"gasUsed": 22280
"gasUsed": 22301
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testSetAndDeleteRecordHookCompositeGas",
"name": "delete a composite record on a table with keysInTableModule installed",
"gasUsed": 160268
"gasUsed": 160457
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testSetAndDeleteRecordHookGas",
"name": "install keys in table module",
"gasUsed": 1414806
"gasUsed": 1414938
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testSetAndDeleteRecordHookGas",
"name": "change a record on a table with keysInTableModule installed",
"gasUsed": 21002
"gasUsed": 21023
},
{
"file": "test/KeysInTableModule.t.sol",
"test": "testSetAndDeleteRecordHookGas",
"name": "delete a record on a table with keysInTableModule installed",
"gasUsed": 85544
"gasUsed": 85649
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testGetKeysWithValueGas",
"name": "install keys with value module",
"gasUsed": 665200
"gasUsed": 654480
},
{
"file": "test/KeysWithValueModule.t.sol",
Expand All @@ -111,49 +111,49 @@
"file": "test/KeysWithValueModule.t.sol",
"test": "testInstall",
"name": "install keys with value module",
"gasUsed": 665200
"gasUsed": 654480
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testInstall",
"name": "set a record on a table with KeysWithValueModule installed",
"gasUsed": 135628
"gasUsed": 135691
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testSetAndDeleteRecordHook",
"name": "install keys with value module",
"gasUsed": 665200
"gasUsed": 654480
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testSetAndDeleteRecordHook",
"name": "change a record on a table with KeysWithValueModule installed",
"gasUsed": 106008
"gasUsed": 106071
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testSetAndDeleteRecordHook",
"name": "delete a record on a table with KeysWithValueModule installed",
"gasUsed": 35327
"gasUsed": 35369
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testSetField",
"name": "install keys with value module",
"gasUsed": 665200
"gasUsed": 654480
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testSetField",
"name": "set a field on a table with KeysWithValueModule installed",
"gasUsed": 148379
"gasUsed": 148442
},
{
"file": "test/KeysWithValueModule.t.sol",
"test": "testSetField",
"name": "change a field on a table with KeysWithValueModule installed",
"gasUsed": 113138
"gasUsed": 113201
},
{
"file": "test/query.t.sol",
Expand Down Expand Up @@ -225,157 +225,157 @@
"file": "test/StandardDelegationsModule.t.sol",
"test": "testCallFromCallboundDelegation",
"name": "register a callbound delegation",
"gasUsed": 114571
"gasUsed": 114592
},
{
"file": "test/StandardDelegationsModule.t.sol",
"test": "testCallFromCallboundDelegation",
"name": "call a system via a callbound delegation",
"gasUsed": 34058
"gasUsed": 34079
},
{
"file": "test/StandardDelegationsModule.t.sol",
"test": "testCallFromTimeboundDelegation",
"name": "register a timebound delegation",
"gasUsed": 109041
"gasUsed": 109062
},
{
"file": "test/StandardDelegationsModule.t.sol",
"test": "testCallFromTimeboundDelegation",
"name": "call a system via a timebound delegation",
"gasUsed": 27106
"gasUsed": 27127
},
{
"file": "test/UniqueEntityModule.t.sol",
"test": "testInstall",
"name": "install unique entity module",
"gasUsed": 690323
"gasUsed": 679566
},
{
"file": "test/UniqueEntityModule.t.sol",
"test": "testInstall",
"name": "get a unique entity nonce (non-root module)",
"gasUsed": 52093
"gasUsed": 52129
},
{
"file": "test/UniqueEntityModule.t.sol",
"test": "testInstallRoot",
"name": "installRoot unique entity module",
"gasUsed": 680596
"gasUsed": 669881
},
{
"file": "test/UniqueEntityModule.t.sol",
"test": "testInstallRoot",
"name": "get a unique entity nonce (root module)",
"gasUsed": 52093
"gasUsed": 52129
},
{
"file": "test/World.t.sol",
"test": "testCall",
"name": "call a system via the World",
"gasUsed": 12725
"gasUsed": 12746
},
{
"file": "test/World.t.sol",
"test": "testCallFromUnlimitedDelegation",
"name": "register an unlimited delegation",
"gasUsed": 50615
"gasUsed": 50636
},
{
"file": "test/World.t.sol",
"test": "testCallFromUnlimitedDelegation",
"name": "call a system via an unlimited delegation",
"gasUsed": 12961
"gasUsed": 12982
},
{
"file": "test/World.t.sol",
"test": "testDeleteRecord",
"name": "Delete record",
"gasUsed": 9111
"gasUsed": 9132
},
{
"file": "test/World.t.sol",
"test": "testPushToField",
"name": "Push data to the table",
"gasUsed": 86838
"gasUsed": 86859
},
{
"file": "test/World.t.sol",
"test": "testRegisterFallbackSystem",
"name": "Register a fallback system",
"gasUsed": 59404
"gasUsed": 59419
},
{
"file": "test/World.t.sol",
"test": "testRegisterFallbackSystem",
"name": "Register a root fallback system",
"gasUsed": 52929
"gasUsed": 52944
},
{
"file": "test/World.t.sol",
"test": "testRegisterFunctionSelector",
"name": "Register a function selector",
"gasUsed": 79998
"gasUsed": 80013
},
{
"file": "test/World.t.sol",
"test": "testRegisterNamespace",
"name": "Register a new namespace",
"gasUsed": 123238
"gasUsed": 123253
},
{
"file": "test/World.t.sol",
"test": "testRegisterRootFunctionSelector",
"name": "Register a root function selector",
"gasUsed": 74842
"gasUsed": 74857
},
{
"file": "test/World.t.sol",
"test": "testRegisterSystem",
"name": "register a system",
"gasUsed": 165710
"gasUsed": 165731
},
{
"file": "test/World.t.sol",
"test": "testRegisterTable",
"name": "Register a new table in the namespace",
"gasUsed": 651789
"gasUsed": 640951
},
{
"file": "test/World.t.sol",
"test": "testSetField",
"name": "Write data to a table field",
"gasUsed": 37369
"gasUsed": 37390
},
{
"file": "test/World.t.sol",
"test": "testSetRecord",
"name": "Write data to the table",
"gasUsed": 35363
"gasUsed": 36534
},
{
"file": "test/WorldDynamicUpdate.t.sol",
"test": "testPopFromField",
"name": "pop 1 address (cold)",
"gasUsed": 24599
"gasUsed": 24620
},
{
"file": "test/WorldDynamicUpdate.t.sol",
"test": "testPopFromField",
"name": "pop 1 address (warm)",
"gasUsed": 13745
"gasUsed": 13766
},
{
"file": "test/WorldDynamicUpdate.t.sol",
"test": "testUpdateInField",
"name": "updateInField 1 item (cold)",
"gasUsed": 25204
"gasUsed": 25225
},
{
"file": "test/WorldDynamicUpdate.t.sol",
"test": "testUpdateInField",
"name": "updateInField 1 item (warm)",
"gasUsed": 14409
"gasUsed": 14430
},
{
"file": "test/WorldResourceId.t.sol",
Expand Down
9 changes: 9 additions & 0 deletions packages/world/mud.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ export default mudConfig({
},
tableIdArgument: true,
},
TwoFields: {
directory: "../test/tables",
keySchema: {},
valueSchema: {
value1: "bool",
value2: "bool",
},
tableIdArgument: true,
},
AddressArray: {
directory: "../test/tables",
valueSchema: "address[]",
Expand Down
Loading