From a0ad969ec4297f879fc206e431ef7db7a331695e Mon Sep 17 00:00:00 2001 From: WW <121015978+clw8998@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:32:50 +0800 Subject: [PATCH] Add host function test vectors --- README.md | 1 + host_function/Eject/README.md | 18 + host_function/Eject/hostEjectHUH.json | 342 ++++++++ host_function/Eject/hostEjectOK.json | 296 +++++++ host_function/Eject/hostEjectOOB.json | 328 +++++++ host_function/Eject/hostEjectWHO.json | 328 +++++++ host_function/Export/README.md | 16 + host_function/Export/hostExportFULL.json | 76 ++ host_function/Export/hostExportOK.json | 102 +++ host_function/Export/hostExportOK_gt_wg.json | 150 ++++ host_function/Export/hostExportOOB.json | 76 ++ host_function/Expunge/README.md | 10 + host_function/Expunge/hostExpungeOK.json | 124 +++ host_function/Expunge/hostExpungeWHO.json | 150 ++++ host_function/Forget/README.md | 25 + host_function/Forget/hostForgetHUH.json | 378 +++++++++ .../Forget/hostForgetOK_0_timeslots.json | 240 ++++++ .../Forget/hostForgetOK_1_timeslots.json | 265 ++++++ .../Forget/hostForgetOK_2_timeslots.json | 243 ++++++ .../Forget/hostForgetOK_3_timeslots.json | 267 ++++++ host_function/Forget/hostForgetOOB.json | 392 +++++++++ host_function/Historical_lookup/README.md | 28 + .../hostHistorical_lookupNONE.json | 153 ++++ .../hostHistorical_lookupOK_d_omega7.json | 135 +++ .../hostHistorical_lookupOK_d_s.json | 135 +++ .../hostHistorical_lookupOOB.json | 155 ++++ host_function/Import/README.md | 17 + host_function/Import/hostImportNONE.json | 63 ++ host_function/Import/hostImportOK.json | 76 ++ host_function/Import/hostImportOK_gt_wg.json | 112 +++ host_function/Import/hostImportOOB.json | 63 ++ host_function/Info/README.md | 13 + host_function/Info/hostInfoNONE.json | 136 +++ host_function/Info/hostInfoOK.json | 214 +++++ host_function/Info/hostInfoOOB.json | 136 +++ host_function/Invoke/README.md | 34 + host_function/Invoke/hostInvokeFAULT.json | 326 +++++++ host_function/Invoke/hostInvokeHALT.json | 331 ++++++++ host_function/Invoke/hostInvokeHOST.json | 318 +++++++ host_function/Invoke/hostInvokeOOB.json | 318 +++++++ host_function/Invoke/hostInvokeOOG.json | 318 +++++++ host_function/Invoke/hostInvokePANIC.json | 318 +++++++ host_function/Invoke/hostInvokeWHO.json | 318 +++++++ host_function/Lookup/README.md | 24 + host_function/Lookup/hostLookupNONE.json | 206 +++++ .../Lookup/hostLookupOK_d_omega7.json | 186 ++++ host_function/Lookup/hostLookupOK_s.json | 166 ++++ host_function/Lookup/hostLookupOOB.json | 206 +++++ host_function/Machine/README.md | 8 + host_function/Machine/hostMachineOK.json | 121 +++ host_function/Machine/hostMachineOOB.json | 68 ++ host_function/New/README.md | 13 + host_function/New/hostNewCASH.json | 396 +++++++++ host_function/New/hostNewOK.json | 410 +++++++++ host_function/New/hostNewOOB.json | 396 +++++++++ host_function/Peek/README.md | 14 + host_function/Peek/hostPeekOK.json | 134 +++ host_function/Peek/hostPeekOOB.json | 124 +++ host_function/Peek/hostPeekWHO.json | 124 +++ host_function/Poke/README.md | 14 + host_function/Poke/hostPokeOK.json | 134 +++ host_function/Poke/hostPokeOOB.json | 124 +++ host_function/Poke/hostPokeWHO.json | 124 +++ host_function/Query/README.md | 28 + host_function/Query/hostQueryNONE.json | 260 ++++++ .../Query/hostQueryOK_0_timeslots.json | 260 ++++++ .../Query/hostQueryOK_1_timeslots.json | 264 ++++++ .../Query/hostQueryOK_2_timeslots.json | 266 ++++++ .../Query/hostQueryOK_3_timeslots.json | 268 ++++++ host_function/Query/hostQueryOOB.json | 260 ++++++ host_function/README.md | 263 ++++++ host_function/Read/README.md | 24 + host_function/Read/hostReadNONE.json | 132 +++ host_function/Read/hostReadOK_d_omega7.json | 152 ++++ host_function/Read/hostReadOK_s.json | 132 +++ host_function/Read/hostReadOOB.json | 132 +++ host_function/Solicit/README.md | 19 + host_function/Solicit/hostSolicitFULL.json | 394 +++++++++ host_function/Solicit/hostSolicitHUH.json | 392 +++++++++ .../Solicit/hostSolicitOK_2_timeslots.json | 267 ++++++ .../Solicit/hostSolicitOK_no_timeslots.json | 255 ++++++ host_function/Solicit/hostSolicitOOB.json | 394 +++++++++ host_function/Transfer/README.md | 20 + host_function/Transfer/hostTransferCASH.json | 472 +++++++++++ host_function/Transfer/hostTransferLOW.json | 472 +++++++++++ host_function/Transfer/hostTransferOK.json | 801 ++++++++++++++++++ host_function/Transfer/hostTransferOOB.json | 472 +++++++++++ host_function/Transfer/hostTransferWHO.json | 472 +++++++++++ host_function/Upgrade/README.md | 8 + host_function/Upgrade/hostUpgradeOK.json | 394 +++++++++ host_function/Upgrade/hostUpgradeOOB.json | 394 +++++++++ host_function/Void/README.md | 13 + host_function/Void/hostVoidOK.json | 102 +++ host_function/Void/hostVoidOOB.json | 102 +++ host_function/Void/hostVoidWHO.json | 102 +++ host_function/Write/README.md | 21 + host_function/Write/hostWriteFULL.json | 156 ++++ host_function/Write/hostWriteNONE.json | 149 ++++ host_function/Write/hostWriteOK.json | 156 ++++ host_function/Write/hostWriteOOB.json | 156 ++++ host_function/Yield/README.md | 8 + host_function/Yield/hostYieldOK.json | 184 ++++ host_function/Yield/hostYieldOOB.json | 184 ++++ host_function/Zero/README.md | 13 + host_function/Zero/hostZeroOK.json | 102 +++ host_function/Zero/hostZeroOOB.json | 102 +++ host_function/Zero/hostZeroWHO.json | 102 +++ host_function/templates/README.md | 601 +++++++++++++ .../templates/hostAccumulateTemplate.json | 284 +++++++ .../templates/hostGeneralTemplate.json | 102 +++ .../templates/hostRefineTemplate.json | 55 ++ 111 files changed, 20897 insertions(+) create mode 100644 host_function/Eject/README.md create mode 100644 host_function/Eject/hostEjectHUH.json create mode 100644 host_function/Eject/hostEjectOK.json create mode 100644 host_function/Eject/hostEjectOOB.json create mode 100644 host_function/Eject/hostEjectWHO.json create mode 100644 host_function/Export/README.md create mode 100644 host_function/Export/hostExportFULL.json create mode 100644 host_function/Export/hostExportOK.json create mode 100644 host_function/Export/hostExportOK_gt_wg.json create mode 100644 host_function/Export/hostExportOOB.json create mode 100644 host_function/Expunge/README.md create mode 100644 host_function/Expunge/hostExpungeOK.json create mode 100644 host_function/Expunge/hostExpungeWHO.json create mode 100644 host_function/Forget/README.md create mode 100644 host_function/Forget/hostForgetHUH.json create mode 100644 host_function/Forget/hostForgetOK_0_timeslots.json create mode 100644 host_function/Forget/hostForgetOK_1_timeslots.json create mode 100644 host_function/Forget/hostForgetOK_2_timeslots.json create mode 100644 host_function/Forget/hostForgetOK_3_timeslots.json create mode 100644 host_function/Forget/hostForgetOOB.json create mode 100644 host_function/Historical_lookup/README.md create mode 100644 host_function/Historical_lookup/hostHistorical_lookupNONE.json create mode 100644 host_function/Historical_lookup/hostHistorical_lookupOK_d_omega7.json create mode 100644 host_function/Historical_lookup/hostHistorical_lookupOK_d_s.json create mode 100644 host_function/Historical_lookup/hostHistorical_lookupOOB.json create mode 100644 host_function/Import/README.md create mode 100644 host_function/Import/hostImportNONE.json create mode 100644 host_function/Import/hostImportOK.json create mode 100644 host_function/Import/hostImportOK_gt_wg.json create mode 100644 host_function/Import/hostImportOOB.json create mode 100644 host_function/Info/README.md create mode 100644 host_function/Info/hostInfoNONE.json create mode 100644 host_function/Info/hostInfoOK.json create mode 100644 host_function/Info/hostInfoOOB.json create mode 100644 host_function/Invoke/README.md create mode 100644 host_function/Invoke/hostInvokeFAULT.json create mode 100644 host_function/Invoke/hostInvokeHALT.json create mode 100644 host_function/Invoke/hostInvokeHOST.json create mode 100644 host_function/Invoke/hostInvokeOOB.json create mode 100644 host_function/Invoke/hostInvokeOOG.json create mode 100644 host_function/Invoke/hostInvokePANIC.json create mode 100644 host_function/Invoke/hostInvokeWHO.json create mode 100644 host_function/Lookup/README.md create mode 100644 host_function/Lookup/hostLookupNONE.json create mode 100644 host_function/Lookup/hostLookupOK_d_omega7.json create mode 100644 host_function/Lookup/hostLookupOK_s.json create mode 100644 host_function/Lookup/hostLookupOOB.json create mode 100644 host_function/Machine/README.md create mode 100644 host_function/Machine/hostMachineOK.json create mode 100644 host_function/Machine/hostMachineOOB.json create mode 100644 host_function/New/README.md create mode 100644 host_function/New/hostNewCASH.json create mode 100644 host_function/New/hostNewOK.json create mode 100644 host_function/New/hostNewOOB.json create mode 100644 host_function/Peek/README.md create mode 100644 host_function/Peek/hostPeekOK.json create mode 100644 host_function/Peek/hostPeekOOB.json create mode 100644 host_function/Peek/hostPeekWHO.json create mode 100644 host_function/Poke/README.md create mode 100644 host_function/Poke/hostPokeOK.json create mode 100644 host_function/Poke/hostPokeOOB.json create mode 100644 host_function/Poke/hostPokeWHO.json create mode 100644 host_function/Query/README.md create mode 100644 host_function/Query/hostQueryNONE.json create mode 100644 host_function/Query/hostQueryOK_0_timeslots.json create mode 100644 host_function/Query/hostQueryOK_1_timeslots.json create mode 100644 host_function/Query/hostQueryOK_2_timeslots.json create mode 100644 host_function/Query/hostQueryOK_3_timeslots.json create mode 100644 host_function/Query/hostQueryOOB.json create mode 100644 host_function/README.md create mode 100644 host_function/Read/README.md create mode 100644 host_function/Read/hostReadNONE.json create mode 100644 host_function/Read/hostReadOK_d_omega7.json create mode 100644 host_function/Read/hostReadOK_s.json create mode 100644 host_function/Read/hostReadOOB.json create mode 100644 host_function/Solicit/README.md create mode 100644 host_function/Solicit/hostSolicitFULL.json create mode 100644 host_function/Solicit/hostSolicitHUH.json create mode 100644 host_function/Solicit/hostSolicitOK_2_timeslots.json create mode 100644 host_function/Solicit/hostSolicitOK_no_timeslots.json create mode 100644 host_function/Solicit/hostSolicitOOB.json create mode 100644 host_function/Transfer/README.md create mode 100644 host_function/Transfer/hostTransferCASH.json create mode 100644 host_function/Transfer/hostTransferLOW.json create mode 100644 host_function/Transfer/hostTransferOK.json create mode 100644 host_function/Transfer/hostTransferOOB.json create mode 100644 host_function/Transfer/hostTransferWHO.json create mode 100644 host_function/Upgrade/README.md create mode 100644 host_function/Upgrade/hostUpgradeOK.json create mode 100644 host_function/Upgrade/hostUpgradeOOB.json create mode 100644 host_function/Void/README.md create mode 100644 host_function/Void/hostVoidOK.json create mode 100644 host_function/Void/hostVoidOOB.json create mode 100644 host_function/Void/hostVoidWHO.json create mode 100644 host_function/Write/README.md create mode 100644 host_function/Write/hostWriteFULL.json create mode 100644 host_function/Write/hostWriteNONE.json create mode 100644 host_function/Write/hostWriteOK.json create mode 100644 host_function/Write/hostWriteOOB.json create mode 100644 host_function/Yield/README.md create mode 100644 host_function/Yield/hostYieldOK.json create mode 100644 host_function/Yield/hostYieldOOB.json create mode 100644 host_function/Zero/README.md create mode 100644 host_function/Zero/hostZeroOK.json create mode 100644 host_function/Zero/hostZeroOOB.json create mode 100644 host_function/Zero/hostZeroWHO.json create mode 100644 host_function/templates/README.md create mode 100644 host_function/templates/hostAccumulateTemplate.json create mode 100644 host_function/templates/hostGeneralTemplate.json create mode 100644 host_function/templates/hostRefineTemplate.json diff --git a/README.md b/README.md index f2a49a59..a03052ac 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,4 @@ - [Codec](./codec/README.md) - [Safrole](./safrole/README.md) +- [Host Function](./host_function/README.md) diff --git a/host_function/Eject/README.md b/host_function/Eject/README.md new file mode 100644 index 00000000..c451ba79 --- /dev/null +++ b/host_function/Eject/README.md @@ -0,0 +1,18 @@ +# Host Eject + +## hostEjectOK +1. Read the preimage blob hash from memory. +2. Successfully retrieve service **d** based on the service index d. +3. Successfully remove service **d** from x.u.d and insert service **s** into x.u.d. + +## hostEjectOOB +1. Failed to read the preimage blob hash from memory. + +## hostEjectWHO +1. Read the preimage blob hash from memory. +2. Failed to retrieve **d** with the corresponding d because d equals xs. + +## hostEjectHUH +1. Read the preimage blob hash from memory. +2. Successfully retrieve service **d** based on the service index d. +3. Failed to update x.u.d because **d.i** ≠ 2. diff --git a/host_function/Eject/hostEjectHUH.json b/host_function/Eject/hostEjectHUH.json new file mode 100644 index 00000000..b9c891cc --- /dev/null +++ b/host_function/Eject/hostEjectHUH.json @@ -0,0 +1,342 @@ +{ + "name": "hostEjectHUH", + "initial-gas": 10000, + "initial-regs": { + "7": 1, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551606, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Eject/hostEjectOK.json b/host_function/Eject/hostEjectOK.json new file mode 100644 index 00000000..28af2a47 --- /dev/null +++ b/host_function/Eject/hostEjectOK.json @@ -0,0 +1,296 @@ +{ + "name": "hostEjectOK", + "initial-gas": 10000, + "initial-regs": { + "7": 1, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 2000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Eject/hostEjectOOB.json b/host_function/Eject/hostEjectOOB.json new file mode 100644 index 00000000..e5d2370c --- /dev/null +++ b/host_function/Eject/hostEjectOOB.json @@ -0,0 +1,328 @@ +{ + "name": "hostEjectOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 1, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Eject/hostEjectWHO.json b/host_function/Eject/hostEjectWHO.json new file mode 100644 index 00000000..4b5443b9 --- /dev/null +++ b/host_function/Eject/hostEjectWHO.json @@ -0,0 +1,328 @@ +{ + "name": "hostEjectWHO", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551612, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Export/README.md b/host_function/Export/README.md new file mode 100644 index 00000000..5770c452 --- /dev/null +++ b/host_function/Export/README.md @@ -0,0 +1,16 @@ +# Host Export + +## hostExportOK +1. Successfully read **x** from memory. +2. Successfully appended **x** to export segments and wrote the export segment index + length of export segments into omega_7. + +## hostExportOK_gt_wg +The size to be read is larger than wg (24 in our case), so only wg bytes will be read from memory. +1. Successfully read **x** from memory. +2. Successfully appended **x** to export segments and wrote the export segment index + length of export segments into omega_7. + +## hostExportOOB +1. Failed to read **x** from memory due to a permission error. + +## hostExportFULL +1. Export segment index + length of export segments exceeds the WM limit (2^11). diff --git a/host_function/Export/hostExportFULL.json b/host_function/Export/hostExportFULL.json new file mode 100644 index 00000000..ce904682 --- /dev/null +++ b/host_function/Export/hostExportFULL.json @@ -0,0 +1,76 @@ +{ + "name": "hostExportFULL", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": [ + [] + ], + "initial-import-segment": null, + "initial-export-segment-index": 9999, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551611, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": [ + [] + ] +} \ No newline at end of file diff --git a/host_function/Export/hostExportOK.json b/host_function/Export/hostExportOK.json new file mode 100644 index 00000000..91d0b6f8 --- /dev/null +++ b/host_function/Export/hostExportOK.json @@ -0,0 +1,102 @@ +{ + "name": "hostExportOK", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": [ + [] + ], + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 1, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": [ + [], + [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ] +} \ No newline at end of file diff --git a/host_function/Export/hostExportOK_gt_wg.json b/host_function/Export/hostExportOK_gt_wg.json new file mode 100644 index 00000000..0b724354 --- /dev/null +++ b/host_function/Export/hostExportOK_gt_wg.json @@ -0,0 +1,150 @@ +{ + "name": "hostExportOK_gt_wg", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 36 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": [ + [] + ], + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 1, + "8": 36 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": [ + [], + [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ] + ] +} \ No newline at end of file diff --git a/host_function/Export/hostExportOOB.json b/host_function/Export/hostExportOOB.json new file mode 100644 index 00000000..ef0b007b --- /dev/null +++ b/host_function/Export/hostExportOOB.json @@ -0,0 +1,76 @@ +{ + "name": "hostExportOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": [ + [] + ], + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": [ + [] + ] +} \ No newline at end of file diff --git a/host_function/Expunge/README.md b/host_function/Expunge/README.md new file mode 100644 index 00000000..f0f61a2d --- /dev/null +++ b/host_function/Expunge/README.md @@ -0,0 +1,10 @@ +# Host Expunge +- m: The newly created PVM. +- machine map: **m** in GP. + +## hostExpungeOK +1. Successfully retrieved m. +2. Successfully deleted m from machine map. + +## hostExpungeWHO +1. Failed to retrieve m from the machine map. \ No newline at end of file diff --git a/host_function/Expunge/hostExpungeOK.json b/host_function/Expunge/hostExpungeOK.json new file mode 100644 index 00000000..ac9508a0 --- /dev/null +++ b/host_function/Expunge/hostExpungeOK.json @@ -0,0 +1,124 @@ +{ + "name": "hostExpungeOK", + "initial-gas": 10000, + "initial-regs": { + "7": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + }, + "1": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Expunge/hostExpungeWHO.json b/host_function/Expunge/hostExpungeWHO.json new file mode 100644 index 00000000..281a098f --- /dev/null +++ b/host_function/Expunge/hostExpungeWHO.json @@ -0,0 +1,150 @@ +{ + "name": "hostExpungeWHO", + "initial-gas": 10000, + "initial-regs": { + "7": 999 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + }, + "1": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551612 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + }, + "1": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Forget/README.md b/host_function/Forget/README.md new file mode 100644 index 00000000..0e458ba5 --- /dev/null +++ b/host_function/Forget/README.md @@ -0,0 +1,25 @@ +# Host Forget + +## hostForgetOK_3_timeslots +1. Read the preimage blob hash from memory. +2. Successfully updated new timeslots into **a**'s lookup. + +## hostForgetOK_2_timeslots +1. Read the preimage blob hash from memory. +2. Successfully deleted **a**'s lookup and according preimage blob. + +## hostForgetOK_1_timeslots +1. Read the preimage blob hash from memory. +2. Successfully inserted a new timeslot into **a**'s lookup. + +## hostForgetOK_0_timeslots +1. Read the preimage blob hash from memory. +2. Successfully deleted **a**'s lookup and according preimage blob. + +## hostForgetOOB +1. Failed to read the preimage blob hash from memory. + +## hostForgetHUH +1. Read the preimage blob hash from memory. +2. Unable to obtain the service account' s lookup. + diff --git a/host_function/Forget/hostForgetHUH.json b/host_function/Forget/hostForgetHUH.json new file mode 100644 index 00000000..2bf9b891 --- /dev/null +++ b/host_function/Forget/hostForgetHUH.json @@ -0,0 +1,378 @@ +{ + "name": "hostForgetHUH", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": {}, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 28800, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551606, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": {}, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Forget/hostForgetOK_0_timeslots.json b/host_function/Forget/hostForgetOK_0_timeslots.json new file mode 100644 index 00000000..4ce886b2 --- /dev/null +++ b/host_function/Forget/hostForgetOK_0_timeslots.json @@ -0,0 +1,240 @@ +{ + "name": "hostForgetOK_0_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 29800, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": {}, + "p_map": {}, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Forget/hostForgetOK_1_timeslots.json b/host_function/Forget/hostForgetOK_1_timeslots.json new file mode 100644 index 00000000..833cfe08 --- /dev/null +++ b/host_function/Forget/hostForgetOK_1_timeslots.json @@ -0,0 +1,265 @@ +{ + "name": "hostForgetOK_1_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 100, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Forget/hostForgetOK_2_timeslots.json b/host_function/Forget/hostForgetOK_2_timeslots.json new file mode 100644 index 00000000..61ca04e4 --- /dev/null +++ b/host_function/Forget/hostForgetOK_2_timeslots.json @@ -0,0 +1,243 @@ +{ + "name": "hostForgetOK_2_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 29800, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": {}, + "p_map": {}, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Forget/hostForgetOK_3_timeslots.json b/host_function/Forget/hostForgetOK_3_timeslots.json new file mode 100644 index 00000000..6476036a --- /dev/null +++ b/host_function/Forget/hostForgetOK_3_timeslots.json @@ -0,0 +1,267 @@ +{ + "name": "hostForgetOK_3_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100, + 1000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 29800, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 1000, + 29800 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Forget/hostForgetOOB.json b/host_function/Forget/hostForgetOOB.json new file mode 100644 index 00000000..60fa918e --- /dev/null +++ b/host_function/Forget/hostForgetOOB.json @@ -0,0 +1,392 @@ +{ + "name": "hostForgetOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 100, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Historical_lookup/README.md b/host_function/Historical_lookup/README.md new file mode 100644 index 00000000..ccb986ec --- /dev/null +++ b/host_function/Historical_lookup/README.md @@ -0,0 +1,28 @@ +# Host Historical Lookup + +## hostHistoricalLookupOK_d_s +omega7 = NONE, so the service index is read as the initial service index (s) from delta. +1. Successfully read service index = 0 from delta. +2. Read the preimage blob hash from memory and compute **h**. +3. Successfully read the preimage blob from the historical lookup function **Λ**. +4. Write the preimage blob into memory. +5. Write the length of the preimage blob into **omega_7**. + +## hostHistoricalLookupOK_d_omega7 +omega7 ≠ NONE, so the service index is read as omega7 from delta. +1. Successfully read service index = 0 from delta. +2. Read the preimage blob hash from memory and compute **h**. +3. Successfully read the preimage blob from the historical lookup function **Λ**. +4. Write the preimage blob into memory. +5. Write the length of the preimage blob into **omega_7**. + +## hostHistoricalLookupOOB +omega7 ≠ NONE, so the service index is read as omega7 from delta. +1. Successfully read service index = 0 from delta. +2. Failed to read the preimage blob hash from memory because of a permission error. + +## hostHistoricalLookupNONE +omega7 ≠ NONE, so the service index is read as omega7 from delta. +1. Successfully read service index = 0 from delta. +2. Read the preimage blob hash from memory and compute **h**. +3. Failed to read the preimage blob from the historical lookup function **Λ** because of an invalid timeslot. diff --git a/host_function/Historical_lookup/hostHistorical_lookupNONE.json b/host_function/Historical_lookup/hostHistorical_lookupNONE.json new file mode 100644 index 00000000..78c675eb --- /dev/null +++ b/host_function/Historical_lookup/hostHistorical_lookupNONE.json @@ -0,0 +1,153 @@ +{ + "name": "hostHistorical_lookupNONE", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "initial-timeslot": 1000, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 18446744073709551615, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Historical_lookup/hostHistorical_lookupOK_d_omega7.json b/host_function/Historical_lookup/hostHistorical_lookupOK_d_omega7.json new file mode 100644 index 00000000..31a36f1a --- /dev/null +++ b/host_function/Historical_lookup/hostHistorical_lookupOK_d_omega7.json @@ -0,0 +1,135 @@ +{ + "name": "hostHistorical_lookupOK_d_omega7", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "initial-timeslot": 1000, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 12, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Historical_lookup/hostHistorical_lookupOK_d_s.json b/host_function/Historical_lookup/hostHistorical_lookupOK_d_s.json new file mode 100644 index 00000000..3fdf75ab --- /dev/null +++ b/host_function/Historical_lookup/hostHistorical_lookupOK_d_s.json @@ -0,0 +1,135 @@ +{ + "name": "hostHistorical_lookupOK_d_s", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 18446744073709551615, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 100, + "g": 100, + "m": 100 + } + }, + "initial-timeslot": 1000, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 12, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Historical_lookup/hostHistorical_lookupOOB.json b/host_function/Historical_lookup/hostHistorical_lookupOOB.json new file mode 100644 index 00000000..3fe0d2a0 --- /dev/null +++ b/host_function/Historical_lookup/hostHistorical_lookupOOB.json @@ -0,0 +1,155 @@ +{ + "name": "hostHistorical_lookupOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "initial-timeslot": 1000, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 18446744073709551613, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Import/README.md b/host_function/Import/README.md new file mode 100644 index 00000000..d1be0c20 --- /dev/null +++ b/host_function/Import/README.md @@ -0,0 +1,17 @@ +# Host Import + +## hostImportOK +1. Successfully read import segments from initial import segments. +2. Write import segments into memory. + +## hostImportOK_gt_wg +The size to be wrote is larger than wg (24 in our case), so only wg bytes will be wrote into memory. +1. Successfully read import segments from initial import segments. +2. Write import segments into memory. + +## hostImportOOB +1. Successfully read import segments from initial import segments. +2. Failed to write the import segments into memory due to a permission error. + +## hostImportNONE +1. Length of import segment is lower than omega_7. \ No newline at end of file diff --git a/host_function/Import/hostImportNONE.json b/host_function/Import/hostImportNONE.json new file mode 100644 index 00000000..8fc6b16f --- /dev/null +++ b/host_function/Import/hostImportNONE.json @@ -0,0 +1,63 @@ +{ + "name": "hostImportNONE", + "initial-gas": 10000, + "initial-regs": { + "7": 9999, + "8": 131072, + "9": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": [ + [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ] + ], + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551615, + "8": 131072, + "9": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Import/hostImportOK.json b/host_function/Import/hostImportOK.json new file mode 100644 index 00000000..175fd618 --- /dev/null +++ b/host_function/Import/hostImportOK.json @@ -0,0 +1,76 @@ +{ + "name": "hostImportOK", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072, + "9": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": [ + [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ] + ], + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 131072, + "9": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Import/hostImportOK_gt_wg.json b/host_function/Import/hostImportOK_gt_wg.json new file mode 100644 index 00000000..38997822 --- /dev/null +++ b/host_function/Import/hostImportOK_gt_wg.json @@ -0,0 +1,112 @@ +{ + "name": "hostImportOK_gt_wg", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072, + "9": 36 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": [ + [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ] + ], + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 131072, + "9": 36 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15, + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Import/hostImportOOB.json b/host_function/Import/hostImportOOB.json new file mode 100644 index 00000000..e0fea7ab --- /dev/null +++ b/host_function/Import/hostImportOOB.json @@ -0,0 +1,63 @@ +{ + "name": "hostImportOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072, + "9": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-refine-map": null, + "initial-export-segment": null, + "initial-import-segment": [ + [ + 10, + 10, + 11, + 11, + 12, + 12, + 13, + 13, + 14, + 14, + 15, + 15 + ] + ], + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": null, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 131072, + "9": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-refine-map": null, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Info/README.md b/host_function/Info/README.md new file mode 100644 index 00000000..05c3f86b --- /dev/null +++ b/host_function/Info/README.md @@ -0,0 +1,13 @@ +# Host Info + +## hostInfoOK +1. Successfully read service index = 0 from delta. +2. Encode each element of t into m, then write to memory. + +## hostInfoOOB +1. Successfully read service index = 0 from delta. +2. Encode each element of t into m, but encountered a permission error when writing m to memory. + +## hostInfoNONE +1. Service index does not exist in delta. + diff --git a/host_function/Info/hostInfoNONE.json b/host_function/Info/hostInfoNONE.json new file mode 100644 index 00000000..a40347e6 --- /dev/null +++ b/host_function/Info/hostInfoNONE.json @@ -0,0 +1,136 @@ +{ + "name": "hostInfoNONE", + "initial-gas": 10000, + "initial-regs": { + "7": 999, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551615, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Info/hostInfoOK.json b/host_function/Info/hostInfoOK.json new file mode 100644 index 00000000..bd24dcc7 --- /dev/null +++ b/host_function/Info/hostInfoOK.json @@ -0,0 +1,214 @@ +{ + "name": "hostInfoOK", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 7, + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55, + 232, + 3, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 200, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Info/hostInfoOOB.json b/host_function/Info/hostInfoOOB.json new file mode 100644 index 00000000..3113d36e --- /dev/null +++ b/host_function/Info/hostInfoOOB.json @@ -0,0 +1,136 @@ +{ + "name": "hostInfoOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 0, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Invoke/README.md b/host_function/Invoke/README.md new file mode 100644 index 00000000..eb4bf3ee --- /dev/null +++ b/host_function/Invoke/README.md @@ -0,0 +1,34 @@ +# Host Invoke +- m: The newly created PVM. +- machine map: **m** in GP. + +## hostInvokeHALT +- m program: [0, 0, 5, 61, 7, 0, 0, 2, 1] (u32 [0x20000] = a0) +1. Successfully read gas, registers from memory and retrieved m. +2. Successfully executed m's program and caused regular HALT. + +## hostInvokeOOB +1. Failed to read m's gas and registers from memory. + +## hostInvokeWHO +1. Failed to retrieve m from the machine map. + +## hostInvokeHOST +- m program: [0, 0, 1, 10, 1] (call host gas) +1. Successfully read gas, registers from memory and retrieved m. +2. Successfully executed m's program and caused HOST. + +## hostInvokeFAULT +- m program: [0, 0, 5, 61, 7, 0, 0, 2, 1] (u32 [0x20000] = a0) +1. Successfully read gas, registers from memory and retrieved m. +2. Failed to execute m's program due to a memory permission error and caused FAULT. + +## hostInvokeOOG +- m program: [0, 0, 1, 10, 1] (call host gas) +1. Successfully read gas, registers from memory and retrieved m. +2. Failed to execute m's program due to insufficient gas and caused OOG. + +## hostInvokePANIC +- m program: [0, 0, 1, 0, 1] (call trap) +1. Successfully read gas, registers from memory and retrieved m. +2. Successfully executed m's program and caused PANIC. diff --git a/host_function/Invoke/hostInvokeFAULT.json b/host_function/Invoke/hostInvokeFAULT.json new file mode 100644 index 00000000..be06120a --- /dev/null +++ b/host_function/Invoke/hostInvokeFAULT.json @@ -0,0 +1,326 @@ +{ + "name": "hostInvokeFAULT", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 2, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Invoke/hostInvokeHALT.json b/host_function/Invoke/hostInvokeHALT.json new file mode 100644 index 00000000..c37aed08 --- /dev/null +++ b/host_function/Invoke/hostInvokeHALT.json @@ -0,0 +1,331 @@ +{ + "name": "hostInvokeHALT", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 100, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 5 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Invoke/hostInvokeHOST.json b/host_function/Invoke/hostInvokeHOST.json new file mode 100644 index 00000000..24a0c599 --- /dev/null +++ b/host_function/Invoke/hostInvokeHOST.json @@ -0,0 +1,318 @@ +{ + "name": "hostInvokeHOST", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 3, + "8": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 1 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Invoke/hostInvokeOOB.json b/host_function/Invoke/hostInvokeOOB.json new file mode 100644 index 00000000..96c32fca --- /dev/null +++ b/host_function/Invoke/hostInvokeOOB.json @@ -0,0 +1,318 @@ +{ + "name": "hostInvokeOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Invoke/hostInvokeOOG.json b/host_function/Invoke/hostInvokeOOG.json new file mode 100644 index 00000000..2917fb88 --- /dev/null +++ b/host_function/Invoke/hostInvokeOOG.json @@ -0,0 +1,318 @@ +{ + "name": "hostInvokeOOG", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 5, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 4, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 5, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 1 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Invoke/hostInvokePANIC.json b/host_function/Invoke/hostInvokePANIC.json new file mode 100644 index 00000000..61654bef --- /dev/null +++ b/host_function/Invoke/hostInvokePANIC.json @@ -0,0 +1,318 @@ +{ + "name": "hostInvokePANIC", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 0, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 1, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 0, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Invoke/hostInvokeWHO.json b/host_function/Invoke/hostInvokeWHO.json new file mode 100644 index 00000000..04db0573 --- /dev/null +++ b/host_function/Invoke/hostInvokeWHO.json @@ -0,0 +1,318 @@ +{ + "name": "hostInvokeWHO", + "initial-gas": 10000, + "initial-regs": { + "7": 999, + "8": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551612, + "8": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 1, + 10, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Lookup/README.md b/host_function/Lookup/README.md new file mode 100644 index 00000000..7b1b9dee --- /dev/null +++ b/host_function/Lookup/README.md @@ -0,0 +1,24 @@ +# Host Lookup + +## hostLookupOK_s +1. Successfully read service account **s** from initial service account. +2. Read the preimage blob hash from memory and compute h. +3. Successfully read the preimage blob. +4. Write the preimage blob into memory. +5. Write the length of the preimage blob into omega_7. + +## hostLookupOK_d_omega_7 +1. Successfully read service account from delta with service index = omega_7. +2. Read the preimage blob hash from memory and compute h. +3. Successfully read the preimage blob. +4. Write the preimage blob into memory. +5. Write the length of the preimage blob into omega_7. + +## hostLookupOOB +1. Successfully read service index = 0 from delta. +2. Failed to read the preimage blob hash from memory due to a permission error. + +## hostLookupNONE +1. Successfully read service index = 0 from delta. +2. Read the preimage blob hash from memory and compute h. +3. Failed to read the preimage blob due to an invalid preimage blob key. \ No newline at end of file diff --git a/host_function/Lookup/hostLookupNONE.json b/host_function/Lookup/hostLookupNONE.json new file mode 100644 index 00000000..06a66c55 --- /dev/null +++ b/host_function/Lookup/hostLookupNONE.json @@ -0,0 +1,206 @@ +{ + "name": "hostLookupNONE", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 1, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 18446744073709551615, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Lookup/hostLookupOK_d_omega7.json b/host_function/Lookup/hostLookupOK_d_omega7.json new file mode 100644 index 00000000..641eab46 --- /dev/null +++ b/host_function/Lookup/hostLookupOK_d_omega7.json @@ -0,0 +1,186 @@ +{ + "name": "hostLookupOK_d_omega7", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 999, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 12, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Lookup/hostLookupOK_s.json b/host_function/Lookup/hostLookupOK_s.json new file mode 100644 index 00000000..dbcaec7b --- /dev/null +++ b/host_function/Lookup/hostLookupOK_s.json @@ -0,0 +1,166 @@ +{ + "name": "hostLookupOK_s", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 12, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Lookup/hostLookupOOB.json b/host_function/Lookup/hostLookupOOB.json new file mode 100644 index 00000000..82a4948d --- /dev/null +++ b/host_function/Lookup/hostLookupOOB.json @@ -0,0 +1,206 @@ +{ + "name": "hostLookupOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 0, + "8": 131072, + "9": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 1, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 18446744073709551613, + "8": 131072, + "9": 131072 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Machine/README.md b/host_function/Machine/README.md new file mode 100644 index 00000000..d0bd051b --- /dev/null +++ b/host_function/Machine/README.md @@ -0,0 +1,8 @@ +# Host Machine +- machine map: **m** in GP. +## hostMachineOK +1. Successfully read the PVM program from memory. +2. Successfully obtained the new machine index `n` and inserted the program, memory, and program counter into machine map. + +## hostMachineOOB +1. Failed to read the PVM program from memory. diff --git a/host_function/Machine/hostMachineOK.json b/host_function/Machine/hostMachineOK.json new file mode 100644 index 00000000..e8ce05ef --- /dev/null +++ b/host_function/Machine/hostMachineOK.json @@ -0,0 +1,121 @@ +{ + "name": "hostMachineOK", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 9, + "9": 0 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": {} + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 1, + "8": 9, + "9": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": {} + }, + "I": 0 + }, + "1": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": {} + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Machine/hostMachineOOB.json b/host_function/Machine/hostMachineOOB.json new file mode 100644 index 00000000..61e229ea --- /dev/null +++ b/host_function/Machine/hostMachineOOB.json @@ -0,0 +1,68 @@ +{ + "name": "hostMachineOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 9, + "9": 0 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-refine-map": {}, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 9, + "9": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-refine-map": {}, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/New/README.md b/host_function/New/README.md new file mode 100644 index 00000000..158f2abb --- /dev/null +++ b/host_function/New/README.md @@ -0,0 +1,13 @@ +# Host New + +## hostNewOK +1. Read the preimage blob hash from memory. +2. Successfully created a new service **a**. +3. Write the previous **xi** to **omega_7** and update **xi, xud**. + +## hostNewOOB +1. Failed to read the preimage blob hash from memory. + +## hostNewCASH +1. Read the preimage blob hash from memory. +2. Failed to create a new service **a** due to insufficient balance. \ No newline at end of file diff --git a/host_function/New/hostNewCASH.json b/host_function/New/hostNewCASH.json new file mode 100644 index 00000000..0983f739 --- /dev/null +++ b/host_function/New/hostNewCASH.json @@ -0,0 +1,396 @@ +{ + "name": "hostNewCASH", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 131072, + "8": 12, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 300, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 18446744073709551609, + "8": 12, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 300, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/New/hostNewOK.json b/host_function/New/hostNewOK.json new file mode 100644 index 00000000..b01c389a --- /dev/null +++ b/host_function/New/hostNewOK.json @@ -0,0 +1,410 @@ +{ + "name": "hostNewOK", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 131072, + "8": 12, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 1, + "8": 12, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 555, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 807, + "g": 100, + "m": 200 + }, + "1": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": {}, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 193, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/New/hostNewOOB.json b/host_function/New/hostNewOOB.json new file mode 100644 index 00000000..989d0e38 --- /dev/null +++ b/host_function/New/hostNewOOB.json @@ -0,0 +1,396 @@ +{ + "name": "hostNewOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 100, + "7": 131072, + "8": 12, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 100, + "7": 18446744073709551613, + "8": 12, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Peek/README.md b/host_function/Peek/README.md new file mode 100644 index 00000000..052a4b8e --- /dev/null +++ b/host_function/Peek/README.md @@ -0,0 +1,14 @@ +# Host Peek +- vm: The PVM that is currently executing the program. +- m: The newly created PVM. +- machine map: **m** in GP. + +## hostPeekOK +1. Successfully read data from m.memory. +2. Successfully wrote data to vm.memory. + +## hostPeekOOB +1. Failed to read data from m.memory or failed to write data to vm.memory. + +## hostPeekWHO +1. Failed to retrieve m from the machine map. \ No newline at end of file diff --git a/host_function/Peek/hostPeekOK.json b/host_function/Peek/hostPeekOK.json new file mode 100644 index 00000000..be22e294 --- /dev/null +++ b/host_function/Peek/hostPeekOK.json @@ -0,0 +1,134 @@ +{ + "name": "hostPeekOK", + "initial-gas": 10000, + "initial-regs": { + "10": 9, + "7": 0, + "8": 135168, + "9": 131072 + }, + "initial-memory": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 9, + "7": 0, + "8": 135168, + "9": 131072 + }, + "expected-memory": { + "pages": { + "33": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Peek/hostPeekOOB.json b/host_function/Peek/hostPeekOOB.json new file mode 100644 index 00000000..75ed5dcd --- /dev/null +++ b/host_function/Peek/hostPeekOOB.json @@ -0,0 +1,124 @@ +{ + "name": "hostPeekOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 9, + "7": 0, + "8": 135168, + "9": 131072 + }, + "initial-memory": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 9, + "7": 18446744073709551613, + "8": 135168, + "9": 131072 + }, + "expected-memory": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Peek/hostPeekWHO.json b/host_function/Peek/hostPeekWHO.json new file mode 100644 index 00000000..9e68e4fa --- /dev/null +++ b/host_function/Peek/hostPeekWHO.json @@ -0,0 +1,124 @@ +{ + "name": "hostPeekWHO", + "initial-gas": 10000, + "initial-regs": { + "10": 9, + "7": 999, + "8": 135168, + "9": 131072 + }, + "initial-memory": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 9, + "7": 18446744073709551612, + "8": 135168, + "9": 131072 + }, + "expected-memory": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Poke/README.md b/host_function/Poke/README.md new file mode 100644 index 00000000..e69225af --- /dev/null +++ b/host_function/Poke/README.md @@ -0,0 +1,14 @@ +# Host Poke +- vm: The PVM that is currently executing the program. +- m: The newly created PVM. +- machine map: **m** in GP. + +## hostPokeOK +1. Successfully read data from vm.memory. +2. Successfully wrote data to m.memory. + +## hostPokeOOB +1. Failed to write data to m.memory or failed to read data from vm.memory. + +## hostPokeWHO +1. Failed to retrieve m from the machine map. diff --git a/host_function/Poke/hostPokeOK.json b/host_function/Poke/hostPokeOK.json new file mode 100644 index 00000000..d35ec319 --- /dev/null +++ b/host_function/Poke/hostPokeOK.json @@ -0,0 +1,134 @@ +{ + "name": "hostPokeOK", + "initial-gas": 10000, + "initial-regs": { + "10": 9, + "7": 0, + "8": 131072, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 9, + "7": 0, + "8": 131072, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "33": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Poke/hostPokeOOB.json b/host_function/Poke/hostPokeOOB.json new file mode 100644 index 00000000..51c67729 --- /dev/null +++ b/host_function/Poke/hostPokeOOB.json @@ -0,0 +1,124 @@ +{ + "name": "hostPokeOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 9, + "7": 0, + "8": 131072, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 9, + "7": 18446744073709551613, + "8": 131072, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Poke/hostPokeWHO.json b/host_function/Poke/hostPokeWHO.json new file mode 100644 index 00000000..985c84da --- /dev/null +++ b/host_function/Poke/hostPokeWHO.json @@ -0,0 +1,124 @@ +{ + "name": "hostPokeWHO", + "initial-gas": 10000, + "initial-regs": { + "10": 9, + "7": 999, + "8": 131072, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "10": 9, + "7": 18446744073709551612, + "8": 131072, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "33": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Query/README.md b/host_function/Query/README.md new file mode 100644 index 00000000..3f4f6203 --- /dev/null +++ b/host_function/Query/README.md @@ -0,0 +1,28 @@ +# Host Query + +## hostQueryOK_0_timeslots +1. Read the preimage blob hash from memory. +2. Successfully retrieve service **a** based on the service index xs. +3. Write 0 into omega_7 and 0 into omega_8. + +## hostQueryOK_1_timeslots +1. Read the preimage blob hash from memory. +2. Successfully retrieve service **a** based on the service index xs. +3. Update omega_7 and omega_8 with the value of timeslots. + +## hostQueryOK_2_timeslots +1. Read the preimage blob hash from memory. +2. Successfully retrieve service **a** based on the service index xs. +3. Update omega_7 and omega_8 with the value of timeslots. + +## hostQueryOK_3_timeslots +1. Read the preimage blob hash from memory. +2. Successfully retrieve service **a** based on the service index xs. +3. Update omega_7 and omega_8 with the value of timeslots. + +## hostQueryOOB +1. Failed to read the preimage blob hash from memory. + +## hostQueryNONE +1. Read the preimage blob hash from memory. +2. Failed to retrieve service **a** based on the service index xs. diff --git a/host_function/Query/hostQueryNONE.json b/host_function/Query/hostQueryNONE.json new file mode 100644 index 00000000..a1c9e269 --- /dev/null +++ b/host_function/Query/hostQueryNONE.json @@ -0,0 +1,260 @@ +{ + "name": "hostQueryNONE", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551615, + "8": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Query/hostQueryOK_0_timeslots.json b/host_function/Query/hostQueryOK_0_timeslots.json new file mode 100644 index 00000000..0baaab10 --- /dev/null +++ b/host_function/Query/hostQueryOK_0_timeslots.json @@ -0,0 +1,260 @@ +{ + "name": "hostQueryOK_0_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Query/hostQueryOK_1_timeslots.json b/host_function/Query/hostQueryOK_1_timeslots.json new file mode 100644 index 00000000..b007cca7 --- /dev/null +++ b/host_function/Query/hostQueryOK_1_timeslots.json @@ -0,0 +1,264 @@ +{ + "name": "hostQueryOK_1_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 42949672961, + "8": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Query/hostQueryOK_2_timeslots.json b/host_function/Query/hostQueryOK_2_timeslots.json new file mode 100644 index 00000000..91661dec --- /dev/null +++ b/host_function/Query/hostQueryOK_2_timeslots.json @@ -0,0 +1,266 @@ +{ + "name": "hostQueryOK_2_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 42949672962, + "8": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Query/hostQueryOK_3_timeslots.json b/host_function/Query/hostQueryOK_3_timeslots.json new file mode 100644 index 00000000..74a4110a --- /dev/null +++ b/host_function/Query/hostQueryOK_3_timeslots.json @@ -0,0 +1,268 @@ +{ + "name": "hostQueryOK_3_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100, + 1000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 42949672963, + "8": 4294967296100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100, + 1000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Query/hostQueryOOB.json b/host_function/Query/hostQueryOOB.json new file mode 100644 index 00000000..3da3e515 --- /dev/null +++ b/host_function/Query/hostQueryOOB.json @@ -0,0 +1,260 @@ +{ + "name": "hostQueryOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/README.md b/host_function/README.md new file mode 100644 index 00000000..6bae43f1 --- /dev/null +++ b/host_function/README.md @@ -0,0 +1,263 @@ +# Host function test vectors (Based on GP-0.5.4) + +This set of test vectors is primarily used to test the host functions of GP-B.6, B.7, and B.8. + +The test vectors mainly (only) verify whether the changes to all parameters before and after the execution of the host functions meet expectations. + +For more details about the test vectors, please refer to the note section below. + +## B.6 General Functions +- [ ] Gas + - [ ] OK +- [x] Lookup + - [x] OK_s + - [x] OK_d_omega7 + - [x] OOB + - [x] NONE +- [x] Read + - [x] OK_s + - [x] OK_d_omega7 + - [x] OOB + - [x] NONE +- [x] Write + - [x] OK + - [x] OOB + - [x] NONE + - [x] FULL +- [x] Info + - [x] OK + - [x] OOB + - [x] NONE + +## B.7 Accumulate Functions +- [ ] Bless + - [ ] OK + - [ ] OOB + - [ ] WHO +- [ ] Assign + - [ ] OK + - [ ] OOB + - [ ] CORE +- [ ] Designate + - [ ] OK + - [ ] OOB +- [ ] Checkpoint + - [ ] OK +- [x] New + - [x] OK + - [x] OOB + - [x] CASH +- [x] Upgrade + - [x] OK + - [x] OOB +- [x] Transfer + - [x] OK + - [x] OOB + - [x] WHO + - [x] CASH + - [x] LOW +- [x] Eject + - [x] OK + - [x] OOB + - [x] WHO + - [x] HUH +- [x] Query + - [x] OK_0_timeslots + - [x] OK_1_timeslots + - [x] OK_2_timeslots + - [x] OK_3_timeslots + - [x] OOB + - [x] NONE +- [x] Solicit + - [x] OK_no_timeslots + - [x] OK_2_timeslots + - [x] OOB + - [x] FULL + - [x] HUH +- [x] Forget + - [x] OK_0_timeslots + - [x] OK_1_timeslots + - [x] OK_2_timeslots + - [x] OK_3_timeslots + - [x] OOB + - [x] HUH +- [x] Yield + - [x] OK + - [x] OOB + + +## B.8 Refine Functions +- [x] Historical_lookup + - [x] OK_d_s + - [x] OK_d_omega7 + - [x] OOB + - [x] NONE +- [x] Import + - [x] OK + - [x] OK_gt_wg + - [x] OOB + - [x] NONE +- [x] Export + - [x] OK + - [x] OK_gt_wg + - [x] OOB + - [x] FULL +- [x] Machine + - [x] OK + - [x] OOB +- [x] Peek + - [x] OK + - [x] OOB + - [x] WHO +- [x] Poke + - [x] OK + - [x] OOB + - [x] WHO +- [x] Zero + - [x] OK + - [x] OOB + - [x] WHO +- [x] Void + - [x] OK + - [x] OOB + - [x] WHO +- [x] Invoke + - [x] HALT + - [x] OOB + - [x] OOG + - [x] WHO + - [x] HOST + - [x] FAULT + - [x] PANIC +- [x] Expunge + - [x] OK + - [x] WHO + +--- + +# Note + +## Test Case Structure +All parameters used by the host functions will be provided in **JSON** format, following the definitions in GP. + +## Test Case Prefix +In all test cases, variables with the prefix **initial** represent the state of the variable **before execution**, while those with the prefix **expected** represent the state of the variable **after execution**. + +## Service Account Dictionaries +**Storage** and **Preimage** dictionaries are stored according to the definitions in GP, but the **Lookup** dictionary is slightly different because its key contains two elements and cannot be directly stored in JSON. The calculation process for each type of key is as follows: + +--- + +### Storage Dictionary +**Assumption** +- Service index = 0 +- Raw storage key = `0x00000000` +- Storage value = `0x00000000` + +--- + +#### Calculation Formula: `H(E4(s) ⌢ µko⋅⋅⋅+kz)` +Convert the service index to **little endian** 4 bytes, concatenate it with the storage key, and apply the **blake2b** hash. + +- `E4(s) = E4(0) = 0x00000000` +- `µko⋅⋅⋅+kz = 0x00000000` +- `H(E4(s) ⌢ µko⋅⋅⋅+kz) = H(0x0000000000000000) =` + **`0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c`** + +#### Example of JSON Format: +```json +"s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] +} +``` + +--- + +### Preimage Blob Dictionary +**Assumption** +- Preimage Blob = `[15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10]` + (i.e., `0xffffeeeeddddccccbbbbaaaa`) +- `Preimage Blob Hash =` + **`H(0xffffeeeeddddccccbbbbaaaa) = 0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337`** + +--- + +#### Calculation Formula: `H(µho⋅⋅⋅+32)` +Hash the **Preimage Blob Hash** again. + +- `H(0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337) =` + **`0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad`** + +#### Example of JSON Format: +```json +"p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] +} +``` + +--- + +### Preimage Lookup Dictionary +The key of the preimage lookup contains two elements: +- The preimage blob hash +- The preimage blob length + +The value contains one element: +- The timeslots + +Since a JSON key can only be a string, only the preimage blob hash is stored as the key. The preimage blob length is stored within the corresponding value. As a result, the modified key contains only one element: +- The preimage blob hash + +The modified value contains two elements: +- The preimage blob length +- The timeslots + +--- + +**Assumption** +- Preimage Blob = `[15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10]` +- `Preimage Blob Hash = 0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337` +- `Preimage Blob Length = 12` +- `Timeslots = [100]` + +--- + +#### Original Preimage Lookup +`{Preimage Blob Hash, Preimage Blob Length} -> Timeslots` = + **`{0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337, 12} -> [100]`** + +#### Modified Preimage Lookup +`Preimage Blob Hash -> {Preimage Blob Length, Timeslots}` = + **`0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337 -> {12, [100]}`** + +--- + +#### Example of JSON Format: +```json +"l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "l": 12, + "t": [ + 100 + ] + } +} +``` \ No newline at end of file diff --git a/host_function/Read/README.md b/host_function/Read/README.md new file mode 100644 index 00000000..a9e94aa2 --- /dev/null +++ b/host_function/Read/README.md @@ -0,0 +1,24 @@ +# Host Read + +## hostReadOK_s +1. Successfully read service account **s** from initial service account. +2. Read the storage key from memory and compute k. +3. Successfully read the storage value. +4. Write the storage value into memory. +5. Write the length of the storage value into omega_7. + +## hostReadOK_d_omega7 +1. Successfully read service account from initial delta with service index = omega_7. +2. Read the storage key from memory and compute k. +3. Successfully read the storage value. +4. Write the storage value into memory. +5. Write the length of the storage value into omega_7. + +## hostReadOOB +1. Successfully read service account **s** from initial service account. +2. Failed to read the storage key from memory due to a permission error. + +## hostReadNONE +1. Successfully read service account **s** from initial service account. +2. Read the storage key from memory and compute k. +3. Failed to read the storage value due to an invalid storage key. \ No newline at end of file diff --git a/host_function/Read/hostReadNONE.json b/host_function/Read/hostReadNONE.json new file mode 100644 index 00000000..efc0d228 --- /dev/null +++ b/host_function/Read/hostReadNONE.json @@ -0,0 +1,132 @@ +{ + "name": "hostReadNONE", + "initial-gas": 10000, + "initial-regs": { + "10": 131072, + "11": 100, + "7": 0, + "8": 131072, + "9": 4 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 1, + 1, + 1, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 131072, + "11": 100, + "7": 18446744073709551615, + "8": 131072, + "9": 4 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 1, + 1, + 1, + 1 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Read/hostReadOK_d_omega7.json b/host_function/Read/hostReadOK_d_omega7.json new file mode 100644 index 00000000..02566bed --- /dev/null +++ b/host_function/Read/hostReadOK_d_omega7.json @@ -0,0 +1,152 @@ +{ + "name": "hostReadOK_d_omega7", + "initial-gas": 10000, + "initial-regs": { + "10": 131072, + "11": 100, + "7": 0, + "8": 131072, + "9": 4 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + }, + "initial-service-index": 999, + "initial-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-gas": 9990, + "expected-regs": { + "10": 131072, + "11": 100, + "7": 4, + "8": 131072, + "9": 4 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "expected-service-account": { + "s_map": {}, + "l_map": {}, + "p_map": {}, + "code_hash": "", + "balance": 0, + "g": 0, + "m": 0 + } +} \ No newline at end of file diff --git a/host_function/Read/hostReadOK_s.json b/host_function/Read/hostReadOK_s.json new file mode 100644 index 00000000..45b844fc --- /dev/null +++ b/host_function/Read/hostReadOK_s.json @@ -0,0 +1,132 @@ +{ + "name": "hostReadOK_s", + "initial-gas": 10000, + "initial-regs": { + "10": 131072, + "11": 100, + "7": 0, + "8": 131072, + "9": 4 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 131072, + "11": 100, + "7": 4, + "8": 131072, + "9": 4 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Read/hostReadOOB.json b/host_function/Read/hostReadOOB.json new file mode 100644 index 00000000..74ed83c3 --- /dev/null +++ b/host_function/Read/hostReadOOB.json @@ -0,0 +1,132 @@ +{ + "name": "hostReadOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 131072, + "11": 100, + "7": 0, + "8": 131072, + "9": 4 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 131072, + "11": 100, + "7": 18446744073709551613, + "8": 131072, + "9": 4 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Solicit/README.md b/host_function/Solicit/README.md new file mode 100644 index 00000000..aac67680 --- /dev/null +++ b/host_function/Solicit/README.md @@ -0,0 +1,19 @@ +# Host Solicit + +## hostSolicitOK_no_timeslots +1. Read the preimage blob hash from memory. +2. Successfully initialized empty timeslots for **a**'s lookup. + +## hostSolicitOK_2_timeslots +1. Read the preimage blob hash from memory. +2. Successfully added a new timeslot to **a**'s lookup. + +## hostSolicitOOB +1. Failed to read the preimage blob hash from memory. + +## hostSolicitHUH +1. Read the preimage blob hash from memory. +2. Service account's lookup doesn't meet any condition. + +## hostSolicitFULL +1. Failed to proceed because **a** has insufficient balance. diff --git a/host_function/Solicit/hostSolicitFULL.json b/host_function/Solicit/hostSolicitFULL.json new file mode 100644 index 00000000..7760f02f --- /dev/null +++ b/host_function/Solicit/hostSolicitFULL.json @@ -0,0 +1,394 @@ +{ + "name": "hostSolicitFULL", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 90, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 100, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551611, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 90, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Solicit/hostSolicitHUH.json b/host_function/Solicit/hostSolicitHUH.json new file mode 100644 index 00000000..bbb02ba0 --- /dev/null +++ b/host_function/Solicit/hostSolicitHUH.json @@ -0,0 +1,392 @@ +{ + "name": "hostSolicitHUH", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 100, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551606, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Solicit/hostSolicitOK_2_timeslots.json b/host_function/Solicit/hostSolicitOK_2_timeslots.json new file mode 100644 index 00000000..0543fd46 --- /dev/null +++ b/host_function/Solicit/hostSolicitOK_2_timeslots.json @@ -0,0 +1,267 @@ +{ + "name": "hostSolicitOK_2_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 29800, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100, + 29800 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Solicit/hostSolicitOK_no_timeslots.json b/host_function/Solicit/hostSolicitOK_no_timeslots.json new file mode 100644 index 00000000..77920a7d --- /dev/null +++ b/host_function/Solicit/hostSolicitOK_no_timeslots.json @@ -0,0 +1,255 @@ +{ + "name": "hostSolicitOK_no_timeslots", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": {}, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 29800, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Solicit/hostSolicitOOB.json b/host_function/Solicit/hostSolicitOOB.json new file mode 100644 index 00000000..7aacb087 --- /dev/null +++ b/host_function/Solicit/hostSolicitOOB.json @@ -0,0 +1,394 @@ +{ + "name": "hostSolicitOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 12 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 100, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 12 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 10, + 100 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Transfer/README.md b/host_function/Transfer/README.md new file mode 100644 index 00000000..5b0f47c4 --- /dev/null +++ b/host_function/Transfer/README.md @@ -0,0 +1,20 @@ +# Host Transfer + +## hostTransferOK +1. Read the transfer memo from memory. +2. Successfully deducted the balance of **xs** and inserted a deferred transfer. + +## hostTransferOOB +1. Failed to read the transfer memo from memory. + +## hostTransferWHO +1. Failed to add deferred transfer due to receiver not existing. + +## hostTransferLOW +1. Failed to add deferred transfer due to **g** being less than the receiver's **g**. + +## hostTransferHIGH +1. Failed to add deferred transfer due to **g** being larger than **ϱ**. + +## hostTransferCASH +1. Failed to add deferred transfer due to insufficient balance of **xs**. \ No newline at end of file diff --git a/host_function/Transfer/hostTransferCASH.json b/host_function/Transfer/hostTransferCASH.json new file mode 100644 index 00000000..3167fdf1 --- /dev/null +++ b/host_function/Transfer/hostTransferCASH.json @@ -0,0 +1,472 @@ +{ + "name": "hostTransferCASH", + "initial-gas": 10000000000000, + "initial-regs": { + "10": 131072, + "7": 1, + "8": 1000, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9570503269390, + "expected-regs": { + "10": 131072, + "7": 18446744073709551609, + "8": 1000, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Transfer/hostTransferLOW.json b/host_function/Transfer/hostTransferLOW.json new file mode 100644 index 00000000..94d373d1 --- /dev/null +++ b/host_function/Transfer/hostTransferLOW.json @@ -0,0 +1,472 @@ +{ + "name": "hostTransferLOW", + "initial-gas": 10000000000000, + "initial-regs": { + "10": 131072, + "7": 1, + "8": 100, + "9": 10 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9957050326930, + "expected-regs": { + "10": 131072, + "7": 18446744073709551608, + "8": 100, + "9": 10 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Transfer/hostTransferOK.json b/host_function/Transfer/hostTransferOK.json new file mode 100644 index 00000000..96e9877e --- /dev/null +++ b/host_function/Transfer/hostTransferOK.json @@ -0,0 +1,801 @@ +{ + "name": "hostTransferOK", + "initial-gas": 10000000000000, + "initial-regs": { + "10": 131072, + "7": 1, + "8": 100, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9570503270290, + "expected-regs": { + "10": 131072, + "7": 0, + "8": 100, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 900, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [ + { + "sender_index": 0, + "receiver_index": 1, + "amount": 100, + "memo": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "gas_limit": 100 + } + ], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Transfer/hostTransferOOB.json b/host_function/Transfer/hostTransferOOB.json new file mode 100644 index 00000000..7679d315 --- /dev/null +++ b/host_function/Transfer/hostTransferOOB.json @@ -0,0 +1,472 @@ +{ + "name": "hostTransferOOB", + "initial-gas": 10000000000000, + "initial-regs": { + "10": 131072, + "7": 1, + "8": 100, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9570503270290, + "expected-regs": { + "10": 131072, + "7": 18446744073709551613, + "8": 100, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Transfer/hostTransferWHO.json b/host_function/Transfer/hostTransferWHO.json new file mode 100644 index 00000000..94985780 --- /dev/null +++ b/host_function/Transfer/hostTransferWHO.json @@ -0,0 +1,472 @@ +{ + "name": "hostTransferWHO", + "initial-gas": 10000000000000, + "initial-regs": { + "10": 131072, + "7": 999, + "8": 100, + "9": 100 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9570503270290, + "expected-regs": { + "10": 131072, + "7": 18446744073709551612, + "8": 100, + "9": 100 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "1": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Upgrade/README.md b/host_function/Upgrade/README.md new file mode 100644 index 00000000..3db96835 --- /dev/null +++ b/host_function/Upgrade/README.md @@ -0,0 +1,8 @@ +# Host Upgrade + +## hostUpgradeOK +1. Read the preimage blob hash from memory. +2. Successfully updated the **c**, **g**, and **m** from **xs**. + +## hostUpgradeOOB +1. Failed to read the preimage blob hash from memory. diff --git a/host_function/Upgrade/hostUpgradeOK.json b/host_function/Upgrade/hostUpgradeOK.json new file mode 100644 index 00000000..4414e54d --- /dev/null +++ b/host_function/Upgrade/hostUpgradeOK.json @@ -0,0 +1,394 @@ +{ + "name": "hostUpgradeOK", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 1000, + "9": 2000 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 1000, + "9": 2000 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1000, + "g": 1000, + "m": 2000 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Upgrade/hostUpgradeOOB.json b/host_function/Upgrade/hostUpgradeOOB.json new file mode 100644 index 00000000..4186649b --- /dev/null +++ b/host_function/Upgrade/hostUpgradeOOB.json @@ -0,0 +1,394 @@ +{ + "name": "hostUpgradeOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072, + "8": 1000, + "9": 2000 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 1000, + "9": 2000 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + }, + "expected-xcontent-y": { + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": { + "t": null, + "l": 0 + } + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Void/README.md b/host_function/Void/README.md new file mode 100644 index 00000000..a23bd4f8 --- /dev/null +++ b/host_function/Void/README.md @@ -0,0 +1,13 @@ +# Host Void +- m: The newly created PVM. +- machine map: **m** in GP. + +## hostVoidOK +1. Successfully retrieved m. +2. Successfully set m's page value to [0,0,...] and set m's page access to inaccessible. + +## hostVoidOOB +1. Pages from p to (p+c) are already inaccessible, leading to an OOB error. + +## hostVoidWHO +1. Failed to retrieve m from the machine map. \ No newline at end of file diff --git a/host_function/Void/hostVoidOK.json b/host_function/Void/hostVoidOK.json new file mode 100644 index 00000000..fc7eb351 --- /dev/null +++ b/host_function/Void/hostVoidOK.json @@ -0,0 +1,102 @@ +{ + "name": "hostVoidOK", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 32, + "9": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 32, + "9": 1 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Void/hostVoidOOB.json b/host_function/Void/hostVoidOOB.json new file mode 100644 index 00000000..05eab635 --- /dev/null +++ b/host_function/Void/hostVoidOOB.json @@ -0,0 +1,102 @@ +{ + "name": "hostVoidOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 32, + "9": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 32, + "9": 1 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Void/hostVoidWHO.json b/host_function/Void/hostVoidWHO.json new file mode 100644 index 00000000..9236d9c4 --- /dev/null +++ b/host_function/Void/hostVoidWHO.json @@ -0,0 +1,102 @@ +{ + "name": "hostVoidWHO", + "initial-gas": 10000, + "initial-regs": { + "7": 999, + "8": 32, + "9": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551612, + "8": 32, + "9": 1 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Write/README.md b/host_function/Write/README.md new file mode 100644 index 00000000..488b0f24 --- /dev/null +++ b/host_function/Write/README.md @@ -0,0 +1,21 @@ +## hostWriteOK +1. Successfully read service account **a** from the initial service account. +2. Read the storage key from memory and compute **k**. +3. Read the storage value from memory. +4. Successfully updated the storage value. +5. Write the length of the original storage value into **omega_7**. + +## hostWriteOOB +1. Successfully read service account **a** from the initial service account. +2. Failed to read the storage key from memory due to a permission error. + +## hostWriteFULL +1. Successfully read service account **a** from the initial service account. +2. Read the storage key from memory and compute **k**. +3. Failed to update the storage value due to insufficient balance. + +## hostWriteNONE +1. Successfully read service account **a** from the initial service account. +2. Read the storage key from memory and compute **k**. +3. Successfully deleted the storage based on the storage key. +4. Write **NONE** to **omega_7** since the previous storage key no longer exists. diff --git a/host_function/Write/hostWriteFULL.json b/host_function/Write/hostWriteFULL.json new file mode 100644 index 00000000..aff3aa9d --- /dev/null +++ b/host_function/Write/hostWriteFULL.json @@ -0,0 +1,156 @@ +{ + "name": "hostWriteFULL", + "initial-gas": 10000, + "initial-regs": { + "10": 4, + "7": 131072, + "8": 4, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + }, + "33": { + "value": [ + 1, + 2, + 3, + 4 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 90, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 4, + "7": 18446744073709551611, + "8": 4, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + }, + "33": { + "value": [ + 1, + 2, + 3, + 4 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 90, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Write/hostWriteNONE.json b/host_function/Write/hostWriteNONE.json new file mode 100644 index 00000000..c475ab62 --- /dev/null +++ b/host_function/Write/hostWriteNONE.json @@ -0,0 +1,149 @@ +{ + "name": "hostWriteNONE", + "initial-gas": 10000, + "initial-regs": { + "10": 0, + "7": 131072, + "8": 4, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + }, + "33": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 0, + "7": 18446744073709551615, + "8": 4, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + }, + "33": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": {}, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Write/hostWriteOK.json b/host_function/Write/hostWriteOK.json new file mode 100644 index 00000000..95c01cc4 --- /dev/null +++ b/host_function/Write/hostWriteOK.json @@ -0,0 +1,156 @@ +{ + "name": "hostWriteOK", + "initial-gas": 10000, + "initial-regs": { + "10": 4, + "7": 131072, + "8": 4, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + }, + "33": { + "value": [ + 1, + 2, + 3, + 4 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 4, + "7": 4, + "8": 4, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + }, + "33": { + "value": [ + 1, + 2, + 3, + 4 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 1, + 2, + 3, + 4 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Write/hostWriteOOB.json b/host_function/Write/hostWriteOOB.json new file mode 100644 index 00000000..e0edd1a6 --- /dev/null +++ b/host_function/Write/hostWriteOOB.json @@ -0,0 +1,156 @@ +{ + "name": "hostWriteOOB", + "initial-gas": 10000, + "initial-regs": { + "10": 4, + "7": 131072, + "8": 4, + "9": 135168 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + }, + "33": { + "value": [ + 1, + 2, + 3, + 4 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + }, + "initial-service-index": 0, + "initial-delta": {}, + "expected-gas": 9990, + "expected-regs": { + "10": 4, + "7": 18446744073709551613, + "8": 4, + "9": 135168 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 0, + 0, + 0, + 0 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + }, + "33": { + "value": [ + 1, + 2, + 3, + 4 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-delta": {}, + "expected-service-account": { + "s_map": { + "0x81e47a19e6b29b0a65b9591762ce5143ed30d0261e5d24a3201752506b20f15c": [ + 0, + 0, + 0, + 0 + ] + }, + "l_map": { + "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337": { + "t": [ + 100000 + ], + "l": 12 + } + }, + "p_map": { + "0x3ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371eca76dc72785cc5ad": [ + 15, + 15, + 14, + 14, + 13, + 13, + 12, + 12, + 11, + 11, + 10, + 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 200 + } +} \ No newline at end of file diff --git a/host_function/Yield/README.md b/host_function/Yield/README.md new file mode 100644 index 00000000..4a0ffbd8 --- /dev/null +++ b/host_function/Yield/README.md @@ -0,0 +1,8 @@ +# Host Yield + +## hostYieldOK +1. Read the preimage blob hash from memory. +2. Successfully updated **xy** with the preimage blob hash. + +## hostYieldOOB +1. Failed to read the preimage blob hash from memory. diff --git a/host_function/Yield/hostYieldOK.json b/host_function/Yield/hostYieldOK.json new file mode 100644 index 00000000..232c3c16 --- /dev/null +++ b/host_function/Yield/hostYieldOK.json @@ -0,0 +1,184 @@ +{ + "name": "hostYieldOK", + "initial-gas": 10000, + "initial-regs": { + "7": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": {}, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": {}, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Yield/hostYieldOOB.json b/host_function/Yield/hostYieldOOB.json new file mode 100644 index 00000000..74e28822 --- /dev/null +++ b/host_function/Yield/hostYieldOOB.json @@ -0,0 +1,184 @@ +{ + "name": "hostYieldOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 131072 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "initial-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": {}, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "initial-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, + 232, + 2, + 193, + 53, + 168, + 198, + 113, + 170, + 34, + 217, + 144, + 251, + 178, + 97, + 22, + 217, + 132, + 74, + 69, + 141, + 137, + 208, + 90, + 160, + 19, + 39, + 42, + 100, + 22, + 3, + 55 + ], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "expected-xcontent-x": { + "I": 1, + "S": 0, + "U": { + "D": {}, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [], + "Y": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "expected-xcontent-y": { + "I": 0, + "S": 0, + "U": null, + "T": null, + "Y": "" + } +} \ No newline at end of file diff --git a/host_function/Zero/README.md b/host_function/Zero/README.md new file mode 100644 index 00000000..84802197 --- /dev/null +++ b/host_function/Zero/README.md @@ -0,0 +1,13 @@ +# Host Zero +- m: The newly created PVM. +- machine map: **m** in GP. + +## hostZeroOK +1. Successfully retrieved m. +2. Successfully set m's page value to [0,0,...] and set m's page access to writable. + +## hostZeroOOB +1. Invalid page index p led to an OOB error. + +## hostZeroWHO +1. Failed to retrieve m from the machine map. \ No newline at end of file diff --git a/host_function/Zero/hostZeroOK.json b/host_function/Zero/hostZeroOK.json new file mode 100644 index 00000000..09cad22d --- /dev/null +++ b/host_function/Zero/hostZeroOK.json @@ -0,0 +1,102 @@ +{ + "name": "hostZeroOK", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 32, + "9": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 0, + "8": 32, + "9": 1 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Zero/hostZeroOOB.json b/host_function/Zero/hostZeroOOB.json new file mode 100644 index 00000000..6b6a243e --- /dev/null +++ b/host_function/Zero/hostZeroOOB.json @@ -0,0 +1,102 @@ +{ + "name": "hostZeroOOB", + "initial-gas": 10000, + "initial-regs": { + "7": 0, + "8": 15, + "9": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551613, + "8": 15, + "9": 1 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/Zero/hostZeroWHO.json b/host_function/Zero/hostZeroWHO.json new file mode 100644 index 00000000..96d5d2f9 --- /dev/null +++ b/host_function/Zero/hostZeroWHO.json @@ -0,0 +1,102 @@ +{ + "name": "hostZeroWHO", + "initial-gas": 10000, + "initial-regs": { + "7": 999, + "8": 32, + "9": 1 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "initial-export-segment": null, + "initial-import-segment": null, + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": {}, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "7": 18446744073709551612, + "8": 32, + "9": 1 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-refine-map": { + "0": { + "P": [ + 0, + 0, + 5, + 61, + 7, + 0, + 0, + 2, + 1 + ], + "U": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": true, + "writable": false, + "readable": false + } + } + } + }, + "I": 0 + } + }, + "expected-export-segment": null +} \ No newline at end of file diff --git a/host_function/templates/README.md b/host_function/templates/README.md new file mode 100644 index 00000000..f64e4a27 --- /dev/null +++ b/host_function/templates/README.md @@ -0,0 +1,601 @@ +# Templates Overview + +- [hostRefineTemplet](#hostRefineTemplet) +- [hostAccumulateTemplet](#hostAccumulateTemplet) +- [hostGeneralTemplet](#hostGeneralTemplet) + +--- + +# hostRefineTemplet +## **Element Descriptions** + +### **1. `name`** +- **Type**: String +- **Description**: The name of the template or configuration. +```json +"hostRefineTemplet" +``` + +--- + +### **2. `initial-gas`** +- **Type**: $\mathbb{N}_G$ +- **Description**: The initial gas +```json +10000 +``` + +--- + +### **3. `initial-regs`** +- **Type**: $\left[\!\left[ \mathbb{N}_R \right]\!\right]_{13}$ +- **Description**: The initial PVM register +```json +[ + 4294901760, 4278059008, 0, 0, 0, 0, 0, 4278124544, 12, 0, 0, 0, 0 +] +``` + +--- + +### **4. `initial-memory-permission`** +- **Type**: $\mathbb{M} \mathbf{.A}$ +- **Description**: Defines memory access permissions. +- **Fields**: + - `start`: $N$ + - `length`: $N$ + - `mode`: $\mathbb{[0,1,2]}$ +```json +[ + { + "start": 4278124544, + "length": 12, + "mode": 2 + } +] +``` + +--- + +### **5. `initial-memory`** +- **Type**: $\mathbb{M} \mathbf{.V}$ +- **Description**: The initial memory content values at specific addresses. +- **Fields**: + - `start`: $N$ + - `contents`: $\mathbb{Y}$ +```json +[ + { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + } +] +``` + +--- + +### **6. `initial-refine-map`** +- **Type**: $\mathbb{N}\to M$ +- **Description**: Initial Refine m map +- **Fields**: + - `P`: $\mathbb{Y}$ + - `U`: $\mathbb{M}$ + - `I`: $N_R$ +```json +{ + "0": { + "P": [0, 1, 2, 3, 4], + "U": { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + }, + "I": 0 + } +} +``` + +--- + +### **7. `initial-export-segment`** +- **Type**: $\left[\!\left[ \mathbb{Y} \right]\!\right]$ +- **Description**: Initial export segment +```json +[[]] +``` + +--- + +### **8. `initial-import-segment`** +- **Type**: $\left[\!\left[ \mathbb{G} \right]\!\right]$ +- **Description**: Initial import segment +```json +[[]] +``` + +--- + +### **9. `initial-export-segment-index`** +- **Type**: $N$ +- **Description**: Initial export segment index +```json +0 +``` + +--- + +### **10. `expected-gas`** +- **Type**: $N_G$ +- **Description**: The expected gas after computation +```json +9990 +``` + +--- + +### **11. `expected-regs`** +- **Type**: $\left[\!\left[ \mathbb{N}_R \right]\!\right]_{13}$ +- **Description**: The PVM register after computation +```json +[ + 4294901760, 4278059008, 0, 0, 0, 0, 0, 4278124544, 12, 0, 0, 0, 0 +] +``` + +--- + +### **12. `expected-memory`** +- **Type**: $\mathbb{M} \mathbf{.V}$ +- **Description**: The expected memory contents after computation. +```json +[ + { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + } +] +``` + +--- + +### **13. `expected-refine-map`** +- **Type**: $\mathbb{N}\to M$ +- **Description**: The expected refine-map after computation. +- **Fields**: + - `P`: $\mathbb{Y}$ + - `U`: $\mathbb{M}$ + - `I`: $N_R$ +```json +{ + "0": { + "P": [0, 1, 2, 3, 4], + "U": { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + }, + "I": 0 + } +} +``` + +--- + +### **14. `expected-export-segment`** +- **Type**: $\left[\!\left[ \mathbb{Y} \right]\!\right]$ +- **Description**: The expected state of export segments after computation. +```json +[[]] +``` +--- + +# hostAccumulateTemplet +## **Element Descriptions** + +### **1. `name`** +- **Type**: String +- **Description**: The name of the template or configuration. +```json +"hostAccumulateTemplet" +``` + +--- + +### **2. `initial-gas`** +- **Type**: $\mathbb{N}_G$ +- **Description**: The initial gas amount. +```json +10000 +``` + +--- + +### **3. `initial-regs`** +- **Type**: $\left[\!\left[ \mathbb{N}_R \right]\!\right]_{13}$ +- **Description**: The initial PVM register values. +```json +[ + 4294901760, 4278059008, 0, 0, 0, 0, 0, 4278124544, 12, 0, 0, 0, 0 +] +``` + +--- + +### **4. `initial-memory-permission`** +- **Type**: $\mathbb{M} \mathbf{.A}$ +- **Description**: Memory access permissions. +- **Fields**: + - `start`: $N$ + - `length`: $N$ + - `mode`: $\mathbb{[0,1,2]}$ +```json +[ + { + "Start": 4278124544, + "Length": 12, + "Mode": 2 + } +] +``` + +--- + +### **5. `initial-memory`** +- **Type**: $\mathbb{M} \mathbf{.V}$ +- **Description**: The initial memory content values at specific addresses. +- **Fields**: + - `start`: $N$ + - `contents`: $\mathbb{Y}$ +```json +[ + { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + } +] +``` + +--- + +### **6. `initial-xcontent-x`** +- **Type**: $\textbf{X}$ +- **Description**: Initial x context +```json +{ + "D": {}, + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 10000, + "min_item_gas": 100, + "min_memo_gas": 200, + "s_map": { + "0x0000000000000000000000000000000000000000000000000000000000000000": [0, 1, 2, 3] + }, + "l_map": { + "0x1111111111111111111111111111111111111111111111111111111111111111": [0, 1, 2, 3] + }, + "p_map": { + "0x2222222222222222222222222222222222222222222222222222222222222222": [0, 1, 2, 3] + } + } + }, + "upcoming_validators": null, + "authorizations_pool": [null, null], + "privileged_state": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": null + } + }, + "T": [] +} +``` + +--- + +### **7. `initial-xcontent-y`** +- **Type**: $\textbf{X}$ +- **Description**: Initial y context +```json +{ + "D": null, + "I": 0, + "S": 0, + "U": null, + "T": null +} +``` + +--- + +### **8. `initial-timeslot`** +- **Type**: $N$ +- **Description**: The initial timeslot. +```json +0 +``` + +--- + +### **9. `expected-gas`** +- **Type**: $\mathbb{N}_G$ +- **Description**: The gas amount after computation. +```json +9990 +``` + +--- + +### **10. `expected-regs`** +- **Type**: $\left[\!\left[ \mathbb{N}_R \right]\!\right]_{13}$ +- **Description**: The PVM register values after computation. +```json +[ + 4294901760, 4278059008, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0 +] +``` + +--- + +### **11. `expected-memory`** +- **Type**: $\mathbb{M} \mathbf{.V}$ +- **Description**: The memory content values after computation. +```json +[ + { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + } +] +``` + +--- + +### **12. `expected-xcontent-x`** +- **Type**: $\textbf{X}$ +- **Description**: The expected x content for after computation. +```json +{ + "D": null, + "I": 0, + "S": 0, + "U": null, + "T": [ + { + "sender_index": 0, + "receiver_index": 0, + "amount": 0, + "memo": [0, 1, 2, 3], + "gas_limit": 0 + } + ] +} +``` + +--- + +### **13. `expected-xcontent-y`** +- **Type**: $\textbf{X}$ +- **Description**: The expected y content for after computation. +```json +{ + "D": null, + "I": 0, + "S": 0, + "U": null, + "T": null +} +``` + +# hostGeneralTemplet +## **Element Descriptions** + +### **1. `name`** +- **Type**: String +- **Description**: The name of the template or configuration. +```json +"hostGeneralTemplet" +``` + +--- + +### **2. `initial-gas`** +- **Type**: $\mathbb{N}_G$ +- **Description**: The initial gas amount. +```json +10000 +``` + +--- + +### **3. `initial-regs`** +- **Type**: $\left[\!\left[ \mathbb{N}_R \right]\!\right]_{13}$ +- **Description**: The initial PVM register values. +```json +[ + 4294901760, + 4278059008, + 0, + 0, + 0, + 0, + 0, + 4278124544, + 12, + 0, + 0, + 0, + 0 +] +``` + +--- + +### **4. `initial-memory-permission`** +- **Type**: $\mathbb{M} \mathbf{.A}$ +- **Description**: Memory access permissions. +- **Fields**: + - `start`: $N$ + - `length`: $N$ + - `mode`: $\mathbb{[0,1,2]}$ +```json +[ + { + "Start": 4278124544, + "Length": 12, + "Mode": 2 + } +] +``` + +--- + +### **5. `initial-memory`** +- **Type**: $\mathbb{M} \mathbf{.V}$ +- **Description**: The initial memory content values at specific addresses. +- **Fields**: + - `start`: $N$ + - `contents`: $\mathbb{Y}$ +```json +[ + { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + } +] +``` + +--- + +### **6. `initial-service-account`** +- **Type**: $\mathbb{A}$ +- **Description**: Initial service account +```json +{ + "service_index": 1, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1111, + "min_item_gas": 2222, + "min_memo_gas": 3333, + "code_size": 0, + "s_map": { + "0x0000000000000000000000000000000000000000000000000000000000000000": [0, 1, 2, 3] + }, + "l_map": { + "0x1111111111111111111111111111111111111111111111111111111111111111": [0, 1, 2, 3] + }, + "p_map": { + "0x2222222222222222222222222222222222222222222222222222222222222222": [0, 1, 2, 3] + } +} +``` + +--- + +### **7. `initial-service-index`** +- **Type**: $N$ +- **Description**: Initial service index +```json +0 +``` + +--- + +### **8. `initial-delta`** +- **Type**: $\mathbb{N_s}\to \mathbb{A}$ +- **Description**: Initial delta a map of service index and service. +```json +{ + "0": { + "service_index": 1, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1111, + "min_item_gas": 2222, + "min_memo_gas": 3333, + "code_size": 0, + "s_map": { + "0x0000000000000000000000000000000000000000000000000000000000000000": [0, 1, 2, 3] + }, + "l_map": { + "0x1111111111111111111111111111111111111111111111111111111111111111": [0, 1, 2, 3] + }, + "p_map": { + "0x2222222222222222222222222222222222222222222222222222222222222222": [0, 1, 2, 3] + } + } +} +``` + +--- + +### **9. `expected-gas`** +- **Type**: $\mathbb{N}_G$ +- **Description**: The gas amount after computation. +```json +9990 +``` + +--- + +### **10. `expected-regs`** +- **Type**: $\left[\!\left[ \mathbb{N}_R \right]\!\right]_{13}$ +- **Description**: The PVM register values after computation. +```json +[ + 4294901760, + 4278059008, + 0, + 0, + 0, + 0, + 0, + 4278124544, + 12, + 0, + 0, + 0, + 0 +] +``` + +--- + +### **11. `expected-memory`** +- **Type**: $\mathbb{M} \mathbf{.V}$ +- **Description**: The memory content values after computation. +```json +[ + { + "start": 4278124544, + "contents": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15] + } +] +``` + +--- + +### **12. `expected-service-account`** +- **Type**: $\mathbb{A}$ +- **Description**: Represents the expected state of the service account after computation. +```json +{ + "service_index": 1, + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1111, + "min_item_gas": 2222, + "min_memo_gas": 3333, + "code_size": 0, + "s_map": { + "0x0000000000000000000000000000000000000000000000000000000000000000": [0, 1, 2, 3] + }, + "l_map": { + "0x1111111111111111111111111111111111111111111111111111111111111111": [0, 1, 2, 3] + }, + "p_map": { + "0x2222222222222222222222222222222222222222222222222222222222222222": [0, 1, 2, 3] + } +} +``` \ No newline at end of file diff --git a/host_function/templates/hostAccumulateTemplate.json b/host_function/templates/hostAccumulateTemplate.json new file mode 100644 index 00000000..0fa976b0 --- /dev/null +++ b/host_function/templates/hostAccumulateTemplate.json @@ -0,0 +1,284 @@ +{ + "name": "hostAccumulateTemplet", + "initial-gas": 10000, + "initial-regs": { + "0": 4294901760, + "1": 4278059008, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 4278124544, + "8": 12, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, + "initial-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "initial-xcontent-x": { + "D": {}, + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, 0, 0, 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": [ + 100000 + ] + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [] + }, + "initial-xcontent-y": { + "D": {}, + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, 0, 0, 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": [ + 100000 + ] + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [] + }, + "initial-timeslot": 0, + "expected-gas": 9990, + "expected-regs": { + "0": 4294901760, + "1": 4278059008, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 4278124544, + "8": 12, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [], + "access": { + "inaccessible": false, + "writable": false, + "readable": true + } + } + } + }, + "expected-xcontent-x": { + "D": {}, + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, 0, 0, 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": [ + 100000 + ] + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [] + }, + "expected-xcontent-y": { + "D": {}, + "I": 1, + "S": 0, + "U": { + "D": { + "0": { + "s_map": { + "0x008100e4007a0019e6b29b0a65b9591762ce5143ed30d0261e5d24a320175250": [ + 0, 0, 0, 0 + ] + }, + "l_map": { + "0x000c0000000000003ee347e16fb6594af50ce1cc49996bb7a5e39c7d60d5371e": [ + 100000 + ] + }, + "p_map": { + "0x00fe00ff00ff00ffe802c135a8c671aa22d990fbb26116d9844a458d89d05aa0": [ + 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10 + ] + }, + "code_hash": "0x0be802c135a8c671aa22d990fbb26116d9844a458d89d05aa013272a64160337", + "balance": 1000, + "g": 100, + "m": 100 + } + }, + "I": [], + "Q": [ + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ] + ], + "X": { + "chi_m": 0, + "chi_a": 0, + "chi_v": 0, + "chi_g": {} + } + }, + "T": [] + } +} diff --git a/host_function/templates/hostGeneralTemplate.json b/host_function/templates/hostGeneralTemplate.json new file mode 100644 index 00000000..1bb78828 --- /dev/null +++ b/host_function/templates/hostGeneralTemplate.json @@ -0,0 +1,102 @@ +{ + "name": "hostGeneralTemplet", + "initial-gas": 10000, + "initial-regs": { + "0": 4294901760, + "1": 4278059008, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 4278124544, + "8": 12, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, + "initial-memory": { + "pages": { + "32": { + "value": [ + 11, 232, 2, 193, 53, 168, 198, 113, 170, 34, 217, 144, + 251, 178, 97, 22, 217, 132, 74, 69, 141, 137, 208, 90, + 160, 19, 39, 42, 100, 22, 3, 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "initial-service-index": 0, + "initial-delta": { + "0": { + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1111, + "g": 2222, + "m": 3333, + "s_map": { + "0x0000000000000000000000000000000000000000000000000000000000000000": [0, 1, 2, 3] + }, + "l_map": { + "0x1111111111111111111111111111111111111111111111111111111111111111": [0, 1, 2, 3] + }, + "p_map": { + "0x2222222222222222222222222222222222222222222222222222222222222222": [0, 1, 2, 3] + } + } + }, + "expected-gas": 9990, + "expected-regs": { + "0": 4294901760, + "1": 4278059008, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 4278124544, + "8": 12, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, + "expected-memory": { + "pages": { + "32": { + "value": [ + 11, 232, 2, 193, 53, 168, 198, 113, 170, 34, 217, 144, + 251, 178, 97, 22, 217, 132, 74, 69, 141, 137, 208, 90, + 160, 19, 39, 42, 100, 22, 3, 55 + ], + "access": { + "inaccessible": false, + "writable": true, + "readable": false + } + } + } + }, + "expected-delta": { + "0": { + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "balance": 1111, + "g": 2222, + "m": 3333, + "s_map": { + "0x0000000000000000000000000000000000000000000000000000000000000000": [0, 1, 2, 3] + }, + "l_map": { + "0x1111111111111111111111111111111111111111111111111111111111111111": [0, 1, 2, 3] + }, + "p_map": { + "0x2222222222222222222222222222222222222222222222222222222222222222": [0, 1, 2, 3] + } + } + } +} diff --git a/host_function/templates/hostRefineTemplate.json b/host_function/templates/hostRefineTemplate.json new file mode 100644 index 00000000..9e64d9c6 --- /dev/null +++ b/host_function/templates/hostRefineTemplate.json @@ -0,0 +1,55 @@ +{ + "name": "hostRefineTemplet", + "initial-gas": 10000, + "initial-regs": { + "0": 4294901760, + "1": 4278059008, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 4278124544, + "8": 12, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, +"initial-memory": { + }, + "initial-refine-map": {}, + "initial-export-segment": [ + [] + ], + "initial-import-segment": [ + [] + ], + "initial-export-segment-index": 0, + "initial-service-index": 0, + "initial-delta": { + }, + "expected-gas": 9990, + "expected-regs": { + "0": 4294901760, + "1": 4278059008, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 4278124544, + "8": 12, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, + "expected-memory": { + }, + "expected-refine-map": {}, + "expected-export-segment": [ + [] + ], + "expected-export-segment-index": 0 +}