Skip to content

Commit

Permalink
[framework] merge guid into account
Browse files Browse the repository at this point in the history
This reduces storage explosion on new accounts by 33%.
Unfortunately there's a huge amount of quirks:
* created aptos_account as an entity that knows about everything
* moved coin out of account and into aptos_account to avoid cyclical
  dependencies
* removed coins, since we now are going a different route with
  dependencies
* moved guid and events to framework as they are now directly dependent
  on account
  • Loading branch information
davidiw committed Aug 25, 2022
1 parent 50d7cba commit ce89cf2
Show file tree
Hide file tree
Showing 104 changed files with 1,458 additions and 1,375 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"message": "parse request payload error: Expected input type \"TransactionPayload\", found {\"type\":\"invalid\",\"function\":\"0x1::account::create_account\",\"type_arguments\":[],\"arguments\":[\"0x00000000000000000000000001234567\"]}. (occurred while parsing \"UserTransactionRequestInner\") (occurred while parsing \"EncodeSubmissionRequest\")",
"message": "parse request payload error: Expected input type \"TransactionPayload\", found {\"type\":\"invalid\",\"function\":\"0x1::aptos_account::create_account\",\"type_arguments\":[],\"arguments\":[\"0x00000000000000000000000001234567\"]}. (occurred while parsing \"UserTransactionRequestInner\") (occurred while parsing \"EncodeSubmissionRequest\")",
"error_code": "web_framework_error",
"vm_error_code": null
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"bytecode": "0xa11ceb0b050000000b010004020410031446055a2f0789018202088b032006ab030a10b50398010acd04170ce404ba020d9e07080000000100020e000003060000040800000507000006000100000702030000080401000009050100000a060700000b060400000c080900000d000a00000e040700000f06030000100b070000110b04000012000c00011500040001060c01080102050301080301050205060800010608010103020608010608030101010800010608030002030708020467756964067369676e6572104372656174654361706162696c69747904475549440947656e657261746f7202494406637265617465096372656174655f69640b6372656174655f696d706c166372656174655f776974685f6361706162696c6974790c6372656174696f6e5f6e756d0f63726561746f725f616464726573730565715f69641567656e5f6372656174655f6361706162696c697479156765745f6e6578745f6372656174696f6e5f6e756d0269640f69645f6372656174696f6e5f6e756d1269645f63726561746f725f61646472657373117075626c6973685f67656e657261746f72046164647207636f756e7465720a616464726573735f6f66000000000000000000000000000000000000000000000000000000000000000103080000000000000000126170746f733a3a6d657461646174615f763083010100000000000000001d45475549445f47454e455241544f525f4e4f545f5055424c49534845445b475549442067656e657261746f72206d757374206265207075626c6973686564206168656164206f66206669727374207573616765206f6620606372656174655f776974685f6361706162696c697479602066756e6374696f6e2e00020113050102010f080302020114030302020a031305000100010204120a00110d0c010a012902200308050d0b0006000000000000000012022d02050f0b00010b01110202010100000c040b010b0012030202000001020d120a002a020c020a021000140c010a01060100000000000000160b020f00150b010b00120312010203010001020c080a00290203050700270b00110202040100000c050b00100110021402050100000c050b00100110031402060100000c050b0010010b0121020701000004120a00110d0c010a012902200308050d0b0006000000000000000012022d02050f0b00010b011200020801000102070f0a00290220030505080600000000000000000c01050d0b002b021000140c010b0102090100000c040b00100114020a0100000c040b00100214020b0100000c040b00100314020c0100000c050b0006000000000000000012022d0202020001000300030100",
"bytecode": "0xa11ceb0b050000000c01000202020c030e280536230759850108de012006fe010a10880298010aa003120cb2037e0db004060fb60402000100020e00000306000004070000050001000006020300000704050000080406000009070800000a040300000b090500000c0906000205070301080102050301080201060801010301050206080106080201010106080200076163636f756e740467756964104372656174654361706162696c697479044755494402494406637265617465096372656174655f69640c6372656174696f6e5f6e756d0f63726561746f725f616464726573730565715f69640269640f69645f6372656174696f6e5f6e756d1269645f63726561746f725f616464726573730461646472000000000000000000000000000000000000000000000000000000000000000103080000000000000000126170746f733a3a6d657461646174615f763083010100000000000000001d45475549445f47454e455241544f525f4e4f545f5055424c49534845445b475549442067656e657261746f72206d757374206265207075626c6973686564206168656164206f66206669727374207573616765206f6620606372656174655f776974685f6361706162696c697479602066756e6374696f6e2e0002010d050102010a080202020207030d0500030000050d0a01140c020a02060100000000000000160b01150b020b001202120102010100000a040b010b00120202020100000a050b00100010011402030100000a050b00100010021402040100000a050b0010000b012102050100000a040b0010001402060100000a040b0010011402070100000a040b0010021402010002000201000000",
"abi": {
"address": "0x1",
"name": "guid",
"friends": [],
"friends": [
"0x1::account"
],
"exposed_functions": [
{
"name": "create",
"visibility": "public",
"visibility": "friend",
"is_entry": false,
"generic_type_params": [],
"params": [
"&signer"
"address",
"&mut u64"
],
"return": [
"0x1::guid::GUID"
Expand All @@ -30,19 +33,6 @@
"0x1::guid::ID"
]
},
{
"name": "create_with_capability",
"visibility": "public",
"is_entry": false,
"generic_type_params": [],
"params": [
"address",
"&0x1::guid::CreateCapability"
],
"return": [
"0x1::guid::GUID"
]
},
{
"name": "creation_num",
"visibility": "public",
Expand Down Expand Up @@ -80,30 +70,6 @@
"bool"
]
},
{
"name": "gen_create_capability",
"visibility": "public",
"is_entry": false,
"generic_type_params": [],
"params": [
"&signer"
],
"return": [
"0x1::guid::CreateCapability"
]
},
{
"name": "get_next_creation_num",
"visibility": "public",
"is_entry": false,
"generic_type_params": [],
"params": [
"address"
],
"return": [
"u64"
]
},
{
"name": "id",
"visibility": "public",
Expand Down Expand Up @@ -139,16 +105,6 @@
"return": [
"address"
]
},
{
"name": "publish_generator",
"visibility": "public",
"is_entry": false,
"generic_type_params": [],
"params": [
"&signer"
],
"return": []
}
],
"structs": [
Expand Down Expand Up @@ -183,20 +139,6 @@
}
]
},
{
"name": "Generator",
"is_native": false,
"abilities": [
"key"
],
"generic_type_params": [],
"fields": [
{
"name": "counter",
"type": "u64"
}
]
},
{
"name": "ID",
"is_native": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"type": "0x1::guid::Generator",
"type": "0x1::account::Account",
"data": {
"counter": "3"
"authentication_key": "0xcef8ffd1ab9017e96132df8a56b22de39a8155e1c3fc32affbbf93eb624b532a",
"coin_register_events": {
"counter": "1",
"guid": {
"id": {
"addr": "0xa550c18",
"creation_num": "0"
}
}
},
"guid_creation_num": "3",
"rotation_capability_offer": {
"for": {
"vec": []
}
},
"sequence_number": "0",
"signer_capability_offer": {
"for": {
"vec": []
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"type": "0x1::guid::Generator",
"type": "0x1::account::Account",
"data": {
"counter": "3"
"authentication_key": "0xcef8ffd1ab9017e96132df8a56b22de39a8155e1c3fc32affbbf93eb624b532a",
"coin_register_events": {
"counter": "1",
"guid": {
"id": {
"addr": "0xa550c18",
"creation_num": "0"
}
}
},
"guid_creation_num": "3",
"rotation_capability_offer": {
"for": {
"vec": []
}
},
"sequence_number": "0",
"signer_capability_offer": {
"for": {
"vec": []
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"state_change_hash": "",
"event_root_hash": "",
"state_checkpoint_hash": null,
"gas_used": "54",
"gas_used": "45",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "",
Expand All @@ -124,14 +124,15 @@
"data": {
"authentication_key": "0xcef8ffd1ab9017e96132df8a56b22de39a8155e1c3fc32affbbf93eb624b532a",
"coin_register_events": {
"counter": "0",
"counter": "1",
"guid": {
"id": {
"addr": "0xa550c18",
"creation_num": "0"
}
}
},
"guid_creation_num": "3",
"rotation_capability_offer": {
"for": {
"vec": []
Expand Down Expand Up @@ -179,17 +180,6 @@
},
"type": "write_resource"
},
{
"address": "0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf",
"state_key_hash": "",
"data": {
"type": "0x1::guid::Generator",
"data": {
"counter": "3"
}
},
"type": "write_resource"
},
{
"address": "0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf",
"state_key_hash": "",
Expand All @@ -206,6 +196,7 @@
}
}
},
"guid_creation_num": "3",
"rotation_capability_offer": {
"for": {
"vec": []
Expand All @@ -228,7 +219,7 @@
"gas_unit_price": "0",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"function": "0x1::account::create_account",
"function": "0x1::aptos_account::create_account",
"type_arguments": [],
"arguments": [
"0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf"
Expand All @@ -237,7 +228,7 @@
},
"signature": {
"public_key": "0x14418f867a0bd6d42abb2daa50cd68a5a869ce208282481f57504f630510d0d3",
"signature": "0x3d9ad7a6c36835ebe99b440ae3d6d39da70ee1cc144f18702726f2f0109b50c227a6227d062c8e3eb8c5defb9f810e73b07c8c63beeec5affa512638c8136a00",
"signature": "0xb11893ff961e5e59aaa540132fab5266b2caf4ea94758974454f996f0cbebe7a07dd8f91449b83fcec4b7a0672b52a2f1cb7ac9b0b83c9e66d569971eadf710f",
"type": "ed25519_signature"
},
"events": [
Expand Down
Loading

0 comments on commit ce89cf2

Please sign in to comment.