56 Commits

Author SHA1 Message Date
Erik Stenman
263c297090
Upgrade aebytecode after eqc fix. (#145) 2019-09-06 15:20:01 +02:00
Erik Stenman
d03cc50e03
Pt 168336524 renumber ops set base gas (#144)
* Use latest aebytecode with new opnumbers and gas.
2019-09-06 14:33:57 +02:00
Ulf Norell
46d244bfb4 aebytecode commit 2019-09-06 09:53:04 +02:00
Hans Svensson
47b3b9bcca Correct error type + new aebytecode 2019-09-05 15:14:17 +02:00
Hans Svensson
f0c728ef1e set aebytecode commit 2019-09-03 13:15:19 +02:00
sennui
1ee5a57924 change aebytecode version, aeserialization and add enacl 2019-09-02 08:54:38 +02:00
Ulf Norell
f27ba528d8 aebytecode commit 2019-08-30 11:21:26 +02:00
Hans Svensson
2dbef80249 aebytecode commit 2019-08-21 11:09:44 +02:00
Hans Svensson
86aeaa40ef Set aebytecode commit 2019-08-19 08:57:31 +02:00
Ulf Norell
956b78fb01 aebytecode commit 2019-08-16 09:14:51 +02:00
Tino Breddin
dd26649f7d [PT-167805291] Add opcode for ecrecover (#122)
* Add opcode for ecrecover

* Update aebytecode

* Extend signature bytes type used for ecrecover

* Add ecrecover to changelog

* Add some type specs

* Please dialyzer
2019-08-14 21:02:46 +02:00
Ulf Norell
3877174acb aebytecode commit 2019-08-13 15:53:49 +02:00
Thomas Arts
6aed5dfacb Upgrade to newer aebytecode version 2019-08-06 13:20:03 +02:00
Ulf Norell
054a5a4867 Update to latest aebytecode 2019-08-05 11:51:10 +02:00
Tobias Lindahl
6f873e45b8 Use a name string rather than a name hash in transfer and revoke 2019-07-01 07:42:08 +02:00
Hans Svensson
a617a6469d Change Chain.block_hash to return option(hash) 2019-06-27 14:19:39 +02:00
Tobias Lindahl
c26ace6c2c Implement aens instructions for fate 2019-06-26 13:24:48 +02:00
Ulf Norell
20085301ef aebytecode commit 2019-06-25 19:58:14 +02:00
Ulf Norell
894ae19435 aebytecode commit 2019-06-24 14:25:08 +02:00
Ulf Norell
592869bf75 aebytecode commit 2019-06-20 15:39:55 +02:00
Thomas Arts
d571993405 Fix type spec 2019-06-20 13:13:25 +02:00
Tobias Lindahl
03c6ae1c74 Add type information to oracle instructions 2019-06-20 09:23:09 +02:00
Tobias Lindahl
990df562e0
Handle oracle operation in FATE (#90)
* Handle oracle operation in FATE

Keep oracle type information on fcode level

Introduce typereps as values

Handle oracle registration

Handle oracle query object and oracle_query op

Handle oracle get question

Handle oracle query fee

Handle oracle get answer

Handle oracle respond

Handle oracle extend

* Address review comment
2019-06-18 14:32:08 +02:00
Hans Svensson
11dc632927 Add handling of auth_tx_hash 2019-06-14 13:14:24 +02:00
Thomas Arts
5513c4de1b New version of aebytecode 2019-06-11 15:24:58 +02:00
Hans Svensson
a14fa93920 Add contract_to_address to FATE 2019-06-11 12:05:58 +02:00
Ulf Norell
7b5db76c13 aebytecode commit 2019-06-05 18:20:20 +02:00
Ulf Norell
a64b72d04b aebytecode commit 2019-06-05 12:11:49 +02:00
Ulf Norell
0409a658b0 Update to new TUPLE instruction
... and minor fixes
2019-05-28 14:18:38 +02:00
Tobias Lindahl
60d9581fae Add missing instructions for FATE 2019-05-28 11:35:24 +02:00
Tobias Lindahl
0fa09467f6
Pt 166148534 refactor fate code (#71)
* Change of module names aeb_fate_code -> aeb_fate_ops

* Add missing call instructions

* Use new adt for fate code

* Add default init function if not present and keep init function if present

* Fix BLOCKHASH function for fate

* Rewrite for clarity and Dialyzer
2019-05-23 14:01:41 +02:00
Tobias Lindahl
251b876495
Add value and gas to remote calls (#64)
* Add value and gas to remote calls
2019-05-10 09:00:36 +02:00
Hans Svensson
192ec207a7 Add Contract.creator and address checking primitives 2019-05-09 09:54:04 +02:00
Ulf Norell
0aa1c89556
Fate compiler (#62)
* Update to changes in icode format

* Start on new intermediate code for FATE

* Compile `let` to FATE

* Fix and improve broken bytecode optimisations

* Basic tuple patterns

* Compile shallow matching on tuples

* Liveness analysis for local variables

* Fix minor bug

* Use RETURNR when possible

* Nicer debug printing

* Refactor optimization rules

* Compile tuple construction

* Improve instruction analysis and generalize some optimizations

* Compile nested pattern matching to case trees

(Only tuple and variable patterns so far)

* Reannotate and repeat optimization pass once it done

Could try hard to keep annotations more precise, but would be more error prone

* Get rid of unnecessary STORE instructions

* Keep better track of liveness annotations when swapping instructions

* Limit the number of iterations for the optimization loop

Should finish in one iteration, but we shouldn't loop if there are bugs
or corner cases where it doesn't.

* Pattern matching on booleans

* wip: rewrite case tree compiler to handle catch-alls

still with debug printing, and can't compile it yet

* Add missing case in renaming

* Compile case trees all the way to Fate assembly

* Simplify variables bindings in environment

* Shortcut let x = y in ...

* compile list literals

* Fix various bugs in pattern match compilation

* Pretty printer for fcode

* Fix renaming bug

* Another renaming bug

* Handle switch_body in optimizations

* Remove optimization for if-then-else

* Tag instructions in annotated scode

* Remove 'if' from fcode

* Fix dialyzer things

* Remove unused argument

* Compile pattern matching on integer literals

* Compile list patterns

* Use op_view in more places

* allow leaving out fields from record patterns

* compile records (patterns and construction)

* Compile record update

* Use SETELEMENT instruction

* Compile variants

* Remove incorrect push for tuple switches

* Optimize matching on single constructors datatypes

* Use the fact that SWITCH and JUMPIF can use args and vars

* string literals and pattern matching on the same

* Compile character literals

* Minor refactoring of op instruction handling

* compile address literals

* Get rid of unit in AST

* Unary operators

* Compile function calls

(to fully saturated top-level functions only)

* fix breakage after unary operators

* variables are now lists of names in fcode

* pretty printing for function calls

* use STORE ?a instead of PUSH during optimizations

* no-op fcode optimization pass

* some constant propagation optimizations

* Case on constructor optimization

* fix minor bugs

* Compile all the operators

* Compile maps

* Simplify JUMPIF on true/false

* Fixed left-over reference to STR_EQ

* Add compile-time evaluation for more operators

* Distinguish local vars and top-level names already in fcode

* Compile builtins

* Compile bytes(N)

Compile to FATE strings for now

* Improve inlining of PUSH

* Fix name resolution bug

* Change map_get/set to operators in fcode

* Compile lambdas and higher-order functions

* Optimize single variable closure envs

* Handle unapplied builtins and top-level functions

* Missing case in fcode pretty printer

* Fix variable binding bug in fcode compiler

* Compiler side of state updates

No support in FATE yet though

* Compile statements

* Compile events

But no FATE support for events yet

* Compile remote calls

* Clearer distinction between applied and unapplied top-level things (def/builtin) in fcode

* Tag for literals in fcode to make code cleaner

* We now have block hash at height in FATE

* Update aebytecode commit

* Get rid of catchall todos

* Jump some hoops to please Dialyzer
2019-05-07 15:48:47 +02:00
Hans Svensson
3255c62e0e Revert bytes(N) from icode/vm-types 2019-04-23 17:47:50 +02:00
Hans Svensson
4324bfd49e Add bytes(int), add address_literalsm add ecverify_secp25k1
hash -> bytes(32)
signature -> bytes(64)
address literals
2019-04-23 10:40:02 +02:00
Erik Stenman
f07954f62c Point to latest aebytecode with setelement instruction. 2019-04-15 08:54:02 +02:00
Hans Svensson
2ed9d17ce5 Switch to generalized_accounts branch of aebytecode 2019-04-08 11:57:07 +02:00
Erik Stenman
27bc5474cb Upgrade aebytecode to new variant type representation. 2019-04-02 12:44:51 +02:00
Tobias Lindahl
177e32c117 Upgrade to latest aebytecode (and by transitivity aeserialization) 2019-03-14 10:59:15 +01:00
Tobias Lindahl
a44b787735 Use latest aebytecode 2019-03-13 11:17:33 +01:00
Erik Stenman
257de08100 Upgrade rebar.lock. 2019-03-05 14:32:15 +01:00
Erik Stenman
7ae4a98360 Use latest aebytecode. (#36)
* Use latest aebytecode.

* Fix argument to dup instruction.
2019-03-05 14:27:01 +01:00
Erik Stenman
5e6e607fa4 Use v2.0.1 of aebytecode including new sub dependencies. 2019-03-05 14:27:01 +01:00
Erik Stenman
abae4a7602 Upgrade to latest aebytecode. 2019-03-05 14:24:22 +01:00
Erik Stenman
1cfd4c6f24 Add release target. 2019-03-05 14:24:22 +01:00
Erik Stenman
e33e4cf2cd Use fortuna version of aebytecode in fortuna version of aesophia. 2019-03-05 14:22:59 +01:00
Robert Virding
2f36380a81 Add handling of private and stateful functions 2019-02-28 16:13:57 +01:00
Robert Virding
d330133b3f First version, very much WIP 2019-02-28 16:13:57 +01:00
Hans Svensson
3ba89d9f55 Merge ROMA into MINERVA 2019-02-08 13:38:37 +01:00