Commit Graph

60 Commits

Author SHA1 Message Date
Henry de Valence 22c3bdeb61 Prefix workspace crates with zebra- (#70)
* Update license and author metadata in workspace crates.

- ensure that the license field is set to GPL-3 for all GPL-3 licensed crates;
- ensure that the author field is set to "Zcash Foundation", responsible for maintenance;
- preserve the original authorship info in AUTHORS.md for human-readable history.

Updating the author field ensures that all of the machine systems that read
crate metadata list the ZF organization, not any single individual, as the
maintainer of the crate.

* Prefix all internal crate names with zebra-.

This does not move the directories containing these crates to also have zebra-
prefixes (for instance, zebra-chain instead of chain).  I think that this would
be preferable, but because it's a `git mv`, it will be simple to do later and
leaving it out of this change makes it easier to see the renaming of all of the
internal modules.

* Remove git dependency from eth-secp256k1

* Avoid an error seemingly related to Deref coercions.

This code caused an overflow while evaluating type constraints.  As best as I
can determine, the cause of the problem was something like so: the Rust
implementation of the Bitcoin-specific hash function used in the Bloom filter
doesn't operate on byte slices, but only on a `&mut R where R: Read`, so to
hash a byte slice, you need to create a mutable copy of the input slice which
can be consumed as a `Read` implementation by the hash function; the previous
version of this code created a slice copy using a `Deref` coercion instead of
`.clone()`, and when a tokio update added new trait impls, the type inference
for the `Deref` coercion exploded (somehow -- I'm not sure about the last
part?).

This commit avoids the problem by manually cloning the input slice.
2019-07-02 15:07:06 -04:00
Henry de Valence 891226069a Run cargo fmt 2019-06-28 15:26:18 -07:00
Svyatoslav Nikolsky 5d26582830 name all (excl main) threads 2019-04-05 11:27:19 +03:00
Dimitris Apostolou cbf4c99d8b
Fix typos 2019-02-03 00:35:00 +02:00
Svyatoslav Nikolsky fdd78009a2 cleaning up 2018-11-14 11:53:32 +03:00
Svyatoslav Nikolsky 3a1e6c9aa6 cleaning up 2018-11-13 14:20:25 +03:00
Svyatoslav Nikolsky 0e401952ab flush 2018-11-12 12:23:35 +03:00
Svyatoslav Nikolsky 7e47bd3b28 flush 2018-05-18 12:04:36 +03:00
Svyatoslav Nikolsky f019ad62ac fixed BoxFuture-related warnings 2017-12-27 15:33:05 +03:00
Svyatoslav Nikolsky 062a68204c segwit: sync changes 2017-08-22 14:40:04 +03:00
Svyatoslav Nikolsky d4a191aec1 segwit: initial flush 2017-08-22 14:39:10 +03:00
Svyatoslav Nikolsky d59d67ecd5 Merge branch 'master' into support_uahf 2017-08-14 10:15:34 +03:00
Svyatoslav Nikolsky 0e9b5fd89e merge good changes from sync_queue branch 2017-08-10 17:44:01 +03:00
Svyatoslav Nikolsky 127d662448 UAHF: set Services bit#5 + prefer nodes with bit#5 set 2017-08-08 12:17:36 +03:00
Svyatoslav Nikolsky ee509fd696 Sync queue improvements: maintaining proper number of active connections on p2p level [WIP] (#396)
* autoconnect on start

* proper # of outbound connections in autoconnect

* close connection to seednode after receiving addr

* fixed seednodes list

* do not connect to same IPv4 && IPv6

* disconnect from seednode when >1 addr received
2017-04-14 08:28:41 +02:00
debris 35c74d8948 use tokio_io::AsyncWrite in p2p lib 2017-03-25 16:20:45 +07:00
Svyatoslav Nikolsky 232bb3ada7 sing ping requests on timeout 2017-01-11 11:48:40 +03:00
NikVolf b9df3c498f added injects 2016-12-21 18:57:29 +03:00
NikVolf 92b103deb8 p2p api changes 2016-12-13 14:23:16 +01:00
NikVolf c19740d3eb finalizing api 2016-12-12 19:18:43 +01:00
NikVolf 8d42281804 refactoring on using context 2016-12-12 18:28:39 +01:00
NikVolf a6e8f376ca p2p api changes 2016-12-12 15:18:05 +01:00
debris ca49061df0 command line option to limit connections only to ipv4 or ipv6 2016-11-30 16:01:11 +01:00
debris 6713503add synchronous syncing almost finished 2016-11-15 12:48:12 +01:00
debris 6b38929222 cleanup session init and on_message 2016-11-09 22:36:29 +01:00
debris 436d925ba6 clippy lints enabled for crypto, message, p2p, pbtc, primitives and serialization 2016-11-08 11:51:34 +01:00
debris 5b93c5dc40 regression tests support 2016-11-05 15:32:57 +01:00
debris fc32423017 save node_table to $APP_DIR/p2p/nodes.csv 2016-11-04 12:08:58 +01:00
debris 2f9aaeb46f fixed issue with not connecting to enought peers 2016-11-03 10:50:44 +01:00
debris b0cbd8e12b fixed tracing and note inbound/outbound calls 2016-11-03 01:13:43 +01:00
debris 448259328d connect to multiple nodes automatically 2016-11-03 00:22:23 +01:00
Svyatoslav Nikolsky 36e30ef5ce support connect to given port via command line 2016-11-02 10:25:09 +03:00
debris a1a66f5df8 add protocol method on_close 2016-10-31 14:44:48 +01:00
Svyatoslav Nikolsky 68ddc7fa88 Async verification (#54)
* async verifying

* lost file

* removed debug timer

* fixed compilation && tests

* fixed typo

* async verification refactoring

* fixed sync stall

* fixed dead_code warning

* get rid of extra locks

* fixed tests

* * separated tasks executor from sync node
* local node mutex removed
2016-10-29 11:52:40 +02:00
debris bdac1b825b handshake time limitied to 5 seconds 2016-10-27 14:57:14 +02:00
Marek Kotewicz 1306a3905a disconnect from seednode 60 seconds after receiving addr message (#38) 2016-10-26 11:45:51 +02:00
debris 4d573ce1b6 clean up nested nested futures spawning in p2p connection 2016-10-25 11:02:37 +02:00
Marek Kotewicz 6ac07659b6 seednodes dns lookup (#34)
* fixed compile error after merging 29 & 30

* dns lookup

* connect to seednode
2016-10-25 09:55:43 +02:00
Marek Kotewicz 36c61c0474 Improvements for `Session` (#29)
* Session::initialize does not return result

* SessionFactory
2016-10-24 16:39:20 +02:00
Svyatoslav Nikolsky b081ca3d70 Continue synchronization protocol impl (#30)
* p2p <-> sync interfaces proposal

* updated with example

* send errors will be handled in p2p module => no need to return to the sync

* poc of outbound sync connection

* simplified send_to_peer

* context has cpu pool and enent loop handles

* on_message won't return ProtocolAction anymore

* session initialized sync protocol, remove retain cycles on P2P::drop

* removed ProtocolAction

* uncommented ping protocol

* node_table sorts nodes also by recently used time

* started work on sync package

* send getaddr on connect

* fixed node_table insert, added insert_many

* addr protocol

* sync headers response

* continue sync

* continue sync protocol

* separated sync connection start from sync connection creation

* switched to getblocks (instead of getheaders)

* starting to receive blocks in sync

* deal with orphaned blocks in sync::local_chain

* continue sync

* fix warnings

* removed TODOs

* protocol::sync is back to private state

* fixed grumbes
2016-10-24 16:38:33 +02:00
Marek Kotewicz 1c7bfc9a2e fixed on_message stackoverflow (#31) 2016-10-24 15:55:08 +03:00
Marek Kotewicz 6f6ad59113 removed unused code from p2p, clean up exported structs (#26)
* removed unused code from p2p module

* exposed p2p::NetConfig
2016-10-24 11:14:01 +03:00
Marek Kotewicz 02816aaa4e addr protocol && start of sync protocol (#25)
* p2p <-> sync interfaces proposal

* updated with example

* send errors will be handled in p2p module => no need to return to the sync

* poc of outbound sync connection

* simplified send_to_peer

* context has cpu pool and enent loop handles

* on_message won't return ProtocolAction anymore

* session initialized sync protocol, remove retain cycles on P2P::drop

* removed ProtocolAction

* uncommented ping protocol

* node_table sorts nodes also by recently used time

* send getaddr on connect

* fixed node_table insert, added insert_many

* addr protocol

* added TODO: remove
2016-10-24 10:42:11 +03:00
debris 189fd37835 ping->pong exchange 2016-10-21 10:55:37 +02:00
debris 441c6cb883 session initialize, on_message, context send 2016-10-20 13:19:19 +02:00
debris 668e4a712a polishing p2p logging 2016-10-20 03:14:42 +02:00
debris 1349c3af4b p2p::Context, changed the way incomming messages read 2016-10-20 02:51:20 +02:00
debris 14e9fd041c additional log on disconnect 2016-10-19 14:49:50 +02:00
debris 49bb034bbd added logger to p2p, fixed reading messages 2016-10-19 14:17:18 +02:00
debris 716fd8d949 p2p in progress, connection shutdown on error 2016-10-18 14:29:38 +02:00