79 Commits

Author SHA1 Message Date
Adam Babik
0473f29a8a
Fix race conditions in tests (#857) 2018-04-23 15:35:48 +02:00
Adam Babik
07b2c3d750
Move concurrent backend test from e2e to unit (#849) 2018-04-20 17:39:53 +02: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
f0f55d408f Make sure that only personal_sign and personal_ecRecover are exported. 2018-04-18 18:22:21 +02: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
364f88efd9
Allow to start ephemeral StatusNode (#829)
This change will greatly simplify writing unit tests when a node is required but data persistence is irrelevant.

I also Introduced some refactoring and unit tests for `StatusNode`.
2018-04-16 14:36:09 +02:00
Adam Babik
ef160e8720
Add CallPrivateRPC binding (#825)
This PR provides CallPrivateRPC binding, which can call both public and private bindings but should not be used in web3.js provider implementations.
2018-04-16 10:01:37 +02:00
Dmitry Shulyak
0b123ed407 Send an expiration signal when envelope wasn't delivered to any peer 2018-04-15 10:44:49 +03: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
02309e81e9
Peer pool to manage v5 peers (#736) 2018-04-10 09:44:09 +03:00
Adrià Cidre
df35ad6dbe
[#797] Unify EnsureSync on t/utils/utils.go and StatusManager (#806) 2018-04-09 09:16:43 +02:00
Adrià Cidre
359b3621e9 [#797] Simplify node.Manager public api and rename it to StatusNode
- [x] [#797] : Remove unused methods PopulateStaticPeers, ReconnectStaticPeers, removeStaticPeers, removePeer
- [x] [#797] : Rename node.Manager to node. StatusNode and simplify its public api
- [x] [#797] : Rename all references to nodeManager to statusNode
2018-04-05 16:47:27 +02:00
Adrià Cidre
1b724a81a5
[#779] common.NodeManager removal 2018-03-28 17:39:09 +02:00
Alex Kohler
4a01a395b4 Move status-go over to go-ethereum/log #717 (#727) 2018-03-20 19:35:28 +01:00
Frank Mueller
dc4a0a98ed Fix setting of bootstrap nodes (#744)
Fix dropped bootstrap nodes setting and rename of cluster config and separation of nodes
2018-03-20 16:05:21 +02:00
Frank Mueller
8e42014671
Static peers are now also optionally configurable (#738)
* Rename bootnode to static peers

Also add some groupings between types.

* Remove not needed genesisHash

* More cleanup of bootnodes with static peers

* Add option of cluster configuration file

* New generated bindata.go

* Changes after npm install

* Add argument for cluster configuration file

* Add test for dynamic cluster loading

Not yet sure with name "cluster config".

* Solved conflicts

* Renaming of static peers

* Remove static peers population

* Missing argument for config

* Renaming of static peers to boot nodes for consistency

* Fix of name change

* Cluster config is now cluster data

* Load static nodes from configuration

* Final renaming of var for file content
2018-03-19 17:22:09 +01:00
Igor Mandrigin
aabbcbe522 Make DiscoveryV5 follow node config. 2018-03-08 19:40:45 +02: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
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
c06d58addd Remove notifications package from go-ethereum. 2018-02-22 11:10:21 +01:00
Dmitry Shulyak
b2580c79d7
Add destructive tests (#646)
Network disconnect is introduced by removing default gateway, easily reversible condition.

On my local machine it takes 30 seconds for peers to reconnect after connectivity is restored. As you guess this is not an accident, and there is 30 seconds timeout for dial expiration. This dial expiration is used in p2p.Server to guarantee that peers are not dialed too often.

Additionally I added small script to Makefile to run such tests in docker environment, usage example:

```
make docker-test ARGS="./t/destructive/ -v -network=4"
```
2018-02-19 17:32:58 +02:00
Alex Kohler
87b12ddced Remove DefaultMinimumPow patches in favor of using whisper config (#683) 2018-02-19 15:53:40 +01:00
Dmitry Shulyak
0b979c507d Fix async status api (#663) 2018-02-14 17:32:36 +01:00
Dmitry Shulyak
2d964bfe9f Remove async operations from node manager (#584)
The main goal of this change is to remove async operations from node manager.
Additionally all of the signals from node manager are moved to status backend.

All of the async operation now will have the following behaviour:
- If node in the correct state exit immediatly without error
- If node not in the correct state exit immediatly with error
- In all other cases spawn a goroutine with wanted operation
- All the progress regarding that operation will be reported
  by using signals
- Signals should be handled in once place, which is StatusBackend

There are 2 potentially breaking changes:
- Empty event field will be ommited when Envelope is sent to a client
- All errors will be delivered to a client as an Envelope, previously
  some errors (NodeExists, NoRunningNode) were delivered synchronously

Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-09 14:37:56 +01:00
Adam Babik
9885d74db0 Fix sync-and-exit option logic (#628)
* fix sync-and-exit logic

* fix reading from doneSync channel

* clean up

* make statusd before using it

* move syncAndStopNode to different file

* change log level in travis chain sync command

* do not use fmt but log

* add progress log and set timeout to 20 mins

* set datadir to .ethereumtest

* fix datadir
2018-02-08 10:51:53 +02:00
Caner Çıdam
ca719af71c Sync blockchain before running e2e tests on public testnet #568 (#612) 2018-02-07 11:48:03 +01:00
Sebastian Delgado
607954bfc3 Enforce type safety in NodeCrashEvent #602 (#607) 2018-02-05 11:37:59 +01:00
Denis Makogon
230e4febb1 Fixing test imports (#593) 2018-02-05 00:07:47 +01:00
Dmitry Shulyak
b41c4895fe Remove syncpool.go (#594) 2018-01-31 23:50:38 +01:00
Adam Babik
89d89681a3
Add support for metrics (#558)
It adds support for metrics (expvar and Prometheus) along with docker-compose files to run a Whisper test cluster.
2018-01-30 12:51:48 +01:00
Dmitry Shulyak
28a122f4aa Fix PeerCount lint warning 2018-01-25 12:16:59 +02:00
Dmitry Shulyak
889eeca31d Add a workaround for waiting till node is synced with network (#565) 2018-01-24 23:26:34 -08:00
Adam Babik
e214e1e270
Manage discovery from flags and refactor handling interrupt signals (#557) 2018-01-22 21:16:13 -08:00
Adam Babik
c153a60dc3
Clean up whisper log delivery (#555) 2018-01-19 15:53:16 +01:00
Ivan Daniluk
f93cd81d83
Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
Adam Babik
b7fb51d92a
Refactor shh_requestMessages method (#513) 2017-12-21 11:26:01 +01:00
Evgeny Danilenko
919ab285d3 add password for MailServer encryption (#494) 2017-12-07 17:58:11 +01:00
Evgeny Danilenko
596b7ea2e1 whisper standalone mode (#498) 2017-12-07 13:07:45 +01:00
Adam Babik
ac76e4731f
Prepare wnode-status to support MailServer (#477) 2017-12-04 17:11:14 +01:00
Adam Babik
086747a695 Refactor jail part 2 (#401)
Refactor jail so that it's more self-descriptive and easier to understand by newcomers. Also, the test coverage has been improved.

Changes requiring status-react team actions:
* Replace Parse calls with new CreateAndInitCell and ExecuteJS bindings,
* Make sure web3.isConnected is ok as its response change to boolean value.
2017-11-07 12:36:42 -05:00
Ewetumo Alexander
cb5ccb52c4 Emit messages logs for processing and sorting out messaging problems (#420)
* Add DeliveryService to Whisper to track incoming and outgoing messages.
* Have log tagged log lines for incoming and outgoing messages.
2017-11-06 14:10:52 -05:00
Adam Babik
8cbd7ed1c4 fix linter across the whole project 2017-10-26 12:20:16 +02:00
b00ris
e911666b5d Fix make lint warnings (#417)
fixed make lint warnings
cleared linter_exclude_list.txt
removed some commented code
fixed comments from #388
2017-10-20 12:06:22 +03:00
Ewetumo Alexander
2159711fa3 Refactoring/blockchain sync#246 (#271)
PR adds a new API changes to the NodeManager to provide simple methods to validate the completed synchonization of the blockchain.
2017-10-17 01:36:36 +03:00
Adam Babik
281b304edb Extract e2e tests to a separate package (#375)
This change moves our e2e tests into a separate package to make room for proper unit and integration tests.

This is Phase 1 described in #371.

Changes:

Makefile has separate directives to run unit/integration tests and e2e tests,
CI runs unit/integration tests first and then e2e tests,
E2e tests are in reliability order, i.e. the least reliable tests are run in the end to be sure that nothing else is broken,
Some tests are fixed or quarantined.
2017-10-11 17:20:51 +03:00
Adam Babik
90acfedf7a Rebase geth 1.7.0 (#353) 2017-10-10 12:38:49 +03:00
Adam Babik
ede939dd9e Remove LES activation when using upstream (#373) 2017-09-29 09:40:10 +02:00
Ivan Daniluk
9cc5fd2112 Move transaction queue code into separate package (#365) 2017-09-27 02:50:41 +02:00
Adam Babik
d625ddacfd Validate password in CompleteTransaction with remote node (#367) 2017-09-26 18:08:24 +02:00