Commit Graph

192 Commits

Author SHA1 Message Date
Milo Davis
a7617f527d Michelson: Contract creation from literal 2017-12-21 11:15:43 +01:00
Benjamin Canou
2e859f14a3 Michelson: add regression test for hash consistency 2017-12-18 11:48:50 +01:00
Benjamin Canou
ac93872b2c Alpha: allow no commas in tez litterals 2017-12-14 18:48:52 +01:00
Milo Davis
319585dd80 Michelson: preliminary gas infrastructure
Costs are yet to be tweaked.

This patch is joint work between:
  Milo Davis <davis.mil@husky.neu.edu>
  Benjamin Canou <benjamin@canou.fr>
  Pierre Chambart <pierre.chambart@ocamlpro.com>
2017-12-14 18:11:26 +01:00
Milo Davis
82dcd5c179 Data_encoding: optimize binary serialization 2017-12-14 18:10:50 +01:00
Milo Davis
b2918c1387 Data_encoding: Adds ranged_int and ranged_float 2017-12-14 18:10:50 +01:00
Milo Davis
dc7a023e22 Data_encoding: Make tags on unions mandatory 2017-12-14 18:10:50 +01:00
Grégoire Henry
3c38458843 RPC: simplify the signature of Client_rpcs.ctxt 2017-12-11 17:53:54 +00:00
Grégoire Henry
4aa1b14ba6 RPC: introduce Resto_cohttp.Client and RPC_clients. 2017-12-11 17:53:49 +00:00
Benjamin Canou
6df701def2 Tests: add tests for tez constants parsing 2017-12-08 11:08:13 +00:00
Benjamin Canou
bf276fb017 Michelson: make parsing tests compile again 2017-12-08 11:08:13 +00:00
Pietro Abate
174ea10d6d Alpha: Add 4 more decimals to tez representation.
Now a tez cent is 10_000L. All constants are now in the
Constants_repr module and expressed as multiples of one_cent.

Add new function Qty_repr.mul_exn to multiply `tez` by `int`
  eg. `10 tez = Tez_repr.(mul_exn one 10)`
      `10 cents = Tez_repr.(mul_exn one_cents 10)`

Remove `Tez.{to,of}_cents` and replace them with `Tez.{to,of}_mutez`.
2017-12-08 11:08:12 +00:00
Grégoire Henry
de5935228f Opam: remove tezos-deps.opam
All dependencies are now inlined in the various opam packages.
2017-12-08 02:50:03 +01:00
Grégoire Henry
d8d54ce321 Jbuilder: install tezos-sandboxed-node.sh/tezos-init-sandboxed-client.sh 2017-12-08 02:50:03 +01:00
Grégoire Henry
7807f7aa4d Context: switch to blake2B
Get rid of the old SHA1 that was used by git...
2017-12-05 15:34:07 +00:00
Milo Davis
76e70a2799 Michelson macros: annotations permitted and better error handling 2017-12-05 12:08:54 +01:00
Milo Davis
ae2959b91c Client library refactor 2017-12-04 19:27:30 +01:00
Benjamin Canou
0967c7fde7 Tests: cleanup P2P tests output 2017-12-04 19:27:30 +01:00
Grégoire Henry
82857dcb94 Jbuilder: split lib_node_net
- `lib_node_p2p_base`: Base datatypes for the P2P layers
- `lib_node_services`: RPC service definitions (depends on `node_p2p_base`)
- `lib_node_http`: RPC http server
- `lib_node_p2p`: the P2P workers
2017-12-04 19:15:26 +01:00
Grégoire Henry
3f354e7d78 Jbuildet: tezos-node-db -> tezos-storage 2017-12-04 19:15:26 +01:00
Grégoire Henry
ab5b597eb1 Jbuilder: Move client & node libraries in their own OPAM packages 2017-12-04 19:15:26 +01:00
Grégoire Henry
9cb498eee6 Jbuilder: Move alpha/genesis/demo in their own two OPAM packages
One package for the embedded version. One for the functorized one.
2017-12-04 16:05:54 +01:00
Grégoire Henry
b6449cae87 Jbuilder: split src/utils/ in multiple OPAM packages
* `lib_stdlib`: basic extended OCaml stdlib and generic data structures

* `lib_data_encoding`: almost independant 'Data_encoding'
* `lib_error_monad`: almost independant 'Error_monad'

* `lib_stdlib_lwt`: extended Lwt library
* `lib_crypto`: all the crypto stuff (hashing, signing, cryptobox).

* `lib_base`:
  - basic type definitions (Block_header, Operation, ...)
  - a module `TzPervasives` to bind them all and to be the
    single module opened everywhere.

In the process, I splitted `Tezos_data` and `Hash` in multiple
submodules, thus removing a lot of `-open`.

