Skip to content

Commit

Permalink
[Storage] Make the executor interface accept generic StateKey, Value …
Browse files Browse the repository at this point in the history
…for fine grained storage support

Closes: aptos-labs#368
  • Loading branch information
davidiw authored and aptos-bot committed Apr 3, 2022
1 parent 50c861f commit 012f078
Show file tree
Hide file tree
Showing 98 changed files with 843 additions and 454 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
"type": "genesis_transaction",
"version": "0",
"hash": "0x6b1ea9fc14cc016221f4efdb7259e5a26b320cdb0b590de541403af0803a1e19",
"hash": "0xbfa38c293ea4e3133282ea5fc04940ff09968163cdde7b9f9876e9560142deed",
"state_root_hash": "0x123eaa510cd66a01702f29a1e18069f958ae434b7db883a7754424d3d6847b9a",
"event_root_hash": "0xcbdbb1b830d1016d45a828bb3171ea81826e8315f14140acfbd7886f49fbcb40",
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x09d6cf563039ec1af3db3b6110dbec12437ec507c0487c1f466a17b5517e34ab",
"accumulator_root_hash": "0xbf101b553982fd11971dfe756d289c2d8b6ad81a52444045aa947b403c13682c",
"payload": {
"type": "write_set_payload",
"write_set": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xc8853f0ecf86bca145a136258545e8476e51942ee2986b461692ba5916d5ee27",
"accumulator_root_hash": "0x0a53e685ae1d380afa2eba87aa658d5493e5a2c6d794cb09c1520a7547b21402",
"id": "0xf44b581f23222c10916b17a369b4da039d075952b58036f2a7b561446592403c",
"round": "1",
"previous_block_votes": [],
Expand All @@ -24,7 +24,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xccc6fdd8f39e1fc22a86d3e3fd7eb21c398662058f6419bcca3b353ab8e30404",
"accumulator_root_hash": "0xa3067913ba85c06a2221eea9681e88ddf9558354ad3f497622b581fd45e1e65d",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xa4848e964427ec85a425759667ba3b54ef9b9fa62e6ae2e6d369d52fa44f6519",
"accumulator_root_hash": "0xe82215f18165a2d241f52d8473dd09eec3bb7e0fb8417d5457feb202243bfe56",
"id": "0x4a876b463d1297603568c40e814d9d5396d23087a0fd641e91e0e00df6c012cd",
"round": "1",
"previous_block_votes": [],
Expand All @@ -24,7 +24,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xa87e0fc3935e874d331c7879deb26958c1e338b8ee13c0def774a442bc6d3ae7",
"accumulator_root_hash": "0x19272570dc294b526d45cf1a304fe2c97ca4d337b3e115ba21f9f1c71a2efa1d",
"sender": "0xa550c18",
"sequence_number": "7",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -56,7 +56,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x1da26e956c01549e5d20361512f45c4e5d929fa4b21a141becf5ec3b1205792e",
"accumulator_root_hash": "0x19432452e92fd21b16d0b62b7f9187dbb4702ce50cff9a24cba4577cdee7529e",
"id": "0x464b5ca6488b897c005b2e17f00fc0bc8e7ed3f2ab59d607b0e3586bda1cda4e",
"round": "1",
"previous_block_votes": [],
Expand All @@ -72,7 +72,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xaf47dc99c57d57cbdeeb935a516a35ebe595ed8a20b56a3fee19e7e9610e3d67",
"accumulator_root_hash": "0xc20e87e43863fcce80104baa3e9b64afbd7f313427f6f053e80a6536e065dc27",
"sender": "0xa550c18",
"sequence_number": "8",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -104,7 +104,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x45e0e1a37f8bc5bb7366a45c69e6219d55cc4953a042973921e63fda71179031",
"accumulator_root_hash": "0xb9e1d747abdfd499e221474f50723cbc052760bd57e620515bd706e1eeb14755",
"id": "0x19d258b113d8e3e12bca2aa612b304ece5b25988818dd7234e049913233eb918",
"round": "1",
"previous_block_votes": [],
Expand All @@ -120,7 +120,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x6edafb894df8ad42e80c54bc2fde713414fda50107dfa5996b33971322b4b271",
"accumulator_root_hash": "0x2f4a3e8a14f364580e9f56e40fee93f3e5c725f4c6b8ad4f6a048e98278cb195",
"sender": "0xa550c18",
"sequence_number": "9",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -152,7 +152,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x4392f42283ca5265bcdaf5c12430f25f38e369209fb1666b8baafd3a48e0ac5f",
"accumulator_root_hash": "0xed38e49cfe059325e362a6edbc72614194e7b3ad473935e7b3c8580e56090c92",
"id": "0xb99003d30a245ac74a02e26e45cb80ee1b9c00a93345ce5f12bea9ffe04748d6",
"round": "1",
"previous_block_votes": [],
Expand All @@ -168,7 +168,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x11c954a505b68927355497132644234067c863d1ee06999b1abe4b66e6cd856f",
"accumulator_root_hash": "0x65d92fc21ced5b4e1dd2e7defe8942360448c6d5e467b6610a581f286b7ca303",
"sender": "0xa550c18",
"sequence_number": "10",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -200,7 +200,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xb49d88d7086b3604311d316020dd199cdff0df9e242adc9776cb82daca47ce99",
"accumulator_root_hash": "0x500b6f9c4e4b794bfb29d82799539c89cc0f52e4248438642ef4f75714d21a0d",
"id": "0xea95b8f9082c10620c0d6e3fc9596b4538d0dc24bec371bb3e4634561f8892e6",
"round": "1",
"previous_block_votes": [],
Expand All @@ -216,7 +216,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xb5a514fc881bfe10639816cf149574c839757dcd63e582f5d792f665a3d3d606",
"accumulator_root_hash": "0xcd1db36b15728a1280178114bc1718f9828002001a939fb24eea8cf9c5d90cc9",
"sender": "0xa550c18",
"sequence_number": "11",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -248,7 +248,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x839608e113527298252531a83b9756e54c696a10c509e07a4c084cdea86034f5",
"accumulator_root_hash": "0x4a1614e7a4dcc7296cbd68fec735bf15d1eef514b18605fa3828bed97a4b75c9",
"id": "0xa229ec3dd885442b44972526c4e8ce25a0416c3955d818bb1ab0e832877d6282",
"round": "1",
"previous_block_votes": [],
Expand All @@ -264,7 +264,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xe943443cef5ae579066ae8a874ffd92b330d720c4f57e3d8e593b6c86ccd2169",
"accumulator_root_hash": "0x501863b5bf0e0e1c9500bfb866bac8181d371cd4eddce86a36221b2b976cb780",
"sender": "0xa550c18",
"sequence_number": "12",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -296,7 +296,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x512895451464c7ac4307a813c0ab639886b7797eed0b71e1760eabb0da9a0c5e",
"accumulator_root_hash": "0x2bbd3afb28854a65c165248299af088ea5d9ff6a01b53bcbb0fffe4ae9b79cfd",
"id": "0x80ec4f332f4d1a6742c537f2bb32473b01b1dcb1caac942722a4787bb185e479",
"round": "1",
"previous_block_votes": [],
Expand All @@ -312,7 +312,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x650e1e4e2b8688f055a182963e2a26fbbda7b44ff525385c51e00cf706a478ae",
"accumulator_root_hash": "0x9168d1ce405fade61d48feed778a6bab5e811a8760ff7972c73ae336dc83898b",
"sender": "0xa550c18",
"sequence_number": "13",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -344,7 +344,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x84599383f71cc0c0e9d6819c6643525c70dabedf3cd67a323042f602799cbd0c",
"accumulator_root_hash": "0xc2b379a6783074c0a27c088338745b46dee3deb2f1ebc9cb7bba869305bc57dc",
"id": "0x842f736ab973e87f53b4857842789a1dd59167629b3c5cabe47dbf48827ec081",
"round": "1",
"previous_block_votes": [],
Expand All @@ -360,7 +360,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x5ff070c6fa04e20d96695d9d931db1452589d9b28cd59518120315644a3b13c4",
"accumulator_root_hash": "0xe2d7af0eb78f4b6c8b451dc0f6c522fa10f35ab2760b99a829d1b6513e414e37",
"sender": "0xa550c18",
"sequence_number": "14",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -392,7 +392,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xcda0364235f4733a01c398c752d9af457d379f336ed62f82efc2f10a49a7a87e",
"accumulator_root_hash": "0xfeaa31b57c9c1b299b53f2f850e7d11de0b7d5b7ceac82d7bf16fd0a19b26750",
"id": "0x3beda43d6e9f9b1b1bc44cdfce3574e7f7f0b2de2323a06ebc356bad614726b3",
"round": "1",
"previous_block_votes": [],
Expand All @@ -408,7 +408,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x75985cf7bd74d30d3c21f90e79484e57b776f0f94a00f134407ac35b6bb597c2",
"accumulator_root_hash": "0x4b81c16fab721e3f537348a7a8ed38e4cfe0f96e13635c470b63731f2b7779d4",
"sender": "0xa550c18",
"sequence_number": "15",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -440,7 +440,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xc98e9d8e325ac501826fd9d5c8aa6ce930824eb346e40c4475ee09c18720c2b2",
"accumulator_root_hash": "0x83f4ef7b0a735e08c9a98f600c1f173f7ba48ec03fd6c8bc80a1bbede3bd45b0",
"id": "0x755687120a7c6df2389c373c8fbe06bda7a61120652668dd5687fee73fac7a2c",
"round": "1",
"previous_block_votes": [],
Expand All @@ -456,7 +456,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xf7fa74de83372fd111b2e1151975415fc165c7092d4a04fab59ef247a71164dd",
"accumulator_root_hash": "0xdc1baa3ceeb1db87546dbc6a8111907707011bc00fc82b2ba1d269ada6af2676",
"sender": "0xa550c18",
"sequence_number": "16",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -488,7 +488,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x6b5df10d589fa019115906b14ab880aa56d670e1e96b5abee3dc77bd1f2ef11f",
"accumulator_root_hash": "0xc3768dc6645567633376413d48c6850c202b8678ab12f044a0fe338151f9c655",
"id": "0x430d191fbc937d42f74104aa291871f4b9d120f76583a1da5d1123f2b8a0ac60",
"round": "1",
"previous_block_votes": [],
Expand All @@ -504,7 +504,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xc9a6b2b2f8bd716a61c9c627502d24e43ce69b1dcec8cd1a9abc7d5b19f896e4",
"accumulator_root_hash": "0xdcfdd25ee5b88c7435a93d69ddb3ca85df60bca97f94815b1cd0f5e6da82079b",
"sender": "0xa550c18",
"sequence_number": "17",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -536,7 +536,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x8a35069853f698fe925d6b8218869bd5b5d0e901fa12efcaddabc6d246b63964",
"accumulator_root_hash": "0x8fbb003a87ea45b5852a85b449cf2697c12fe10cd40d998dfa8db162afcdbb0d",
"id": "0x2af5203112331adc2ed6f402dca396bfe6dfa3ac8a57ea08860870fd515cf7ca",
"round": "1",
"previous_block_votes": [],
Expand All @@ -552,7 +552,7 @@
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x22431ad4170135ecf8e9f1633e4363f9de4c358858cb67e287cdcbd714a6a459",
"accumulator_root_hash": "0x672b602f2c1a200645b9645a67d93a5ba90881cd27d0b6f59ceda0298e83fd26",
"sender": "0xa550c18",
"sequence_number": "18",
"max_gas_amount": "1000",
Expand Down Expand Up @@ -584,7 +584,7 @@
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xa9a381c56a163ff863470270bbfdcaaa7484a97aaec16e50b0d9d1d9a92b8964",
"accumulator_root_hash": "0x97ac6513f5b4d2f8da0202418bca4e3186d2a01030126428a819309b42545507",
"id": "0xe451cd3c364076623c0231898be0722c08e4eb229c44cb957d29cf7370af8a1b",
"round": "1",
"previous_block_votes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x29ee006a99f70cb667a228acf161075abbbc92d132ce3d8f80c22a6901dc92d1",
"accumulator_root_hash": "0xcb6a014b04b36710f52fa9f00761db857b90580d8bae646e2b24a067b98c0d9e",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xdd8dfcb60b898f001624a5ff871a4eccc9d9e294a5a70925ed3a82b4fb8e378c",
"accumulator_root_hash": "0x088a8d59a1b536d7b4b6f9a0ddbd32d85ef301419618d1a3ee641363eb095c7f",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xc9e971183b3fb1f96a16120f8007beb9789a6c8caa98c3bdb98b5f94d41cc2fd",
"accumulator_root_hash": "0xe1f0ad5d4b89cdbefa0b52bd728a277fb7a84da7494077da770134228658d54b",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xfea22ea71dc0b2c5278289298e92cd0fc5faaff1888935e760208a09a2e365f9",
"accumulator_root_hash": "0xc7a471b5916ee1f9bdd20b44ffe9f6134393d6e309fabfe698a424caaecfb1b4",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xdff70169d8da5c91e091bf51370b379af450c4d47a5dd047339b6134b4673341",
"accumulator_root_hash": "0x36d48f085462742c4a5791079c42928f3b8751a3c8df4e357bb0a913038e9e86",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x8749699ca9163bac914f821c083dbe1dce945afdb2cb49e30c201e4b9c22018a",
"accumulator_root_hash": "0xf7b69998c73cad711c8c872694e8e46171c5ebbdb5333187f5c34dac7d590b9e",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x484af11a9b12ec38c66e251d89e8ac1083ffb27db81ff09e9bf523928dc55d16",
"accumulator_root_hash": "0x35fac6f31b5be3a0556d704f5c98fc24ad0122fbbe04039536cfc142aa4a416f",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"gas_used": "26",
"success": false,
"vm_status": "Move abort by LIMIT_EXCEEDED - EINSUFFICIENT_BALANCE\n A limit on an amount, e.g. a currency, is exceeded. Example: withdrawal of money after account limits window\n is exhausted.\n Error codes",
"accumulator_root_hash": "0x3315ecf6b255acbe96f78c5508b930fd229abf554abc06828524110d56ba2b96",
"accumulator_root_hash": "0x93e1314370fb62aadfd56da4ba601cd62f1850daccb7f2be4fb8b2d7b602072a",
"sender": "0xe60912ecb0a8c365d163d258f3b9f1b62f8f9148c207643864d7ed4a2b23159",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
4 changes: 3 additions & 1 deletion api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ impl Context {
&StateKey::AccountAddressKey(account),
version,
)?;
Ok(state_value.map(AccountStateBlob::from))
Ok(state_value.map(|x| {
AccountStateBlob::try_from(x).expect("Can't convert state value to account state blob")
}))
}

pub fn get_block_timestamp(&self, version: u64) -> Result<u64> {
Expand Down
Loading

0 comments on commit 012f078

Please sign in to comment.