Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54dc140629 | |||
| cc4fd04019 | |||
| 97cea33be8 | |||
| 1cdcb9150b |
@@ -8,8 +8,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: eunit
|
- name: test
|
||||||
run: |
|
run: |
|
||||||
. /opt/act_runner/erts/27.2/activate
|
. /home/act_runner/.erts/27.2.1/activate
|
||||||
make
|
make dialyzer
|
||||||
./rebar3 eunit
|
make eunit
|
||||||
|
|||||||
+1
-1
@@ -25,4 +25,4 @@ cover
|
|||||||
gmfate
|
gmfate
|
||||||
current_counterexample.eqc
|
current_counterexample.eqc
|
||||||
.rebar3
|
.rebar3
|
||||||
ebin
|
ebin/*.beam
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{application,gmbytecode,
|
||||||
|
[{description,"Bytecode definitions, serialization and deserialization for the Gajumaru."},
|
||||||
|
{vsn,"3.4.1"},
|
||||||
|
{registered,[]},
|
||||||
|
{applications,[kernel,stdlib,eblake2,gmserialization,getopt]},
|
||||||
|
{env,[]},
|
||||||
|
{modules,[gmb_aevm_abi,gmb_aevm_data,gmb_asm,gmb_asm_scan,
|
||||||
|
gmb_disassemble,gmb_fate_abi,gmb_fate_asm,
|
||||||
|
gmb_fate_asm_scan,gmb_fate_code,gmb_fate_data,
|
||||||
|
gmb_fate_encoding,gmb_fate_generate_docs,
|
||||||
|
gmb_fate_generate_ops,gmb_fate_maps,gmb_fate_opcodes,
|
||||||
|
gmb_fate_ops,gmb_fate_pp,gmb_heap,gmb_memory,
|
||||||
|
gmb_opcodes,gmb_primops,gmfateasm]},
|
||||||
|
{maintainers,[]},
|
||||||
|
{licenses,[]},
|
||||||
|
{links,[]}]}.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
-record(pmap, {key_t :: gmb_gmvm_data:type(),
|
-record(pmap, {key_t :: gmb_aevm_data:type(),
|
||||||
val_t :: gmb_gmvm_data:type(),
|
val_t :: gmb_aevm_data:type(),
|
||||||
parent :: none | non_neg_integer(),
|
parent :: none | non_neg_integer(),
|
||||||
size = 0 :: non_neg_integer(),
|
size = 0 :: non_neg_integer(),
|
||||||
data :: #{gmb_heap:binary_value() => gmb_heap:binary_value() | tombstone}
|
data :: #{gmb_heap:binary_value() => gmb_heap:binary_value() | tombstone}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
-define(Type(), gmb_gmvm_data:type()).
|
-define(Type(), gmb_aevm_data:type()).
|
||||||
|
|
||||||
-define(TYPEREP_WORD_TAG, 0).
|
-define(TYPEREP_WORD_TAG, 0).
|
||||||
-define(TYPEREP_STRING_TAG, 1).
|
-define(TYPEREP_STRING_TAG, 1).
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{deps, [ {eblake2, "1.0.0"}
|
{deps, [ {eblake2, "1.0.0"}
|
||||||
, {gmserialization, {git, "https://git.qpq.swiss/QPQ-AG/gmserialization.git",
|
, {gmserialization, {git, "https://git.qpq.swiss/QPQ-AG/gmserialization.git",
|
||||||
{ref, "2db9ea613450116a330bf1e9447b77625ff8e2b3"}}}
|
{ref, "9d2ecc00d32ea295309563e54a81636ecb597e96"}}}
|
||||||
, {getopt, "1.0.1"}
|
, {getopt, "1.0.1"}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
{profiles, [{binary, [
|
{profiles, [{binary, [
|
||||||
{deps, [ {eblake2, "1.0.0"}
|
{deps, [ {eblake2, "1.0.0"}
|
||||||
, {gmserialization, {git, "https://git.qpq.swiss/QPQ-AG/gmserialization.git",
|
, {gmserialization, {git, "https://git.qpq.swiss/QPQ-AG/gmserialization.git",
|
||||||
{ref, "2db9ea613450116a330bf1e9447b77625ff8e2b3"}}}
|
{ref, "9d2ecc00d32ea295309563e54a81636ecb597e96"}}}
|
||||||
, {getopt, "1.0.1"}
|
, {getopt, "1.0.1"}
|
||||||
]},
|
]},
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -1,9 +1,5 @@
|
|||||||
{"1.2.0",
|
{"1.2.0",
|
||||||
[{<<"gmserialization">>,
|
[{<<"base58">>,
|
||||||
{git,"https://git.qpq.swiss/QPQ-AG/gmserialization.git",
|
|
||||||
{ref,"2db9ea613450116a330bf1e9447b77625ff8e2b3"}},
|
|
||||||
0},
|
|
||||||
{<<"base58">>,
|
|
||||||
{git,"https://git.qpq.swiss/QPQ-AG/erl-base58.git",
|
{git,"https://git.qpq.swiss/QPQ-AG/erl-base58.git",
|
||||||
{ref,"e6aa62eeae3d4388311401f06e4b939bf4e94b9c"}},
|
{ref,"e6aa62eeae3d4388311401f06e4b939bf4e94b9c"}},
|
||||||
1},
|
1},
|
||||||
@@ -12,7 +8,11 @@
|
|||||||
{git,"https://git.qpq.swiss/QPQ-AG/enacl.git",
|
{git,"https://git.qpq.swiss/QPQ-AG/enacl.git",
|
||||||
{ref,"4eb7ec70084ba7c87b1af8797c4c4e90c84f95a2"}},
|
{ref,"4eb7ec70084ba7c87b1af8797c4c4e90c84f95a2"}},
|
||||||
1},
|
1},
|
||||||
{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0}]}.
|
{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0},
|
||||||
|
{<<"gmserialization">>,
|
||||||
|
{git,"https://git.qpq.swiss/QPQ-AG/gmserialization.git",
|
||||||
|
{ref,"9d2ecc00d32ea295309563e54a81636ecb597e96"}},
|
||||||
|
0}]}.
|
||||||
[
|
[
|
||||||
{pkg_hash,[
|
{pkg_hash,[
|
||||||
{<<"eblake2">>, <<"EC8AD20E438AAB3F2E8D5D118C366A0754219195F8A0F536587440F8F9BCF2EF">>},
|
{<<"eblake2">>, <<"EC8AD20E438AAB3F2E8D5D118C366A0754219195F8A0F536587440F8F9BCF2EF">>},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
%%%
|
%%%
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(gmb_aevm_abi).
|
-module(gmb_aevm_abi).
|
||||||
|
-vsn("3.4.1").
|
||||||
-define(HASH_SIZE, 32).
|
-define(HASH_SIZE, 32).
|
||||||
|
|
||||||
-export([ create_calldata/4
|
-export([ create_calldata/4
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-module(gmb_aevm_data).
|
-module(gmb_aevm_data).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export_type([data/0,
|
-export_type([data/0,
|
||||||
type/0,
|
type/0,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmb_asm).
|
-module(gmb_asm).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ file/2
|
-export([ file/2
|
||||||
, pp/1
|
, pp/1
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmb_disassemble).
|
-module(gmb_disassemble).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ pp/1,
|
-export([ pp/1,
|
||||||
format/2,
|
format/2,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
%%%
|
%%%
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(gmb_fate_abi).
|
-module(gmb_fate_abi).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ create_calldata/2
|
-export([ create_calldata/2
|
||||||
, decode_calldata/2
|
, decode_calldata/2
|
||||||
|
|||||||
@@ -86,6 +86,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmb_fate_asm).
|
-module(gmb_fate_asm).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ assemble_file/3
|
-export([ assemble_file/3
|
||||||
, asm_to_bytecode/2
|
, asm_to_bytecode/2
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
%%%
|
%%%
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(gmb_fate_code).
|
-module(gmb_fate_code).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ annotations/1
|
-export([ annotations/1
|
||||||
, deserialize/1
|
, deserialize/1
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
-include("gmb_fate_data.hrl").
|
-include("gmb_fate_data.hrl").
|
||||||
|
|
||||||
-module(gmb_fate_data).
|
-module(gmb_fate_data).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-type fate_integer() :: ?FATE_INTEGER_T.
|
-type fate_integer() :: ?FATE_INTEGER_T.
|
||||||
-type fate_boolean() :: ?FATE_BOOLEAN_T.
|
-type fate_boolean() :: ?FATE_BOOLEAN_T.
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
%%
|
%%
|
||||||
%% ------------------------------------------------------------------------
|
%% ------------------------------------------------------------------------
|
||||||
-module(gmb_fate_encoding).
|
-module(gmb_fate_encoding).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ deserialize/1
|
-export([ deserialize/1
|
||||||
, deserialize_one/1
|
, deserialize_one/1
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-module(gmb_fate_generate_docs).
|
-module(gmb_fate_generate_docs).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([generate_documentation/2, generate_documentation/3]).
|
-export([generate_documentation/2, generate_documentation/3]).
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-module(gmb_fate_generate_ops).
|
-module(gmb_fate_generate_ops).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ gen_and_halt/1
|
-export([ gen_and_halt/1
|
||||||
, generate/0
|
, generate/0
|
||||||
@@ -246,6 +247,10 @@ ops_defs() ->
|
|||||||
, { 'INT_TO_BYTES', 16#b4, false, true, true, ?GAS(10), [a, a, a], int_to_bytes, {integer, integer}, bytes, "Arg0 := turn integer Arg1 into a byte array (big endian) length Arg2 (truncating if not fit)."}
|
, { 'INT_TO_BYTES', 16#b4, false, true, true, ?GAS(10), [a, a, a], int_to_bytes, {integer, integer}, bytes, "Arg0 := turn integer Arg1 into a byte array (big endian) length Arg2 (truncating if not fit)."}
|
||||||
, { 'STR_TO_BYTES', 16#b5, false, true, true, ?GAS(10), [a, a], str_to_bytes, {integer}, bytes, "Arg0 := turn string Arg1 into the corresponding byte array."}
|
, { 'STR_TO_BYTES', 16#b5, false, true, true, ?GAS(10), [a, a], str_to_bytes, {integer}, bytes, "Arg0 := turn string Arg1 into the corresponding byte array."}
|
||||||
, { 'NETWORK_ID', 16#b6, false, true, true, ?GAS(10), [a], network_id, {}, string, "Arg0 := The network_id of the chain."}
|
, { 'NETWORK_ID', 16#b6, false, true, true, ?GAS(10), [a], network_id, {}, string, "Arg0 := The network_id of the chain."}
|
||||||
|
%% Gas estimates based on simple verify benchmarks: ed25519 (?GAS(1300)): 41µs, mldsa44: 75µs, mldsa65: 113µs, mldsa87: 179µs
|
||||||
|
, { 'VERIFY_SIG_MLDSA44', 16#b7, false, true, true, ?GAS(2340), [a,a,a,a], verify_sig_mldsa44, {bytes, bytes, bytes}, boolean, "Arg0 := verify_sig_mldsa44(Hash, Pubkey, Signature)"}
|
||||||
|
, { 'VERIFY_SIG_MLDSA65', 16#b8, false, true, true, ?GAS(3640), [a,a,a,a], verify_sig_mldsa65, {bytes, bytes, bytes}, boolean, "Arg0 := verify_sig_mldsa65(Hash, Pubkey, Signature)"}
|
||||||
|
, { 'VERIFY_SIG_MLDSA87', 16#b9, false, true, true, ?GAS(5720), [a,a,a,a], verify_sig_mldsa87, {bytes, bytes, bytes}, boolean, "Arg0 := verify_sig_mldsa87(Hash, Pubkey, Signature)"}
|
||||||
|
|
||||||
, { 'DBG_LOC', 16#f0, false, true, true, ?GAS(0), [a, a], dbg_loc, {string, integer}, none, "Debug Op: Execution location. Args = {file_name, line_num}" }
|
, { 'DBG_LOC', 16#f0, false, true, true, ?GAS(0), [a, a], dbg_loc, {string, integer}, none, "Debug Op: Execution location. Args = {file_name, line_num}" }
|
||||||
, { 'DBG_DEF', 16#f1, false, true, true, ?GAS(0), [a, a], dbg_def, {string, any}, none, "Debug Op: Define a variable. Args = {var_name, register}" }
|
, { 'DBG_DEF', 16#f1, false, true, true, ?GAS(0), [a, a], dbg_def, {string, any}, none, "Debug Op: Define a variable. Args = {var_name, register}" }
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
%%% -------------------------------------------------------------------
|
%%% -------------------------------------------------------------------
|
||||||
-module(gmb_fate_maps).
|
-module(gmb_fate_maps).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-include("gmb_fate_data.hrl").
|
-include("gmb_fate_data.hrl").
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-module(gmb_heap).
|
-module(gmb_heap).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ to_binary/1
|
-export([ to_binary/1
|
||||||
, to_binary/2
|
, to_binary/2
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmb_memory).
|
-module(gmb_memory).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([binary_to_words/1]).
|
-export([binary_to_words/1]).
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmb_opcodes).
|
-module(gmb_opcodes).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([ dup/1
|
-export([ dup/1
|
||||||
, mnemonic/1
|
, mnemonic/1
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmb_primops).
|
-module(gmb_primops).
|
||||||
|
-vsn("3.4.1").
|
||||||
-export([ is_local_primop_op/1
|
-export([ is_local_primop_op/1
|
||||||
, op_needs_type_check/1
|
, op_needs_type_check/1
|
||||||
]).
|
]).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{application, gmbytecode,
|
{application, gmbytecode,
|
||||||
[{description, "Bytecode definitions, serialization and deserialization for the Gajumaru."},
|
[{description, "Bytecode definitions, serialization and deserialization for the Gajumaru."},
|
||||||
{vsn, "3.4.0"},
|
{vsn, "3.4.1"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications,
|
{applications,
|
||||||
[kernel,
|
[kernel,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-module(gmfateasm).
|
-module(gmfateasm).
|
||||||
|
-vsn("3.4.1").
|
||||||
|
|
||||||
-export([main/1]).
|
-export([main/1]).
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ all() ->
|
|||||||
|
|
||||||
roundtrip_identy(_Cfg) ->
|
roundtrip_identy(_Cfg) ->
|
||||||
CodeDir = code:lib_dir(gmbytecode, test),
|
CodeDir = code:lib_dir(gmbytecode, test),
|
||||||
FileName = filename:join(CodeDir, "asm_code/identity.gmsm"),
|
FileName = filename:join(CodeDir, "asm_code/identity.aesm"),
|
||||||
Code = gmb_asm:file(FileName, []),
|
Code = gmb_asm:file(FileName, []),
|
||||||
ct:log("Code ~p:~n~s~n", [FileName, gmb_disassemble:format(Code, fun io:format/2)]),
|
ct:log("Code ~p:~n~s~n", [FileName, gmb_disassemble:format(Code, fun io:format/2)]),
|
||||||
ok.
|
ok.
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
{a_email,[]}.
|
{name,"Gajumaru Bytecode"}.
|
||||||
{author,""}.
|
{type,lib}.
|
||||||
{c_email,[]}.
|
{modules,[]}.
|
||||||
{copyright,""}.
|
{prefix,none}.
|
||||||
{deps,[{"otpr","gmserialization",{0,1,0}},
|
{desc,"A library and stand alone assembler for Gajumaru bytecode. This version supports AEVM bytecode and FATE bytecode."}.
|
||||||
|
{author,[]}.
|
||||||
|
{package_id,{"otpr","gmbytecode",{3,4,1}}}.
|
||||||
|
{deps,[{"otpr","gmserialization",{0,1,2}},
|
||||||
{"otpr","eblake2",{1,0,0}},
|
{"otpr","eblake2",{1,0,0}},
|
||||||
{"otpr","getopt",{1,0,2}}]}.
|
{"otpr","getopt",{1,0,2}}]}.
|
||||||
{desc,"A library and stand alone assembler for Gajumaru bytecode. This version supports AEVM bytecode and FATE bytecode."}.
|
|
||||||
{file_exts,[]}.
|
|
||||||
{key_name,none}.
|
{key_name,none}.
|
||||||
|
{a_email,[]}.
|
||||||
|
{c_email,[]}.
|
||||||
|
{copyright,[]}.
|
||||||
|
{file_exts,[]}.
|
||||||
{license,skip}.
|
{license,skip}.
|
||||||
{modules,[]}.
|
|
||||||
{name,"Gajumaru Bytecode"}.
|
|
||||||
{package_id,{"otpr","gmbytecode",{3,4,0}}}.
|
|
||||||
{prefix,none}.
|
|
||||||
{repo_url,"https://git.qpq.swiss/QPQ-AG/gmbytecode"}.
|
{repo_url,"https://git.qpq.swiss/QPQ-AG/gmbytecode"}.
|
||||||
{tags,["gajumaru","blockchain","fate","bytecode","crypto","gm"]}.
|
{tags,["gajumaru","blockchain","fate","bytecode","crypto","gm"]}.
|
||||||
{type,lib}.
|
|
||||||
{ws_url,[]}.
|
{ws_url,[]}.
|
||||||
|
|||||||
Reference in New Issue
Block a user