The following two modules may not have found their place yet:
- Base58 (currently in `lib_crypto`)
- Cli_entries (currently in `lib_stdlib_lwt`)
2017-12-04 16:05:54 +01:00
Grégoire Henry
84a2f1ee29 Shell: enforce the maximum number of operation per block 2017-11-20 05:03:00 +01:00
Grégoire Henry
06a6cf5b9a Proto: allow to update 'max_number_of_operations'
The constant is now defined per block and not per protocol.
Also allows to set a limit per validation pass.
2017-11-20 04:57:09 +01:00
Grégoire Henry
13dd470d06 More renaming: 'mine' -> 'bake' 2017-11-20 04:27:27 +01:00
Grégoire Henry
17644e0fa3 Proto: reimplements Storage_functors with iterable indexes
The new `Storage_functors` is now a "functional" equivalent of the
"imperative" `Store_helpers` used in the shell.
2017-11-17 15:54:36 +01:00
Grégoire Henry
a7364f0ed5 Proto_env: remove Context.list
This was a reminder of old-time (before irmin-1.0). It is now replaced
with: `Context.{fold,keys}`.
2017-11-17 15:54:36 +01:00
Grégoire Henry
178d839ee1 Shell: remove net_id from the block header. 2017-11-17 14:13:55 +01:00
Grégoire Henry
b7deebaf42 Shell: Remove net_id from the operation header.
The `branch` of the operation contains enough information to induce
the `net_id`, and the code of the validator/prevalidator is now mature
enough to efficiently determine the `net_id` of an incoming operation.
2017-11-17 14:13:55 +01:00
Grégoire Henry
3e39f82bee Shell/baker: inline full operation contents in RPC. 2017-11-17 14:13:55 +01:00
Grégoire Henry
f3555488c7 Shell: use one 'validation worker' per peer.
The single validation module is split in multiple (simpler)
modules. In the process, we introduce one "validation worker" per
peer. This worker handle all the `New_head` and `New_branch`
advertised by a given peer. For so, it sends "fetching request" and
"validation request" to respectively the `Distributed_db` and and the
`Block_validator`. These two global workers are responsible of the
'fair' allocation of network and CPU ressources amongst the connected
'peers'.
2017-11-17 14:13:55 +01:00
Grégoire Henry
c5b5a87ab7
P2p: add regression test for oversized message 2017-11-17 13:46:27 +01:00
Grégoire Henry
1429a6c8e6 Almost too late for copyright update. 2017-11-15 13:13:16 +01:00
Pietro Abate
de8967540f Proto: store the public key of the manager in the contract 2017-11-14 16:56:15 +01:00
Pietro Abate
6ecfca9396 Reindent all files
Now `make test` fails when sources are not indented correctly, the
indentation test is also executed in the CI.
2017-11-13 23:13:34 +01:00
Milo Davis
32a466556e Jbuilder: use --dev option 2017-11-13 22:30:35 +01:00
Benjamin Canou
6a38f76956 Reset the chain. 2017-11-13 22:18:17 +01:00
Grégoire Henry
f63c5acbf5 Distributed_db: inline the header when broadcasting a new block.
This adds a small size overhead in the network message, but in most
cases it will avoid a subsequent 'fetch' of the header.
2017-11-13 11:04:15 +00:00
Grégoire Henry
5c1f96f3a1 Shell: add the number of validation passes in the block header. 2017-11-03 15:12:06 +00:00
Grégoire Henry
a7a4564670 Node: add an explicit type for Block_locator.t 2017-11-03 15:12:03 +00:00
Milo Davis
96953d9895 Michelson: Adds typechecking test for michelson-lang.com contracts 2017-11-03 15:51:11 +01:00
Milo Davis
6c992b58df Michelson: adds LOOP_LEFT, ITER, MAP body 2017-11-03 15:51:11 +01:00
Milo Davis
c387ed823a Michelson: Propagate and check annotations 2017-11-03 15:51:11 +01:00
Arthur Breitman
1bdae93ffd Mining -> Baking 2017-11-01 08:42:37 -07:00
Arthur Breitman
6dd9f2289a mining -> baking, continued 2017-11-01 04:13:23 -07:00
Milo Davis
0a7f9a39a9 Switch to Jbuilder
This is a rewrite of the build system with `jbuilder`, with just a
minimal toplevel Makefile for backward compatibility.

This first patch preserves the project architecture, we only gain
proper dependencies handling and always up-to-date `.merlin` files.
A latter patch may split the project in smaller "sub-package",
i.e. multiple `.opam` files.

The embedded versions of the economic protocol are now compiled with
`jbuilder` instead of `tezos-protocol-compiler`, potentially allowing
proper inlining at the cost of slightly-less-stricter
sandboxing. Nevertheless, dynamically loaded protocol are still
compiled with the `tezos-protocol-compiler` and thus strictly
sandboxed ; and a CI rule also checks the proper sandboxing of
embedded protocols.

This patch is coauthored with @hnrgrgr
2017-10-31 20:33:56 +00:00
Milo Davis
a3aa8b60bb Remove Makefiles 2017-10-31 20:33:54 +00:00
Milo Davis
490ce840f9 Remove all .merlin 2017-10-31 20:33:54 +00:00
Grégoire Henry
c5d15d3640 Test/Alpha: allows distinct port for distinct test. 2017-10-31 20:33:53 +00:00