Commit Graph

61 Commits

Author SHA1 Message Date
Benjamin Canou
3a149af667 Utils: include error id in the default error pretty printer. 2017-01-20 13:25:28 +01:00
Grégoire Henry
2ed8bf2cfa Shell: implement P2p_io_scheduler 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
7f091b38b9 Shell: add Crypto_box.Public_key_hash 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
0b6aa16ca7 Shell: improve logging (prepend the current time) 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
22ae4dbf45 Shell: simplify the signature of Hash.Hash_table 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
1f7f9b369d Shell: improve Lwt_pipe 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
6b3e002285 Shell: improve Lwt_utils 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
0027d70158 Shell: improve Error_monad 2017-01-19 10:21:17 +01:00
Vincent Bernardoff
98fd45ab9f Shell: add Ring 2017-01-19 10:21:17 +01:00
Vincent Bernardoff
ad035d7679 Shell: add Time.{Map,Set,Table} 2017-01-19 10:21:17 +01:00
Benjamin Canou
923d061d72 Client: help generation fixes. 2016-12-05 13:18:12 +01:00
Benjamin Canou
a098d25a55 Client: add a context to command evaluation. 2016-12-03 13:05:02 +01:00
Benjamin Canou
dc64f9b6fb Webclient: first draft. 2016-12-02 20:06:29 +01:00
Benjamin Canou
e7c39578b4 Extract the js_of_ocaml compatible part of utils. 2016-12-01 18:27:53 +01:00
Guillem Rieu
80e1b0f312 Client: add Cli_entries.warning to log a message on stderr without raising exception 2016-12-01 15:52:31 +01:00
Benjamin Canou
087a097cf7 Client: cli_entries module refactoring. 2016-12-01 15:52:31 +01:00
Vincent Bernardoff
16a3c88b1f Shell: introduce Moving_average 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
26c84de550 Shell: introduce Lwt_pipe 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
199bd93696 Lwt_utils: add may 2016-11-29 16:39:53 +01:00
Vincent Bernardoff
ec922f6821 Utils: add first_some 2016-11-29 14:51:36 +01:00
Grégoire Henry
2a43eeaa7f P2P: properly handle End_of_file. 2016-11-26 11:49:07 +01:00
Grégoire Henry
ebcc63aefb Shell: typo in P2P identity proof-of-work 2016-11-25 23:07:05 +01:00
Grégoire Henry
17475aa743 Shell: switch to Blake2b (closes #87 #89)
Also drop the dependencies on Cryptokit.
2016-11-25 19:46:50 +01:00
Grégoire Henry
daf3343dc1 Shell: reduce difficulty for P2P identity...
... until we properly store the nonce in the configuration file,
together with the expected difficulty.
2016-11-25 18:03:57 +01:00
Eitan Chatav
710e3e755a Merge branch 'master' into crypto-box 2016-11-21 12:55:13 -08:00
Grégoire Henry
46cca127a6 Merge branch 'uint64_comparison_in_proof_of_work' into 'master'
Use unsigned comparison in proof of work

See merge request !114
2016-11-21 09:55:46 +01:00
Arthur Breitman
39ea223e5b add comment for checksum in base48 encoding 2016-11-21 09:46:05 +01:00
Eitan Chatav
7cb8a42629 lower default target
takes about 2 minutes on my laptop
2016-11-18 14:28:01 -08:00
Eitan Chatav
ffc0189f19 default target
takes a couple seconds on my laptop to generate a proof of work with
this target
2016-11-18 14:07:27 -08:00
Eitan Chatav
2864152e15 use 256 bit target for proof of work
* SHA256 produces 256 bits pseudo-randomly uniformly, so you may
compare to a 256 bit target to get a proof of work
* If you pretend that the hash and targets are both integers between 0
and 2^256 - 1, then the target partitions the range into passing and
failing segments.
* In order to match the use of the `get_uint16` function from
`ocplib-endian`, the easiest way to encode `target` is as a `int list`
which works if not ideal
* This seems like the same thing bitcoin does; difficulty there is
actually not a primary notion but is calculated from a 256 bit target,
which is what gets adjusted over time
2016-11-17 12:02:32 -08:00
Grégoire Henry
b9c3d95406 Proto: use integer comparison while checking proof-of-work. 2016-11-17 14:58:09 +01:00
Grégoire Henry
c842140f74 Shell: introduce Compare.Uint{32,64} 2016-11-17 14:58:09 +01:00
Eitan Chatav
65795dba2c Merge branch 'master' into crypto-box 2016-11-16 17:09:24 -08:00
Eitan Chatav
0edfae4621 bitmask
use bit mask to check proof of work
2016-11-16 17:09:01 -08:00
Grégoire Henry
a55f31bc9b Merge branch 'resolve_prefix' into 'master'
Implement a minimal "completion" service.

The use of Base48 encoding allows to efficiently implement a "completion" mechanism for blocks, operations, public key and contract identifiers. For instance:

```
> ./tezos-client complete eeHfgnr9QeDN
eeHfgnr9QeDNvcMgSfATNeDeec4KG4CkHHkNNJt5B9xdVmsxhsHNR
```

This command returns all the identifiers matching the given prefix. Adding the option `-unique` let the command fails when there more than one possible completion.

This completion mechanism should probably never be used implicitly, but it might still be useful to display a small completion popup in a GUI, or during manual testing on the CLI. 

See merge request !101
2016-11-17 01:50:49 +01:00
Eitan Chatav
ee5aec87ad check proof of work 2016-11-16 17:36:14 +01:00
Eitan Chatav
0398a66423 proof of work start 2016-11-16 17:33:11 +01:00
Grégoire Henry
3c55c72abf Merge remote-tracking branch 'ocp/crypto-box' 2016-11-16 01:19:13 +01:00
Grégoire Henry
b16a644e55 Proto: Completion of Base48-encoded public keys and contracts
This required some modifications in the Base48 module, in order not to
share the 'resolver' between distinct version of the economical protocol.
2016-11-16 00:53:40 +01:00
Grégoire Henry
1805a1d816 Shell: inline Ed25519 into Environment
This interface is not used in the shell, only in the protocol.  It is
just a (documented) wrapper over a fragment of sodium.
2016-11-16 00:53:40 +01:00
Grégoire Henry
b82ad19806 Shell: Consistently use Ed25519.Public_key_hash 2016-11-16 00:53:40 +01:00
Grégoire Henry
3f864ae113 Shell: display 12 characters for short Base48.
A full block/operation identifier is around 53 characters.
2016-11-16 00:52:48 +01:00
Grégoire Henry
1ce2643dc7 Shell: add Base48.decode_partial 2016-11-16 00:52:48 +01:00
Grégoire Henry
07ba685b8d Base48: encode the "data" before its "hash" 2016-11-16 00:52:48 +01:00
Vincent Bernardoff
f7b149c9ed Lwt_utils: fix read_mbytes 2016-11-16 00:45:52 +01:00
Grégoire Henry
5e26e1b9df Shell: Introduce Lwt_utils.{read,write}_mbytes 2016-11-16 00:45:17 +01:00
Grégoire Henry
cbca39d4ea Shell: proper handling of uint{8,16} in Data_encoding 2016-11-16 00:38:58 +01:00
Eitan Chatav
4cd86b7ca8 check proof of work 2016-11-09 18:29:57 -08:00
Eitan Chatav
e9ff110d08 proof of work start 2016-11-08 18:18:09 -08:00
Eitan Chatav
1733cd499a handle decryption exceptions 2016-11-07 14:38:02 -08:00