diff --git a/pvm/README.md b/pvm/README.md new file mode 100644 index 00000000..ea75a72b --- /dev/null +++ b/pvm/README.md @@ -0,0 +1,73 @@ +# PVM Test Vectors, version 0.3 + +## How to use this + +The [`programs`](./programs) directory contains `.json` files, each containing a single test. + +These are meant to test the PVM function Ψ from the Graypaper's Appendix A (equation 203 from v0.2.1 of the paper). + +See [schema.asn](./schema.asn) for a human-readable schema of what each of the fields mean. + +See [schema.json](./schema.json) for a JSON Schema. + +See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases. + +## TODO + + * 100% instruction coverage + * Tests for abnormal skip values for each instruction type + * Tests for when the initial instruction counter (ı) starts somewhere else than 0 + * Tests involving host calls + * Tests for invalid/malformed program blobs + * Add bigger integration-like tests + * More gas metering tests; proper gas cost model (current one is a placeholder) + +## Changelog + +### v0.3 + + * Removed tests which were testing gas behavior that is not yet described in the GP: + - `inst_load_u8_trap.json`, + - `inst_store_u8_trap_inaccessible` + - `inst_store_u8_trap_read_only` + +### v0.2 + + * Bitmask paddings are now filled with zeros, in alignment with the GP. + * Disassemblies now end with an `invalid` instruction to signify places where + the execution traps when going out of bounds. This is a purely cosmetic change + to the reference disassemblies and doesn't affect the test vectors themselves. + * The `inst_rem_signed` test was changed to make the output value non-zero. + (The behavior is unchanged; the instruction still works the same as before.) + * Set the initial value of the output register to a non-zero for the following tests: + (The behavior is unchanged; the instructions still work the same as before.) + - `inst_rem_signed_with_overflow` + - `inst_set_greater_than_signed_imm_0` + - `inst_set_greater_than_unsigned_imm_0`, + - `inst_set_less_than_signed_0` + - `inst_set_less_than_signed_imm_0` + - `inst_set_less_than_unsigned_0`, + - `inst_set_less_than_unsigned_imm_0` + * Add new tests: + - `inst_load_i16` + - `inst_load_i8` + - `inst_load_imm_and_jump` + - `inst_load_indirect_i16_with_offset` + - `inst_load_indirect_i16_without_offset` + - `inst_load_indirect_i8_with_offset` + - `inst_load_indirect_i8_without_offset` + - `inst_load_indirect_u16_with_offset` + - `inst_load_indirect_u16_without_offset` + - `inst_load_indirect_u32_with_offset` + - `inst_load_indirect_u32_without_offset` + - `inst_load_indirect_u8_with_offset` + - `inst_load_indirect_u8_without_offset` + - `inst_load_u16` + - `inst_load_u32` + - `inst_store_imm_u16` + - `inst_store_imm_u32` + - `inst_store_imm_u8` + +### v0.1 + + * Initial test vectors. diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md new file mode 100644 index 00000000..eec4ffc9 --- /dev/null +++ b/pvm/TESTCASES.md @@ -0,0 +1,2663 @@ +# Testcases + +This file contains a human-readable index of all of the testcases, +along with their disassemblies and other relevant information. + + +## gas_basic_consume_all + +``` + : @0 + 0: 52 00 r0 = r0 + 2: invalid +``` + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 2 -> 0 + + +## inst_add + +Initial non-zero registers: + * r7 = 0x1 + * r8 = 0x2 + +``` + : @0 + 0: 08 87 09 r9 = r7 + r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x3 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_add_imm + +Initial non-zero registers: + * r7 = 0x1 + +``` + : @0 + 0: 02 79 02 r9 = r7 + 0x2 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x3 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_add_with_overflow + +Initial non-zero registers: + * r7 = 0xffffffff + * r8 = 0x2 + +``` + : @0 + 0: 08 87 09 r9 = r7 + r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_and + +Initial non-zero registers: + * r7 = 0x5 + * r8 = 0x3 + +``` + : @0 + 0: 17 87 09 r9 = r7 & r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_and_imm + +Initial non-zero registers: + * r7 = 0x5 + +``` + : @0 + 0: 12 79 03 r9 = r7 & 0x3 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_branch_eq_imm_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 07 27 d3 04 06 jump 10 if r7 == 1235 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_eq_imm_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 07 27 d2 04 06 jump 10 if r7 == 1234 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_eq_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d3 04 r8 = 0x4d3 + 8: 18 87 04 jump 12 if r7 == r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + * r8 = 0x4d3 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 11 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_eq_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d2 04 r8 = 0x4d2 + 8: 18 87 04 jump 12 if r7 == r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0x4d2 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 18 + +Gas consumed: 10000 -> 9995 + + +## inst_branch_greater_or_equal_signed_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 2d 17 0a 05 jump 8 if r7 >=s 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_or_equal_signed_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 2d 17 f6 05 jump 8 if r7 >=s 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_signed_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 2b 87 04 jump 10 if r7 >=s r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + * r8 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_signed_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 2b 87 04 jump 10 if r7 >=s r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9995 + + +## inst_branch_greater_or_equal_unsigned_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 34 17 f6 05 jump 8 if r7 >=u 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_or_equal_unsigned_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 34 17 0a 05 jump 8 if r7 >=u 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_unsigned_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 29 87 04 jump 10 if r7 >=u r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + * r8 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_unsigned_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 29 87 04 jump 10 if r7 >=u r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9995 + + +## inst_branch_greater_signed_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 35 17 0a 05 jump 8 if r7 >s 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_signed_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 35 17 f6 05 jump 8 if r7 >s 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_unsigned_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 32 17 f6 05 jump 8 if r7 >u 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_unsigned_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 32 17 0a 05 jump 8 if r7 >u 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_less_or_equal_signed_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 2e 17 f6 05 jump 8 if r7 <=s 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_less_or_equal_signed_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 2e 17 0a 05 jump 8 if r7 <=s 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_less_or_equal_unsigned_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 3b 17 0a 05 jump 8 if r7 <=u 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_less_or_equal_unsigned_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 3b 17 f6 05 jump 8 if r7 <=u 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_less_signed_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 20 17 f5 05 jump 8 if r7 9997 + + +## inst_branch_less_signed_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 20 17 0a 05 jump 8 if r7 9996 + + +## inst_branch_less_signed_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 30 87 04 jump 10 if r7 9996 + + +## inst_branch_less_signed_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 30 87 04 jump 10 if r7 9995 + + +## inst_branch_less_unsigned_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 2c 17 0a 05 jump 8 if r7 9997 + + +## inst_branch_less_unsigned_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 2c 17 f6 05 jump 8 if r7 9996 + + +## inst_branch_less_unsigned_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 2f 87 04 jump 10 if r7 9996 + + +## inst_branch_less_unsigned_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 2f 87 04 jump 10 if r7 9995 + + +## inst_branch_not_eq_imm_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 0f 27 d2 04 06 jump 10 if r7 != 1234 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_not_eq_imm_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 0f 27 d3 04 06 jump 10 if r7 != 1235 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_not_eq_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d2 04 r8 = 0x4d2 + 8: 1e 87 04 jump 12 if r7 != r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + * r8 = 0x4d2 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 11 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_not_eq_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d3 04 r8 = 0x4d3 + 8: 1e 87 04 jump 12 if r7 != r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0x4d3 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 18 + +Gas consumed: 10000 -> 9995 + + +## inst_cmov_if_zero_imm_nok + +Initial non-zero registers: + * r10 = 0x1 + +``` + : @0 + 0: 55 a7 64 r7 = 100 if r10 == 0 + 3: invalid +``` + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_cmov_if_zero_imm_ok + +``` + : @0 + 0: 55 a7 64 r7 = 100 if r10 == 0 + 3: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x64 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_cmov_if_zero_nok + +Initial non-zero registers: + * r8 = 0x64 + * r10 = 0x1 + +``` + : @0 + 0: 53 a8 07 r7 = r8 if r10 == 0 + 3: invalid +``` + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_cmov_if_zero_ok + +Initial non-zero registers: + * r8 = 0x64 + +``` + : @0 + 0: 53 a8 07 r7 = r8 if r10 == 0 + 3: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x64 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_div_signed + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 40 87 09 r9 = r7 /s r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xedb6db70 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_div_signed_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 40 87 09 r9 = r7 /s r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xffffffff (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_div_signed_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + +``` + : @0 + 0: 40 87 09 r9 = r7 /s r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x80000000 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_div_unsigned + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 44 87 09 r9 = r7 /u r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x12492494 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_div_unsigned_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 44 87 09 r9 = r7 /u r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xffffffff (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_div_unsigned_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + * r9 = 0x1234 + +``` + : @0 + 0: 44 87 09 r9 = r7 /u r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0x1234) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_fallthrough + +``` + : @0 + 0: 11 fallthrough + : @1 + 1: invalid +``` + +Program should end with: trap + +Final value of the program counter: 1 + +Gas consumed: 10000 -> 9998 + + +## inst_jump + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 05 03 jump 7 + : @1 + 6: 00 trap + : @2 + 7: 04 07 ef be ad de r7 = 0xdeadbeef + 13: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 13 + +Gas consumed: 10000 -> 9996 + + +## inst_load_i16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20002 (0x2 bytes) = [0x81, 0x82] + +``` + : @0 + 0: 42 07 00 00 02 r7 = i16 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xffff8281 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_load_i8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20001 (0x1 bytes) = [0x81] + +``` + : @0 + 0: 4a 07 00 00 02 r7 = i8 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xffffff81 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_load_imm + +``` + : @0 + 0: 04 07 ef be ad de r7 = 0xdeadbeef + 6: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 6 + +Gas consumed: 10000 -> 9998 + + +## inst_load_imm_and_jump + +``` + : @0 + 0: 06 27 d2 04 06 r7 = 1234, jump 6 + : @1 + 5: 00 trap + : @2 + 6: 04 08 ef be ad de r8 = 0xdeadbeef + 12: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + * r8 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 12 + +Gas consumed: 10000 -> 9997 + + +## inst_load_indirect_i16_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 21 78 01 r8 = i16 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffff8382 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_i16_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 21 78 r8 = i16 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffff8281 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_i8_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 15 78 01 r8 = i8 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffffff82 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_i8_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 15 78 r8 = i8 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffffff81 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u16_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 25 78 01 r8 = u16 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x5634 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u16_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 25 78 r8 = u16 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x3412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u32_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20005 (0x5 bytes) = [0x12, 0x34, 0x56, 0x78, 0x9a] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 01 78 01 r8 = u32 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x9a785634 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u32_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 01 78 r8 = u32 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x78563412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u8_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 0b 78 01 r8 = u8 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x34 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u8_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 0b 78 r8 = u8 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x12 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_u16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +``` + : @0 + 0: 4c 07 00 00 02 r7 = u16 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x3412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_load_u32 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +``` + : @0 + 0: 0a 07 00 00 02 r7 = u32 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x78563412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_load_u8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +``` + : @0 + 0: 3c 07 00 00 02 r7 = u8 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x12 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_move_reg + +Initial non-zero registers: + * r7 = 0x1 + +``` + : @0 + 0: 52 79 r9 = r7 + 2: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_mul + +Initial non-zero registers: + * r7 = 0x3 + * r8 = 0x7 + +``` + : @0 + 0: 22 87 09 r9 = r7 * r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x15 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_mul_imm + +Initial non-zero registers: + * r7 = 0x3 + +``` + : @0 + 0: 23 79 07 r9 = r7 * 7 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x15 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_negate_and_add_imm + +Initial non-zero registers: + * r8 = 0x2 + +``` + : @0 + 0: 28 89 01 r9 = -r8 + 1 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xffffffff (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_or + +Initial non-zero registers: + * r7 = 0x5 + * r8 = 0x3 + +``` + : @0 + 0: 0c 87 09 r9 = r7 | r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x7 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_or_imm + +Initial non-zero registers: + * r7 = 0x5 + +``` + : @0 + 0: 31 79 03 r9 = r7 | 0x3 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x7 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_rem_signed + +Initial non-zero registers: + * r7 = 0x80000011 + * r8 = 0x7 + +``` + : @0 + 0: 46 87 09 r9 = r7 %s r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xfffffffa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_rem_signed_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 46 87 09 r9 = r7 %s r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x80000010 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_rem_signed_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + * r9 = 0xdeadbeef + +``` + : @0 + 0: 46 87 09 r9 = r7 %s r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_rem_unsigned + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 49 87 09 r9 = r7 %u r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x4 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_rem_unsigned_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 49 87 09 r9 = r7 %u r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x80000010 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_rem_unsigned_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + +``` + : @0 + 0: 49 87 09 r9 = r7 %u r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x80000000 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_ret_halt + +Initial non-zero registers: + * r0 = 0xffff0000 + +``` + : @0 + 0: 13 00 jump [r0 + 0] +``` + +Program should end with: halt + +Final value of the program counter: 0 + +Gas consumed: 10000 -> 9999 + + +## inst_ret_invalid + +``` + : @0 + 0: 13 00 jump [r0 + 0] +``` + +Program should end with: trap + +Final value of the program counter: 0 + +Gas consumed: 10000 -> 9999 + + +## inst_set_greater_than_signed_imm_0 + +Initial non-zero registers: + * r7 = 0xfffffff6 + * r9 = 0xdeadbeef + +``` + : @0 + 0: 3d 79 0a r9 = r7 >s 10 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_set_greater_than_signed_imm_1 + +Initial non-zero registers: + * r7 = 0xa + +``` + : @0 + 0: 3d 79 f6 r9 = r7 >s -10 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_set_greater_than_unsigned_imm_0 + +Initial non-zero registers: + * r7 = 0xa + * r9 = 0xdeadbeef + +``` + : @0 + 0: 27 79 f6 r9 = r7 >u 0xfffffff6 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_set_greater_than_unsigned_imm_1 + +Initial non-zero registers: + * r7 = 0xfffffff6 + +``` + : @0 + 0: 27 79 0a r9 = r7 >u 0xa + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_set_less_than_signed_0 + +Initial non-zero registers: + * r7 = 0xa + * r8 = 0xfffffff6 + * r9 = 0xdeadbeef + +``` + : @0 + 0: 3a 87 09 r9 = r7 9998 + + +## inst_set_less_than_signed_1 + +Initial non-zero registers: + * r7 = 0xfffffff6 + * r8 = 0xa + +``` + : @0 + 0: 3a 87 09 r9 = r7 9998 + + +## inst_set_less_than_signed_imm_0 + +Initial non-zero registers: + * r7 = 0xa + * r9 = 0xdeadbeef + +``` + : @0 + 0: 38 79 f6 r9 = r7 9998 + + +## inst_set_less_than_signed_imm_1 + +Initial non-zero registers: + * r7 = 0xfffffff6 + +``` + : @0 + 0: 38 79 0a r9 = r7 9998 + + +## inst_set_less_than_unsigned_0 + +Initial non-zero registers: + * r7 = 0xfffffff6 + * r8 = 0xa + * r9 = 0xdeadbeef + +``` + : @0 + 0: 24 87 09 r9 = r7 9998 + + +## inst_set_less_than_unsigned_1 + +Initial non-zero registers: + * r7 = 0xa + * r8 = 0xfffffff6 + +``` + : @0 + 0: 24 87 09 r9 = r7 9998 + + +## inst_set_less_than_unsigned_imm_0 + +Initial non-zero registers: + * r7 = 0xfffffff6 + * r9 = 0xdeadbeef + +``` + : @0 + 0: 1b 79 0a r9 = r7 9998 + + +## inst_set_less_than_unsigned_imm_1 + +Initial non-zero registers: + * r7 = 0xa + +``` + : @0 + 0: 1b 79 f6 r9 = r7 9998 + + +## inst_shift_arithmetic_right + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x3 + +``` + : @0 + 0: 4d 87 09 r9 = r7 >>a r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xf000000e (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_arithmetic_right_imm + +Initial non-zero registers: + * r7 = 0x80000075 + +``` + : @0 + 0: 19 79 03 r9 = r7 >>a 3 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xf000000e (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_arithmetic_right_imm_alt + +Initial non-zero registers: + * r8 = 0x3 + +``` + : @0 + 0: 50 89 75 00 00 80 r9 = 2147483765 >>a r8 + 6: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xf000000e (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 6 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_arithmetic_right_with_overflow + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x21 + +``` + : @0 + 0: 4d 87 09 r9 = r7 >>a r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xc000003a (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_left + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x3 + +``` + : @0 + 0: 37 87 09 r9 = r7 << r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x3a8 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_left_imm + +Initial non-zero registers: + * r7 = 0x80000075 + +``` + : @0 + 0: 09 79 03 r9 = r7 << 3 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x3a8 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_left_imm_alt + +Initial non-zero registers: + * r8 = 0x3 + +``` + : @0 + 0: 4b 89 75 00 00 80 r9 = 2147483765 << r8 + 6: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x3a8 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 6 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_left_with_overflow + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x21 + +``` + : @0 + 0: 37 87 09 r9 = r7 << r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xea (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_right + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x3 + +``` + : @0 + 0: 33 87 09 r9 = r7 >> r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1000000e (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_right_imm + +Initial non-zero registers: + * r7 = 0x80000075 + +``` + : @0 + 0: 0e 79 03 r9 = r7 >> 3 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1000000e (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_right_imm_alt + +Initial non-zero registers: + * r8 = 0x3 + +``` + : @0 + 0: 48 89 75 00 00 80 r9 = 2147483765 >> r8 + 6: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1000000e (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 6 + +Gas consumed: 10000 -> 9998 + + +## inst_shift_logical_right_with_overflow + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x21 + +``` + : @0 + 0: 33 87 09 r9 = r7 >> r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x4000003a (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_store_imm_u16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +``` + : @0 + 0: 4f 03 00 00 02 34 12 u16 [0x20000] = 4660 + 7: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20002 (0x2 bytes) = [0x34, 0x12] + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9998 + + +## inst_store_imm_u32 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +``` + : @0 + 0: 26 03 00 00 02 78 56 34 12 u32 [0x20000] = 305419896 + 9: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x78, 0x56, 0x34, 0x12] + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9998 + + +## inst_store_imm_u8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +``` + : @0 + 0: 3e 03 00 00 02 12 u8 [0x20000] = 18 + 6: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20001 (0x1 bytes) = [0x12] + +Program should end with: trap + +Final value of the program counter: 6 + +Gas consumed: 10000 -> 9998 + + +## inst_store_u16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 45 07 00 00 02 u16 [0x20000] = r7 + 5: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20002 (0x2 bytes) = [0x78, 0x56] + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_store_u32 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 16 07 00 00 02 u32 [0x20000] = r7 + 5: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x78, 0x56, 0x34, 0x12] + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_store_u8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 47 07 00 00 02 u8 [0x20000] = r7 + 5: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20001 (0x1 bytes) = [0x78] + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_sub + +Initial non-zero registers: + * r7 = 0x2 + * r8 = 0x1 + +``` + : @0 + 0: 14 87 09 r9 = r7 - r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_sub_imm + +Initial non-zero registers: + * r7 = 0x2 + +``` + : @0 + 0: 02 79 ff r9 = r7 + 0xffffffff + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_sub_with_overflow + +Initial non-zero registers: + * r7 = 0x2 + * r8 = 0x4 + +``` + : @0 + 0: 14 87 09 r9 = r7 - r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0xfffffffe (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_trap + +``` + : @0 + 0: 00 trap +``` + +Program should end with: trap + +Final value of the program counter: 0 + +Gas consumed: 10000 -> 9999 + + +## inst_xor + +Initial non-zero registers: + * r7 = 0x5 + * r8 = 0x3 + +``` + : @0 + 0: 1c 87 09 r9 = r7 ^ r8 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_xor_imm + +Initial non-zero registers: + * r7 = 0x5 + +``` + : @0 + 0: 1f 79 03 r9 = r7 ^ 0x3 + 3: invalid +``` + +Registers after execution (only changed registers): + * r9 = 0x6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + diff --git a/pvm/programs/gas_basic_consume_all.json b/pvm/programs/gas_basic_consume_all.json new file mode 100644 index 00000000..089c4451 --- /dev/null +++ b/pvm/programs/gas_basic_consume_all.json @@ -0,0 +1,49 @@ +{ + "name": "gas_basic_consume_all", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 2, + "program": [ + 0, + 0, + 2, + 82, + 0, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [], + "expected-gas": 0 +} \ No newline at end of file diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json new file mode 100644 index 00000000..de0c6aec --- /dev/null +++ b/pvm/programs/inst_add.json @@ -0,0 +1,50 @@ +{ + "name": "inst_add", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 8, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 3, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json new file mode 100644 index 00000000..5130cc69 --- /dev/null +++ b/pvm/programs/inst_add_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_add_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 2, + 121, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 3, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json new file mode 100644 index 00000000..ad49df5a --- /dev/null +++ b/pvm/programs/inst_add_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_add_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967295, + 2, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 8, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967295, + 2, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json new file mode 100644 index 00000000..528f6c05 --- /dev/null +++ b/pvm/programs/inst_and.json @@ -0,0 +1,50 @@ +{ + "name": "inst_and", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 23, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json new file mode 100644 index 00000000..1ffa19c6 --- /dev/null +++ b/pvm/programs/inst_and_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_and_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 18, + 121, + 3, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_imm_nok.json b/pvm/programs/inst_branch_eq_imm_nok.json new file mode 100644 index 00000000..f8e2a039 --- /dev/null +++ b/pvm/programs/inst_branch_eq_imm_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_eq_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 7, + 39, + 211, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_imm_ok.json b/pvm/programs/inst_branch_eq_imm_ok.json new file mode 100644 index 00000000..4280053c --- /dev/null +++ b/pvm/programs/inst_branch_eq_imm_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_eq_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 7, + 39, + 210, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json new file mode 100644 index 00000000..256a391c --- /dev/null +++ b/pvm/programs/inst_branch_eq_nok.json @@ -0,0 +1,67 @@ +{ + "name": "inst_branch_eq_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 211, + 4, + 24, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 1235, + 0, + 0, + 0, + 0 + ], + "expected-pc": 11, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json new file mode 100644 index 00000000..4603ee67 --- /dev/null +++ b/pvm/programs/inst_branch_eq_ok.json @@ -0,0 +1,67 @@ +{ + "name": "inst_branch_eq_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 210, + 4, + 24, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 1234, + 0, + 0, + 0, + 0 + ], + "expected-pc": 18, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json b/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json new file mode 100644 index 00000000..aabcee9d --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 45, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json b/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json new file mode 100644 index 00000000..51c3f39d --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 45, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_nok.json b/pvm/programs/inst_branch_greater_or_equal_signed_nok.json new file mode 100644 index 00000000..94a1d2e0 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_signed_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 43, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_ok.json b/pvm/programs/inst_branch_greater_or_equal_signed_ok.json new file mode 100644 index 00000000..68535558 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_signed_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 43, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json new file mode 100644 index 00000000..31ba1f82 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 52, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json new file mode 100644 index 00000000..83aefffc --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 52, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json new file mode 100644 index 00000000..1b89dd5c --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 41, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json new file mode 100644 index 00000000..464659ea --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 41, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_signed_imm_nok.json b/pvm/programs/inst_branch_greater_signed_imm_nok.json new file mode 100644 index 00000000..b37e5d82 --- /dev/null +++ b/pvm/programs/inst_branch_greater_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 53, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_signed_imm_ok.json b/pvm/programs/inst_branch_greater_signed_imm_ok.json new file mode 100644 index 00000000..177ac53c --- /dev/null +++ b/pvm/programs/inst_branch_greater_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 53, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_unsigned_imm_nok.json b/pvm/programs/inst_branch_greater_unsigned_imm_nok.json new file mode 100644 index 00000000..3b97b7c7 --- /dev/null +++ b/pvm/programs/inst_branch_greater_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 50, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_unsigned_imm_ok.json b/pvm/programs/inst_branch_greater_unsigned_imm_ok.json new file mode 100644 index 00000000..c551282c --- /dev/null +++ b/pvm/programs/inst_branch_greater_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 50, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json b/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json new file mode 100644 index 00000000..b559e8f8 --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 46, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json b/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json new file mode 100644 index 00000000..3b26274f --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 46, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json new file mode 100644 index 00000000..dee2f03e --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 59, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json new file mode 100644 index 00000000..34f5753e --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 59, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_imm_nok.json b/pvm/programs/inst_branch_less_signed_imm_nok.json new file mode 100644 index 00000000..909dfc0c --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 32, + 23, + 245, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_imm_ok.json b/pvm/programs/inst_branch_less_signed_imm_ok.json new file mode 100644 index 00000000..83dd9057 --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 32, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_nok.json b/pvm/programs/inst_branch_less_signed_nok.json new file mode 100644 index 00000000..521157e6 --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_signed_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 48, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_ok.json b/pvm/programs/inst_branch_less_signed_ok.json new file mode 100644 index 00000000..f269b23e --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_signed_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 48, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_imm_nok.json b/pvm/programs/inst_branch_less_unsigned_imm_nok.json new file mode 100644 index 00000000..5dcb8914 --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 44, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_imm_ok.json b/pvm/programs/inst_branch_less_unsigned_imm_ok.json new file mode 100644 index 00000000..39f56fca --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 44, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_nok.json b/pvm/programs/inst_branch_less_unsigned_nok.json new file mode 100644 index 00000000..d13b952a --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_unsigned_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 47, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_ok.json b/pvm/programs/inst_branch_less_unsigned_ok.json new file mode 100644 index 00000000..6b0788cf --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_unsigned_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 47, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_imm_nok.json b/pvm/programs/inst_branch_not_eq_imm_nok.json new file mode 100644 index 00000000..428470c2 --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_imm_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_not_eq_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 15, + 39, + 210, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_imm_ok.json b/pvm/programs/inst_branch_not_eq_imm_ok.json new file mode 100644 index 00000000..aacd14fb --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_imm_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_not_eq_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 15, + 39, + 211, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json new file mode 100644 index 00000000..7674b1d5 --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -0,0 +1,67 @@ +{ + "name": "inst_branch_not_eq_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 210, + 4, + 30, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 1234, + 0, + 0, + 0, + 0 + ], + "expected-pc": 11, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json new file mode 100644 index 00000000..f8f94645 --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -0,0 +1,67 @@ +{ + "name": "inst_branch_not_eq_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 211, + 4, + 30, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 1235, + 0, + 0, + 0, + 0 + ], + "expected-pc": 18, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json new file mode 100644 index 00000000..639e0596 --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -0,0 +1,50 @@ +{ + "name": "inst_cmov_if_zero_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 85, + 167, + 100, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json new file mode 100644 index 00000000..40d2e778 --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -0,0 +1,50 @@ +{ + "name": "inst_cmov_if_zero_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 85, + 167, + 100, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json new file mode 100644 index 00000000..33d0b828 --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -0,0 +1,50 @@ +{ + "name": "inst_cmov_if_zero_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 1, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 83, + 168, + 7, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 1, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json new file mode 100644 index 00000000..1fab7cac --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -0,0 +1,50 @@ +{ + "name": "inst_cmov_if_zero_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 83, + 168, + 7, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 100, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json new file mode 100644 index 00000000..b397e4dd --- /dev/null +++ b/pvm/programs/inst_div_signed.json @@ -0,0 +1,50 @@ +{ + "name": "inst_div_signed", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 64, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 3988183920, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json new file mode 100644 index 00000000..899a4c26 --- /dev/null +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -0,0 +1,50 @@ +{ + "name": "inst_div_signed_by_zero", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 64, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 4294967295, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json new file mode 100644 index 00000000..e2fb72f4 --- /dev/null +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_div_signed_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 64, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 2147483648, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json new file mode 100644 index 00000000..5b8e8206 --- /dev/null +++ b/pvm/programs/inst_div_unsigned.json @@ -0,0 +1,50 @@ +{ + "name": "inst_div_unsigned", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 68, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 306783380, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json new file mode 100644 index 00000000..280ba35e --- /dev/null +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -0,0 +1,50 @@ +{ + "name": "inst_div_unsigned_by_zero", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 68, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 4294967295, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json new file mode 100644 index 00000000..5e86d5ef --- /dev/null +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_div_unsigned_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 4660, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 68, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json new file mode 100644 index 00000000..344a443d --- /dev/null +++ b/pvm/programs/inst_fallthrough.json @@ -0,0 +1,48 @@ +{ + "name": "inst_fallthrough", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 1, + 17, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 1, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json new file mode 100644 index 00000000..35c91853 --- /dev/null +++ b/pvm/programs/inst_jump.json @@ -0,0 +1,61 @@ +{ + "name": "inst_jump", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 13, + 4, + 7, + 210, + 4, + 5, + 3, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 209, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 13, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_i16.json b/pvm/programs/inst_load_i16.json new file mode 100644 index 00000000..51309dc0 --- /dev/null +++ b/pvm/programs/inst_load_i16.json @@ -0,0 +1,74 @@ +{ + "name": "inst_load_i16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 66, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294935169, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_i8.json b/pvm/programs/inst_load_i8.json new file mode 100644 index 00000000..ed89e35c --- /dev/null +++ b/pvm/programs/inst_load_i8.json @@ -0,0 +1,72 @@ +{ + "name": "inst_load_i8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 74, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967169, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json new file mode 100644 index 00000000..74a61539 --- /dev/null +++ b/pvm/programs/inst_load_imm.json @@ -0,0 +1,53 @@ +{ + "name": "inst_load_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 6, + 4, + 7, + 239, + 190, + 173, + 222, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 6, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_imm_and_jump.json b/pvm/programs/inst_load_imm_and_jump.json new file mode 100644 index 00000000..9bf6cb01 --- /dev/null +++ b/pvm/programs/inst_load_imm_and_jump.json @@ -0,0 +1,60 @@ +{ + "name": "inst_load_imm_and_jump", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 12, + 6, + 39, + 210, + 4, + 6, + 0, + 4, + 8, + 239, + 190, + 173, + 222, + 97, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 3735928559, + 0, + 0, + 0, + 0 + ], + "expected-pc": 12, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i16_with_offset.json b/pvm/programs/inst_load_indirect_i16_with_offset.json new file mode 100644 index 00000000..2b8997ed --- /dev/null +++ b/pvm/programs/inst_load_indirect_i16_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_i16_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 33, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294935426, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i16_without_offset.json b/pvm/programs/inst_load_indirect_i16_without_offset.json new file mode 100644 index 00000000..176c99eb --- /dev/null +++ b/pvm/programs/inst_load_indirect_i16_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_i16_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 33, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294935169, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i8_with_offset.json b/pvm/programs/inst_load_indirect_i8_with_offset.json new file mode 100644 index 00000000..2b730c21 --- /dev/null +++ b/pvm/programs/inst_load_indirect_i8_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_i8_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 21, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294967170, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i8_without_offset.json b/pvm/programs/inst_load_indirect_i8_without_offset.json new file mode 100644 index 00000000..de51b94d --- /dev/null +++ b/pvm/programs/inst_load_indirect_i8_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_i8_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 21, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294967169, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u16_with_offset.json b/pvm/programs/inst_load_indirect_u16_with_offset.json new file mode 100644 index 00000000..ac74af17 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u16_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_u16_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 37, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 22068, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u16_without_offset.json b/pvm/programs/inst_load_indirect_u16_without_offset.json new file mode 100644 index 00000000..f65347f9 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u16_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_u16_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 37, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 13330, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u32_with_offset.json b/pvm/programs/inst_load_indirect_u32_with_offset.json new file mode 100644 index 00000000..c145cbfa --- /dev/null +++ b/pvm/programs/inst_load_indirect_u32_with_offset.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_indirect_u32_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120, + 154 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 1, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 2591577652, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120, + 154 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u32_without_offset.json b/pvm/programs/inst_load_indirect_u32_without_offset.json new file mode 100644 index 00000000..dbaae377 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u32_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_u32_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 1, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 2018915346, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u8_with_offset.json b/pvm/programs/inst_load_indirect_u8_with_offset.json new file mode 100644 index 00000000..8c6ac791 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u8_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_u8_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 11, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 52, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u8_without_offset.json b/pvm/programs/inst_load_indirect_u8_without_offset.json new file mode 100644 index 00000000..19b1320e --- /dev/null +++ b/pvm/programs/inst_load_indirect_u8_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_u8_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 11, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 18, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_u16.json b/pvm/programs/inst_load_u16.json new file mode 100644 index 00000000..b23b07de --- /dev/null +++ b/pvm/programs/inst_load_u16.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_u16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 76, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 13330, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_u32.json b/pvm/programs/inst_load_u32.json new file mode 100644 index 00000000..fdc97b85 --- /dev/null +++ b/pvm/programs/inst_load_u32.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_u32", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 10, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2018915346, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_u8.json b/pvm/programs/inst_load_u8.json new file mode 100644 index 00000000..e349c690 --- /dev/null +++ b/pvm/programs/inst_load_u8.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_u8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 60, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 18, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json new file mode 100644 index 00000000..b51838d5 --- /dev/null +++ b/pvm/programs/inst_move_reg.json @@ -0,0 +1,49 @@ +{ + "name": "inst_move_reg", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 82, + 121, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json new file mode 100644 index 00000000..4d436e05 --- /dev/null +++ b/pvm/programs/inst_mul.json @@ -0,0 +1,50 @@ +{ + "name": "inst_mul", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 7, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 34, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 7, + 21, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json new file mode 100644 index 00000000..2beed588 --- /dev/null +++ b/pvm/programs/inst_mul_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_mul_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 35, + 121, + 7, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 21, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json new file mode 100644 index 00000000..c2e8ab81 --- /dev/null +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_negate_and_add_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 40, + 137, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 4294967295, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json new file mode 100644 index 00000000..4ad30560 --- /dev/null +++ b/pvm/programs/inst_or.json @@ -0,0 +1,50 @@ +{ + "name": "inst_or", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 12, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 7, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json new file mode 100644 index 00000000..418ed4a5 --- /dev/null +++ b/pvm/programs/inst_or_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_or_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 49, + 121, + 3, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 7, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json new file mode 100644 index 00000000..50b2be59 --- /dev/null +++ b/pvm/programs/inst_rem_signed.json @@ -0,0 +1,50 @@ +{ + "name": "inst_rem_signed", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483665, + 7, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 70, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483665, + 7, + 4294967290, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json new file mode 100644 index 00000000..a144fb1a --- /dev/null +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -0,0 +1,50 @@ +{ + "name": "inst_rem_signed_by_zero", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 70, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 2147483664, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json new file mode 100644 index 00000000..9d8a299a --- /dev/null +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_rem_signed_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 70, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json new file mode 100644 index 00000000..b566240d --- /dev/null +++ b/pvm/programs/inst_rem_unsigned.json @@ -0,0 +1,50 @@ +{ + "name": "inst_rem_unsigned", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 73, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 4, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json new file mode 100644 index 00000000..b62dae18 --- /dev/null +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -0,0 +1,50 @@ +{ + "name": "inst_rem_unsigned_by_zero", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 73, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 2147483664, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json new file mode 100644 index 00000000..52dd0e3d --- /dev/null +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_rem_unsigned_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 73, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 2147483648, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json new file mode 100644 index 00000000..f6758e59 --- /dev/null +++ b/pvm/programs/inst_ret_halt.json @@ -0,0 +1,49 @@ +{ + "name": "inst_ret_halt", + "initial-regs": [ + 4294901760, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 19, + 0, + 1 + ], + "expected-status": "halt", + "expected-regs": [ + 4294901760, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 0, + "expected-memory": [], + "expected-gas": 9999 +} \ No newline at end of file diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json new file mode 100644 index 00000000..ab3dcd1d --- /dev/null +++ b/pvm/programs/inst_ret_invalid.json @@ -0,0 +1,49 @@ +{ + "name": "inst_ret_invalid", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 19, + 0, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 0, + "expected-memory": [], + "expected-gas": 9999 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json new file mode 100644 index 00000000..e4b6ac64 --- /dev/null +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_greater_than_signed_imm_0", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 61, + 121, + 10, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json new file mode 100644 index 00000000..19666e93 --- /dev/null +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_greater_than_signed_imm_1", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 61, + 121, + 246, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json new file mode 100644 index 00000000..d8ca37c0 --- /dev/null +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_greater_than_unsigned_imm_0", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 39, + 121, + 246, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json new file mode 100644 index 00000000..4e332bcb --- /dev/null +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_greater_than_unsigned_imm_1", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 39, + 121, + 10, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json new file mode 100644 index 00000000..d8eccb64 --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_signed_0", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 58, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json new file mode 100644 index 00000000..78645015 --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_signed_1", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 58, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json new file mode 100644 index 00000000..4b98b94f --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_signed_imm_0", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 56, + 121, + 246, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json new file mode 100644 index 00000000..60bf550c --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_signed_imm_1", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 56, + 121, + 10, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json new file mode 100644 index 00000000..98ce7ab7 --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_unsigned_0", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 36, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json new file mode 100644 index 00000000..7ee0dbd2 --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_unsigned_1", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 36, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json new file mode 100644 index 00000000..e7b8bd65 --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_unsigned_imm_0", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 3735928559, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 27, + 121, + 10, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json new file mode 100644 index 00000000..f0866c00 --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -0,0 +1,50 @@ +{ + "name": "inst_set_less_than_unsigned_imm_1", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 27, + 121, + 246, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json new file mode 100644 index 00000000..36f4fa5e --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_arithmetic_right", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 77, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 4026531854, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json new file mode 100644 index 00000000..8cd7a3f5 --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_arithmetic_right_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 25, + 121, + 3, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 4026531854, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json new file mode 100644 index 00000000..a0e73391 --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -0,0 +1,53 @@ +{ + "name": "inst_shift_arithmetic_right_imm_alt", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 6, + 80, + 137, + 117, + 0, + 0, + 128, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 4026531854, + 0, + 0, + 0 + ], + "expected-pc": 6, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json new file mode 100644 index 00000000..7e3048bd --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_arithmetic_right_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 77, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 3221225530, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json new file mode 100644 index 00000000..f4768a16 --- /dev/null +++ b/pvm/programs/inst_shift_logical_left.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_logical_left", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 55, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 936, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json new file mode 100644 index 00000000..a81c10b9 --- /dev/null +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_logical_left_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 9, + 121, + 3, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 936, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json new file mode 100644 index 00000000..a940f507 --- /dev/null +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -0,0 +1,53 @@ +{ + "name": "inst_shift_logical_left_imm_alt", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 6, + 75, + 137, + 117, + 0, + 0, + 128, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 936, + 0, + 0, + 0 + ], + "expected-pc": 6, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json new file mode 100644 index 00000000..0b656a0f --- /dev/null +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_logical_left_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 55, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 234, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json new file mode 100644 index 00000000..a06a6ee9 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_logical_right", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 51, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 268435470, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json new file mode 100644 index 00000000..23049e37 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_logical_right_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 14, + 121, + 3, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 268435470, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json new file mode 100644 index 00000000..e225e544 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -0,0 +1,53 @@ +{ + "name": "inst_shift_logical_right_imm_alt", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 6, + 72, + 137, + 117, + 0, + 0, + 128, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 268435470, + 0, + 0, + 0 + ], + "expected-pc": 6, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json new file mode 100644 index 00000000..b1282b05 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_shift_logical_right_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 51, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 1073741882, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_imm_u16.json b/pvm/programs/inst_store_imm_u16.json new file mode 100644 index 00000000..578f6384 --- /dev/null +++ b/pvm/programs/inst_store_imm_u16.json @@ -0,0 +1,68 @@ +{ + "name": "inst_store_imm_u16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 7, + 79, + 3, + 0, + 0, + 2, + 52, + 18, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 52, + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_imm_u32.json b/pvm/programs/inst_store_imm_u32.json new file mode 100644 index 00000000..45cb1c38 --- /dev/null +++ b/pvm/programs/inst_store_imm_u32.json @@ -0,0 +1,73 @@ +{ + "name": "inst_store_imm_u32", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 9, + 38, + 3, + 0, + 0, + 2, + 120, + 86, + 52, + 18, + 1, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120, + 86, + 52, + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_imm_u8.json b/pvm/programs/inst_store_imm_u8.json new file mode 100644 index 00000000..4ffc6286 --- /dev/null +++ b/pvm/programs/inst_store_imm_u8.json @@ -0,0 +1,66 @@ +{ + "name": "inst_store_imm_u8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 6, + 62, + 3, + 0, + 0, + 2, + 18, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 6, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u16.json b/pvm/programs/inst_store_u16.json new file mode 100644 index 00000000..4280fdc7 --- /dev/null +++ b/pvm/programs/inst_store_u16.json @@ -0,0 +1,66 @@ +{ + "name": "inst_store_u16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 69, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120, + 86 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u32.json b/pvm/programs/inst_store_u32.json new file mode 100644 index 00000000..426208b1 --- /dev/null +++ b/pvm/programs/inst_store_u32.json @@ -0,0 +1,68 @@ +{ + "name": "inst_store_u32", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 22, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120, + 86, + 52, + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u8.json b/pvm/programs/inst_store_u8.json new file mode 100644 index 00000000..55f7f54b --- /dev/null +++ b/pvm/programs/inst_store_u8.json @@ -0,0 +1,65 @@ +{ + "name": "inst_store_u8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 71, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json new file mode 100644 index 00000000..d36a8d47 --- /dev/null +++ b/pvm/programs/inst_sub.json @@ -0,0 +1,50 @@ +{ + "name": "inst_sub", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 20, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 1, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json new file mode 100644 index 00000000..70a083bc --- /dev/null +++ b/pvm/programs/inst_sub_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_sub_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 2, + 121, + 255, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 1, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json new file mode 100644 index 00000000..cee8c9e8 --- /dev/null +++ b/pvm/programs/inst_sub_with_overflow.json @@ -0,0 +1,50 @@ +{ + "name": "inst_sub_with_overflow", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 4, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 20, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 4, + 4294967294, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json new file mode 100644 index 00000000..e0596acd --- /dev/null +++ b/pvm/programs/inst_trap.json @@ -0,0 +1,48 @@ +{ + "name": "inst_trap", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 1, + 0, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 0, + "expected-memory": [], + "expected-gas": 9999 +} \ No newline at end of file diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json new file mode 100644 index 00000000..849a20d0 --- /dev/null +++ b/pvm/programs/inst_xor.json @@ -0,0 +1,50 @@ +{ + "name": "inst_xor", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 28, + 135, + 9, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 6, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json new file mode 100644 index 00000000..10518ca6 --- /dev/null +++ b/pvm/programs/inst_xor_imm.json @@ -0,0 +1,50 @@ +{ + "name": "inst_xor_imm", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 31, + 121, + 3, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 6, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/schema.asn b/pvm/schema.asn new file mode 100644 index 00000000..89772873 --- /dev/null +++ b/pvm/schema.asn @@ -0,0 +1,78 @@ +PVMTestSuite DEFINITIONS ::= BEGIN + +-- a 64-bit signed integer +I64 ::= INTEGER(-9223372036854775808..9223372036854775807) + +-- a 32-bit unsigned integer +U32 ::= INTEGER(0..4294967295) + +-- an 8-bit unsigned integer (a byte) +U8 ::= INTEGER(0..255) + +-- a blob of bytes at a given memory address +MemoryChunk ::= SEQUENCE OF SEQUENCE { + address U32, + contents SEQUENCE OF U8 +} + +Testcase ::= SEQUENCE { + -- a unique identifier for the test + name UTF8String, + + -- (the "ω" from the paper) + -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed + initial-regs SEQUENCE (SIZE(13..13)) OF U32, + + -- (the "ı" from the paper) + -- the initial program counter from which to start the execution + initial-pc U32, + + -- (part of the "µ" from the paper) + -- lists regions of memory which should be accessible, initialized with zeros by default; any address not on this list should be inaccessible + initial-page-map SEQUENCE OF SEQUENCE { + address U32, + length U32, + is-writable BOOLEAN + }, + + -- (part of the "µ" from the paper) + -- lists all non-zero values to put in memory before execution + initial-memory MemoryChunk, + + -- (the "ξ" from the paper) + -- the initial amount of gas + initial-gas I64, + + -- (the bold "p" from the paper) + -- the program blob to be executed as part of the test + program SEQUENCE OF U8, + + -- (the "ζ" from the paper) + -- the status code of the execution, i.e. the way the program is supposed to end + expected-status ENUMERATED { + -- (called "panic" in the Graypaper) + -- the execution ended with a trap (the `trap` instruction was executed, the execution went "out of bounds", an invalid jump was made, or an invalid instruction was executed) + trap, + + -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made) + halt + }, + + -- (the "ω′" from the paper) + -- the expected values of each of the 13 registers *after* the test program is executed + expected-regs SEQUENCE (SIZE(13..13)) OF U32, + + -- (the "ı′" from the paper) + -- the final value of the program counter, after the execution finishes + expected-pc U32, + + -- (part of the "µ′" from the paper) + -- lists all non-zero values after the execution finishes; all accessible addresses not on this list must be filled with zeroes + expected-memory MemoryChunk, + + -- (the "ξ′" from the paper) + -- the final amount of gas remaining after the execution finishes + expected-gas I64 +} + +END diff --git a/pvm/schema.json b/pvm/schema.json new file mode 100644 index 00000000..09cde355 --- /dev/null +++ b/pvm/schema.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "initial-regs": { + "type": "array", + "items": { "$ref": "#/$defs/u32" }, + "minItems": 13, + "maxItems": 13 + }, + "initial-pc": { "$ref": "#/$defs/u32" }, + "initial-page-map": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { "$ref": "#/$defs/u32" }, + "length": { "$ref": "#/$defs/u32" }, + "is-writable": { "type": "boolean" } + }, + "required": ["address", "length", "is-writable"], + "additionalProperties": false + } + }, + "initial-memory": { + "$ref": "#/$defs/memory-chunk" + }, + "initial-gas": { + "$ref": "#/$defs/i64" + }, + "program": { + "type": "array", + "items": { "$ref": "#/$defs/u8" } + }, + "expected-status": { + "type": "string", + "enum": ["trap", "halt"] + }, + "expected-regs": { + "type": "array", + "items": { "$ref": "#/$defs/u32" }, + "minItems": 13, + "maxItems": 13 + }, + "expected-pc": { "$ref": "#/$defs/u32" }, + "expected-memory": { + "$ref": "#/$defs/memory-chunk" + }, + "expected-gas": { + "$ref": "#/$defs/i64" + } + }, + "required": ["name", "initial-regs", "initial-pc", "initial-page-map", "initial-memory", "initial-gas", "program", "expected-status", "expected-regs", "expected-pc", "expected-memory", "expected-gas"], + "additionalProperties": false, + "$defs": { + "u8": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "u32": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "i64": { + "type": "integer", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + }, + "memory-chunk": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { "$ref": "#/$defs/u32" }, + "contents": { + "type": "array", + "items": { "$ref": "#/$defs/u8" } + } + }, + "required": ["address", "contents"], + "additionalProperties": false + } + } + } +} diff --git a/pvm/validate-asn-schema.py b/pvm/validate-asn-schema.py new file mode 100755 index 00000000..d4a291dc --- /dev/null +++ b/pvm/validate-asn-schema.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +from pathlib import Path +import asn1tools + +schema = asn1tools.compile_files("schema.asn", codec="jer") + +for path in Path("programs").iterdir(): + print(path) + schema.encode("Testcase", schema.decode("Testcase", open(path, "rb").read())) diff --git a/pvm/validate-json-schema.sh b/pvm/validate-json-schema.sh new file mode 100755 index 00000000..6ec0487f --- /dev/null +++ b/pvm/validate-json-schema.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Requires yajsv to be installed. You can install it with: +# go install github.com/neilpa/yajsv@latest + +set -euo pipefail +~/go/bin/yajsv -s schema.json programs/*.json