From 719bf26a38dceacc293f8304d1ae2f24700199b8 Mon Sep 17 00:00:00 2001 From: Ulf Norell Date: Mon, 3 Feb 2020 11:39:48 +0100 Subject: [PATCH 1/3] Set store map size theshold to 0 ifdef TEST --- src/aeb_fate_maps.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aeb_fate_maps.erl b/src/aeb_fate_maps.erl index e57831d..59f2a88 100644 --- a/src/aeb_fate_maps.erl +++ b/src/aeb_fate_maps.erl @@ -25,7 +25,11 @@ %% Size in bytes of serialization of a map for which we turn it into a store %% map. It's not worth turning small maps into store maps. %% Under consensus! +-ifdef(TEST). +-define(STORE_MAP_THRESHOLD, 0). +-else. -define(STORE_MAP_THRESHOLD, 100). +-endif. -type fate_value() :: aeb_fate_data:fate_type(). -type fate_value_or_tombstone() :: fate_value() | ?FATE_MAP_TOMBSTONE. -- 2.30.2 From e5bdf583f99b65ab92e4c1f12851d510a23792da Mon Sep 17 00:00:00 2001 From: Ulf Norell Date: Mon, 24 Feb 2020 16:06:06 +0100 Subject: [PATCH 2/3] Add protected remote call instruction --- src/aeb_fate_generate_ops.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aeb_fate_generate_ops.erl b/src/aeb_fate_generate_ops.erl index 4adf9e8..26c511c 100644 --- a/src/aeb_fate_generate_ops.erl +++ b/src/aeb_fate_generate_ops.erl @@ -220,6 +220,8 @@ ops_defs() -> , { 'CHAR_TO_INT', 16#a0, false, true, true, 10, [a,a], char_to_int, {char}, int, "Arg0 := integer representation of UTF-8 character"} , { 'CHAR_FROM_INT', 16#a1, false, true, true, 10, [a,a], char_from_int, {int}, variant, "Arg0 := Some(UTF-8 character) from integer if valid, None if not valid."} + , { 'CALL_PGR', 16#a2, true, false, true, 100, [a,is,a,a,a,a,a], call_pgr, {contract, string, typerep, typerep, integer, integer, bool}, variant, "Potentially protected remote call. Arg5 is protected flag, otherwise as CALL_GR."} + , { 'DEACTIVATE', 16#fa, false, true, true, 10, [], deactivate, {}, none, "Mark the current contract for deactivation."} , { 'ABORT', 16#fb, true, true, true, 10, [a], abort, {string}, none, "Abort execution (dont use all gas) with error message in Arg0."} , { 'EXIT', 16#fc, true, true, true, 10, [a], exit, {string}, none, "Abort execution (use upp all gas) with error message in Arg0."} -- 2.30.2 From e5164330b0af281359c97eb5d69b4219426b5412 Mon Sep 17 00:00:00 2001 From: Ulf Norell Date: Mon, 2 Mar 2020 08:48:29 +0100 Subject: [PATCH 3/3] Get valid opcodes from instruction list --- quickcheck/aefate_code_eqc.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickcheck/aefate_code_eqc.erl b/quickcheck/aefate_code_eqc.erl index 416fce5..1aedfbd 100644 --- a/quickcheck/aefate_code_eqc.erl +++ b/quickcheck/aefate_code_eqc.erl @@ -77,7 +77,7 @@ prop_opcodes() -> valid_opcodes() -> - lists:seq(0, 16#a0) ++ lists:seq(16#fa, 16#fd). + [ Op || #{opcode := Op} <- aeb_fate_generate_ops:get_ops() ]. fate_code(Failure) -> -- 2.30.2