Commit Graph

35 Commits

Author SHA1 Message Date
Dmitry Shulyak 707221954f
Make whisper tolerant to local time skews (#864)
This change adds adds an ability to use different source of time for whisper:

when envelope is created it is used to set expiry
to track when envelope needs to be expired
This time is then used to check validity of the envelope when it is received. Currently If we receive an envelope that is sent from future - peer will get disconnected. If envelope that was received has an expiry less then now it will be simply dropped, if expiry is less than now + 10*2 seconds peer will get dropped.

So, it is clear that whisper depends on time. And any time we get a skew with peers that is > 20s reliability will be grealy reduced.

In this change another source of time for whisper will be used. This time source will use ntp servers from pool.ntp.org to compute offset. When whisper queries time - this offset will be added/substracted from current time.

Query is executed every 2 mins, queries 5 different servers, cut offs min and max and the computes mean value. pool.ntp.org is resolved to different servers and according to documentation you will rarely hit the same.

Closes: #687
2018-05-04 11:23:38 +03:00
Pedro Pombeiro acbf251a3c Fix race condition in `LDBDatabase.Close()`
- https://jenkins.status.im/job/status-go/job/race-check/54/consoleFull
2018-05-03 20:39:42 +03:00
Dmitry Shulyak 7f81323fdc Remove download patch 0027 2018-05-02 12:04:17 +02:00
Pedro Pombeiro 7074048fa5 Add patch to fix race condition in `Downloader.Cancel`
- Submitted patch upstream in https://github.com/ethereum/go-ethereum/pull/16585
- Fixes Jenkins build in https://jenkins.status.im/job/status-go/job/race-check/48/
2018-05-01 16:29:27 +02:00
Igor Mandrigin f4cd8d27b5 Add `shhext_getNewFilterMessages` function to RPC APIs.
This function returns only the new messages from the filter, never
returns the same message for the same user twice.
2018-04-27 15:24:37 +02:00
Pedro Pombeiro a23b607597 Fix race condition in `0016-fix-leveldb-issue.patch`
https://jenkins.status.im/job/status-go/job/race-check/45/
2018-04-26 17:19:32 +02:00
Dmitry Shulyak b37fda7731
Update go-ethereum to 1.8.5 (#854)
* Rebase on 1.8.5

* Remove outdated patches and apply all others

* Use shh_post that returns hash

* Use bloom filter for request to mailserver

* Remove tests for sending messages without subbing first

* Fix deadlock in ethdb

* Expect null if receipt is not yet created

* Subscribe to messages before sending them in whisper test
2018-04-24 18:50:26 +03:00
Dmitry Shulyak 2f2dfe16c0
Add default peer limits configuration (#830)
* Add default peer limits configuration

If discovery is enabled for a given cluster - we will set a default
expected number of peers for each enabled service. For example:

- if cluster is rinkeby has a discovery enabled we will
  check which services are enabled
- if whisper is enabled we will set min and max limits by default
- if les is enabled and infura is not used we will set limits too

When statusd is used - configuration must be provided using configuration
supported by statusd.


* Fix deadlock in les peer set
2018-04-20 15:23:18 +03:00
Igor Mandrigin 4cc6028d59 Implement `personal_sign`.
This commit implements `personal_sign` RPC or web3 personal.sign
methods.

NB! Contains breaking API changes.
2018-04-17 11:18:58 +02:00
Adam Babik 0d652c3851
Expose only public APIs in inproc RPC client [breaking-change] (#815)
`CallRPC` binding, which is used as a provider for web3.js, exposes only public or whitelisted APIs.
2018-04-12 18:17:10 +02:00
Dmitry Shulyak ba9a25e284
Implement shh api extension that allows to confirm that message is sent (#814)
* Implement shh api extension that allows to confirm that message is sent

* Add a patch

* Fix linter

* Add readme

* Add tests for tracker

* Address review
2018-04-11 18:41:51 +03:00
Dmitry Shulyak 38d7194a2a Use chain aware signer in simulated backend 2018-04-09 14:41:50 +03:00
Dmitry Shulyak 74ce515ab2
Add metrics to discv5 (#749) 2018-04-05 16:48:59 +03:00
Evgeny Danienko e2e2af73d7
isForwarded constants introduced 2018-03-27 18:22:29 +03:00
Evgeny Danienko b4c1cd7212
send in-house messages without subscription 2018-03-27 17:47:15 +03:00
Evgeny Danienko aed16a9071
patch 2018-03-26 18:17:17 +03:00
Igor Mandrigin cfb3e6a080
Fix datarace when stopping a node. (#723) 2018-03-05 21:36:32 +01:00
Pedro Pombeiro 6cdea4ef97
Update codebase to leverage Whisper v6 (#703)
* Update project to use Whisper v6. Part of #638

* Revert "Add patch to downgrade usage of Whisper v6 to v5 in some geth 1.8.1 vendor files. Part of #665" - this reverts commit 6aefb4c8fd02dbcfffac6b69e8bb22b13ef86b6b.

* Enable light mode on Whisper v6 for non-mail servers. Part of #638

* Fix race condition in whisperv6/peer.go. Part of #665 (PR already accepted upstream for 1.8.2)

* Update bootnode addresses in staticnodes.json. Part of #638

* Add `shh.lightclient` flag and tests for bloom filter setting logic. Part of #638

* Move MakeTestNodeConfig to utils. Part of #638

* Reduce PoW in `whisper_jail_test.go` to fix flaky test. Part of #638
2018-03-02 10:25:30 +01:00
Dmitry Shulyak 988cd73217
Use newer CHT defined in go-ethereum (#711) 2018-03-01 15:23:41 +02:00
Pedro Pombeiro e4cbce12c4
Update to go-ethereum 1.8.1 (#702)
* Update `github.com/ethereum/go-ethereum` package to 1.8.1 branch. Part of #638
* Fix code due to some signature changes. Part of #638
* use upstream for whisper backend
* Add patch to downgrade usage of Whisper v6 to v5 in some geth 1.8.1 vendor files. Part of #638
* Take into account the DNS rebinding protection introduced in 1.8.0 by adding exception for localhost. Part of #638
* Add patches required for cross-compiled builds starting with geth 1.8.0. Only applied during build. Part of #638
* Update expected JSON result in `TestRegressionGetTransactionReceipt()` and `TestCallRawResultGetTransactionReceipt()`. Part of #665
* Fix some failing e2e tests. Part of #638
* Address comments in PR #702. Part of #638
2018-02-27 11:39:30 +01:00
Igor Mandrigin abb5df88d1
Wait for `Rollback` before closing the DB in the light client. (#696)
* Wait for `Rollback` before closing the DB in the light client.

* Unsubscribe from mux events properly, get rid of `time.Sleep`.
2018-02-23 11:49:57 +01:00
Igor Mandrigin c06d58addd Remove `notifications` package from go-ethereum. 2018-02-22 11:10:21 +01:00
Alex Kohler 87b12ddced Remove DefaultMinimumPow patches in favor of using whisper config (#683) 2018-02-19 15:53:40 +01:00
Pedro Pombeiro 7410532879 Patcher improvement (#681)
Improve patcher tool:
* fix broken `-p` flag,
* rename it to `-b`,
* add a new `-p` flag that allows specifying the source of the patches, so that it can be used for more than just go-ethereum patches,
* make it work correctly independently of the order that options are specified in the command line.
2018-02-18 09:14:27 -07:00
Dmitry Shulyak 4a49e840e3 Remove status backend from les internal api (#670) 2018-02-16 15:40:37 +01:00
Alex Kohler a2431b3e2b Fix typo in README 2018-02-16 03:45:06 +01:00
Igor Mandrigin 004d3ef249 Remove unused `0007-README.patch`. 2018-02-15 13:08:32 +01:00
Igor Mandrigin 2e03cbcb5d Remove outdated `0003-dockerfiles-wnode-swarm.patch`. 2018-02-15 12:51:37 +01:00
Caner Çıdam 15c72f3c6b Apply geth patches on the fly #653 (#660) 2018-02-14 18:44:27 +01:00
Pedro Pombeiro ffef611295
Tear `0013-whisperv6-notifications.patch` into two different patches (#657) 2018-02-13 10:14:57 +01:00
Pedro Pombeiro 857b72e9fd
Create whisperv6 patch versions of `0004-whisper-notifications.patch` and `0009-whisper-envelopes-tracing.patch`. Closes #637 2018-02-12 16:44:04 +01:00
Pedro Pombeiro 9976018978
Create temporary whisperv6 patch file. Closes #636 2018-02-12 16:36:55 +01:00
Pedro Pombeiro f5393274ff
Fix a couple of patches where new files are created so that new files are marked as such
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2018-02-12 15:56:03 +01:00
Igor Mandrigin 9cc9982a6a
[#639] Disable filter removal in `go-ethereum`. (#650) 2018-02-12 13:02:25 +01:00
Caner Çıdam a4c36fe96a Move non-go related files to the `_assets` folder. #621 (#630) 2018-02-09 14:38:18 +01:00