Commit Graph

95 Commits

Author SHA1 Message Date
Denis S. Soldatov aka General-Beck 568dc33a02
revert to #7677 #7679 2018-01-25 03:23:33 +03:00
Marek Kotewicz fa6a0a6b60 Backports to beta (#7660)
* Improve handling of RocksDB corruption (#7630)

* kvdb-rocksdb: update rust-rocksdb version

* kvdb-rocksdb: mark corruptions and attempt repair on db open

* kvdb-rocksdb: better corruption detection on open

* kvdb-rocksdb: add corruption_file_name const

* kvdb-rocksdb: rename mark_corruption to check_for_corruption

* Hardening of CSP (#7621)

* Fixed delegatecall's from/to (#7568)

* Fixed delegatecall's from/to, closes #7166

* added tests for delegatecall traces, #7167

* Light client RPCs (#7603)

* Implement registrar.

* Implement eth_getCode

* Don't wait for providers.

* Don't wait for providers.

* Fix linting and wasm tests.

* Problem: AttachedProtocols don't get registered (#7610)

I was investigating issues I am having with Whisper support. I've
enabled Whisper on a custom test network and inserted traces into
Whisper handler implementation (Network<T> and NetworkProtocolHandler
for Network<T>) and I noticed that the handler was never invoked.

After further research on this matter, I found out that
AttachedProtocol's register function does nothing:
https://github.com/paritytech/parity/blob/master/sync/src/api.rs#L172
but there was an implementation originally:
99075ad#diff-5212acb6bcea60e9804ba7b50f6fe6ec and it did the actual
expected logic of registering the protocol in the NetworkService.

However, as of 16d84f8#diff-5212acb6bcea60e9804ba7b50f6fe6ec ("finished
removing ipc") this implementation is gone and only the no-op function
is left.

Which leads me to a conclusion that in fact Whisper's handler never gets
registered in the service and therefore two nodes won't communicate
using it.

Solution: Resurrect original non-empty `AttachedProtocols.register`
implementation

Resolves #7566

* Fix Temporarily Invalid blocks handling (#7613)

* Handle temporarily invalid blocks in sync.

* Fix tests.
2018-01-23 12:32:34 +01:00
Arkadiy Paronyan dde6baedec
Removed ethcore-util dependency from ethcore-network (#7180)
* Removed ethcore-util dependency

* Removed snappy
2017-12-02 10:08:04 +01:00
debris 3cf52dac59 use error-chain in ethcore-network 2017-11-13 16:48:58 +01:00
debris 16d84f8ecf finished removing ipc 2017-10-16 18:18:43 +02:00
Hawstein ade37be25b separate trie from util and make its dependencies into libs:
* bytes
* hashdb
* memorydb
* nibbleslice
* nibblevec
2017-09-15 11:03:53 +08:00
Robert Habermeier 375668bc40 Compatibility with whisper v6 (#6179)
* compatibility with whisper v6

* separate subprotocol for parity extensions

* kill version field
2017-09-10 18:02:14 +02:00
Fredrik 308f36a532 Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
Arkadiy Paronyan d520aa2633 Connection filter (#6359) 2017-08-29 14:38:01 +02:00
Joseph Mark b5f1524e78 Refactor --allow-ips to handle custom ip-ranges (#6144)
* Add checks for additional reserved ip addresses

100.64.0.0/10 and 240.0.0.0/4 are both reserved but not currently
filtered.

* Add check for special purpose addresses

192.0.0.0/24 - Used for the IANA IPv4 Special Purpose Address Registry

* Refactor ip_utils (#5872)

* Add checks for all ipv4 special use addresses
* Add comprehensive ipv4 test cases

* Refactor Ipv6 address checks (#5872)

* Refactor AllowIP (#5872)

* Add IpFilter struct to wrap predefined filter (AllowIP) with custom
allow/block filters.
* Refactor parsing of --allow-ips to handle custom filters.
* Move AllowIP/IpFilter from ethsync to ethcore-network where they
are used.

* Revert Cargo.lock

* Tests for custom ip filters (#5872)

* Add "none" as a valid argument for --allow-ips to allow narrow
custom ranges, eg.: --allow-ips="none 10.0.0.0/8"
* Add tests for parsing filter arguments and node endpoints.
* Add ipnetwork crate to dev dependencies for testing.

* Add ipv6 filter tests (#5872)

* Revert parity-ui-precompiled to master

* Fix minor detail in usage.txt (#5872)

* Spaces to tabs

* Rename IpFilter::new() to ::default()

* Small readability improvements

* Test (#5872)

* Revert "Test (#5872)"

This reverts commit 7a8906430a6dad633fe29df3dca57f1630851fa9.
2017-07-28 19:06:39 +02:00
Robert Habermeier 99075ad22a Initial Whisper implementation (#6009)
* whisper skeleton

* basic message store

* rallying and message logic

* pass host info to network protocol handlers

* choose who starts rally based on node key

* module reshuffling

* mining messages

* prune messages by low PoW until below size target

* associated error type for ethkey generators and `OsRng` generator

* beginnings of RPC

* generic message handler for whisper

* reshuffle code order

* standard payload encoding and decoding

* basic crypto

* minor restructuring of net code

* implement shh_post

* merge?

* implement filters

* rand trait for hash types

* filter RPCs for whisper

* symmetric encryption of payload

* pub-sub

* filter tests

* use only secure random IDs

* attach arbitrary protocols to network

* basic integration of whisper into Parity

* eagerly prune low PoW entries

* broadcast messages with salted topics

* node info RPC

* fix import

* fix leading zeros calculation

* address minor grumbles
2017-07-14 20:40:28 +02:00
Vurich 3d8dc11442 Upgrade `elastic-array` to 0.9.0
This is a huge change, which includes some changes to replace code that
originally cloned to reuse allocations instead. The updated
`elastic-array` crate renames its consuming `Vec`-conversion method to
`into_vec`, which means that I can do a simple
`sed -i 's/to_vec/into_vec/'` and then fix the compilation errors.

This commit is probably a minor performance win and definitely a
significant readability win.
2017-06-29 13:05:33 +02:00
Guanqun Lu 41fed96d96 convert try!() to ? 2017-06-18 22:16:34 +08:00
Robert Habermeier aa41b48ba0 Dynamically adjust PIP request costs based on gathered data (#5603)
* beginnings of load timer

* initial load timer implementation

* saturating adds

* create flow params from distribution

* update request credits and acknowledgement

* mark cumulative cost dead code

* fix compilation

* tests

* supply load share and other params to  lightprotocol params

* add file store

* fix ethsync compilation

* reshuffle constants
2017-05-23 12:31:09 +02:00
Robert Habermeier e0a79699ea transaction propagation on a timer 2017-03-23 20:31:20 +01:00
Robert Habermeier b96eb45877 eth_syncing RPC for light client 2017-03-23 03:23:53 +01:00
Robert Habermeier 83911a7290 complete quick'n'dirty light CLI 2017-03-22 22:00:52 +01:00
Robert Habermeier 73b2dd7a59 light client RPC dependencies 2017-03-22 21:09:43 +01:00
Robert Habermeier c718b5618e initial light CLI 2017-03-22 18:32:04 +01:00
Robert Habermeier a9d75e2223 CLI options for light client 2017-03-22 16:45:50 +01:00
Robert Habermeier 9316eb4ad3 (most of) parity RPC for light client 2017-02-17 21:38:43 +01:00
Robert Habermeier baf0dbc6bf LightProvider struct using light transaction queue 2017-02-09 18:42:18 +01:00
Robert Habermeier 3b9ac7648c with_context on LightSync 2017-02-02 17:02:46 +01:00
Robert Habermeier fd44dcda15 rename LES protocol ID 2017-02-02 15:22:38 +01:00
Gav Wood 8404edb656 Fix whitespace (#4299)
* Fix whitespace.

* Update copyright years/owner.

* Push release only for tags.
2017-01-25 18:51:41 +01:00
Robert Habermeier 3ff9324ec0 LES Peer Info (#4195)
* connected peers function for network service

* get LES peer info in sync API

* new peer info in RPC
2017-01-20 12:41:49 +01:00
Tomasz Drwięga e11353f94c UnverifiedTransaction type (#4134)
* Introducing ValidSignedTransaction

* Verifiying transactions in engines

* Widening use of VerifiedSignedTransaction

* Renaming Transactions

* Uncommenting banning queue & Fixing tests

* Fixing json tests

* Fixing pre-homestead test

* Fixing imports

* Addressing grumbles

* Fixing test
2017-01-13 08:51:36 +00:00
Robert Habermeier 7123f19a75 Test harness for lightsync (#4109)
* make on_connect/disconnect public

* free flow params constructor

* Shared ownership of LES handlers

* light provider impl for test client

* skeleton for testing light sync

* have test_client use actual genesis

* fix underflow in provider

* test harnesses for lightsync

* fix tests

* fix test failure caused by test_client changes
2017-01-11 14:39:03 +01:00
Tomasz Drwięga 21006da125 Get rid of unsafe code in ethkey, propagate incorrect Secret errors. (#4119)
* Implementing secret

* Fixing tests
2017-01-11 12:16:47 +01:00
Robert Habermeier e6324a83f1 Merge branch 'master' into lightsync 2016-12-28 15:53:11 +01:00
Robert Habermeier 8125b5690c Port `try` macro to new `?` operator. (#3962)
* initial untry sweep

* restore try in ipc codegen, fix inference

* change a few missed try instances
2016-12-27 12:53:56 +01:00
Robert Habermeier d0194f3ad3 Merge branch 'master' into lightsync 2016-12-23 13:39:06 +01:00
Nikolay Volf af501e6467 Custom attribute for binary serialization (#3922)
* derive(Binary) -> binary

* ethcore types refact

* fixup ethcore

* make binary optional

* fix common types

* fix updater

* remove condition
2016-12-21 15:09:35 +01:00
Robert Habermeier 8b88ef1844 add light sync service to ethsync 2016-12-16 17:38:16 +01:00
keorn fa504e510f Merge branch 'master' into auth-bft 2016-12-12 21:28:46 +01:00
Gav Wood c0a2d5c8f5 Merge pull request #3796 from ethcore/tx-broadcast
Avoid broadcasting transactions to peers that send them
2016-12-12 04:13:56 +01:00
Gav Wood 17cc2be4b5
Rename ethcore -> parity in license. 2016-12-11 19:30:54 +01:00
Tomasz Drwięga 19ca9ad460 Prevent broadcasting transactions to peer that send them. 2016-12-10 21:22:19 +01:00
Tomasz Drwięga aaf6da4c00 Returning persistent node id 2016-12-10 16:55:29 +01:00
Tomasz Drwięga e1ade5b375 Maintaining a list of transactions propagated from other peers 2016-12-10 15:18:44 +01:00
keorn e5f8044cad Merge branch 'master' into auth-bft 2016-12-10 11:01:23 +01:00
Robert Habermeier e7ce8c9558 light: broadcast status updates to peers 2016-12-08 23:57:09 +01:00
Robert Habermeier 6f5f1f5e26 light: integrate with sync + serve_light CLI 2016-12-08 23:21:47 +01:00
Robert Habermeier efd66f566d ethsync: optional ipc codegen 2016-12-08 19:52:48 +01:00
keorn 3ebfa1481d better proposal block handling 2016-12-08 12:03:34 +01:00
keorn 6fc943ca6d Merge branch 'master' into auth-bft 2016-12-05 16:37:35 +00:00
Gav Wood 43ec3d8f79
network_id -> u64 2016-12-05 06:54:31 -08:00
arkpar 4eca687bbb Fixed network context 2016-12-01 15:49:26 +01:00
arkpar 84cf27c3ef Advertise protocol version 2 2016-11-30 16:48:30 +01:00
arkpar 95f81b2a2f Moved consensus networking into Parity handler 2016-11-29 16:54:30 +01:00