Commit Graph

81 Commits

Author SHA1 Message Date
Dmitry Shulyak 357786eeca Fix bloom filter expectations in group chat test
Every peer must be subscribed to the topic that is used to send messages.
In the test Alice was communicating with Bob and Charlie over custom topic, but
that topic wasn't added to a bloom filter, thus a certain flake was possible.

Normally it wasn't causing problems because syncAllowance in whisper, which is 10s:
- we set bloom filter to all zeros
- but we still will accept all envelopes for 10s
- in case we send first envelope into such channel after sync allowance - we will get an error such
that envelope doesn't match the bloom filter
2018-05-04 10:09:27 +03:00
Ivan Danyliuk 953c26e8cf
Move signal logic into signal package 2018-05-03 09:35:58 +02:00
Frank Mueller c85e0802eb
Remove mention of DevMode (#869)
* Remove mention of DevMode

* Remove prodMode
2018-04-26 19:59:57 +02:00
Frank Mueller b543d32a31
Move ssh_requestMessages to sshext_requestMessages (#862)
* Add RequestMessage to sshext

* E2E tests now use shhext_requestMessages

* Typo in comment

* Enhanced maintainability

* Drop former mailservice

* Code reorg after review

* Fix missed changes after update to 1.8.5
2018-04-26 07:56:19 +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
Adam Babik 07b2c3d750
Move concurrent backend test from e2e to unit (#849) 2018-04-20 17:39:53 +02:00
Frank Mueller 6598371dc0
Prepare tests for mainnet (#831)
* Start enabling to test Mainnet

* Minor corrections found during code scan

* Set mainnet blocker in E2E again

* Introduced securing of mainnet transaction tests

* Fix typing error

* Typo led to follow-up errors

* Linter problem

* Change to individual test skips after review

* More flexible skip control for mainnet and status chain

* Fix double space

* Change of skipping method and fixing wrong skipped networks
2018-04-18 17:13:27 +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
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
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
Adrià Cidre c76b2a0f62 [#757] : Split accounts and whisper tests (#763) 2018-03-28 10:24:55 +02:00
Evgeny Danienko 9ccd9b20e8
Merge branch 'develop' into issue/allow-messages-without-subscription-#766 2018-03-27 18:35:58 +03:00
Pedro Pombeiro c4d7a6167e
Add `race-check` target to Makefile. Closes #710 (#769)
* Add `race-check` and `test-unit-race` target to Makefile. Closes #710
2018-03-27 14:38:41 +02:00
Evgeny Danienko b9598a1a31
led comments to the standard 2018-03-26 20:05:24 +03:00
Evgeny Danienko a90be3c0de
fixes after code review 2018-03-26 19:54:27 +03:00
Evgeny Danienko aaf2b41e2e
test sending message without subscription 2018-03-26 19:02:02 +03:00
Adrià Cidre 18fbebc942
[#issue-403] Account package cleanup 2018-03-23 08:21:40 +01:00
Dmitry Shulyak a5cec358a9 Post whisper message asynchronously in tests
I am not 100% percent sure what is happening but it seems that
newMessageFilter is async operation, result of this operation is assumed
to be used in callbacks. All other tests are doing at least 1 io operation
in between creating a filter and posting a message, and it must be enough
for newMessageFilter to complete.

Setting higher GOMAXPROCS allows Otto vm to execute received io requests
immediatly. While lower number of processes may result in events re-ordering.

https://github.com/ethereum/web3.js/blob/develop/lib/web3/methods/shh.js#L39-L41

I tested this change with GOMAXPROCS=1 and it passes consistently.
2018-03-02 19:43:08 +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
Alex Kohler 5fbacb49e1 Remove GetObjectValue from JailCell interface #691 (#693) 2018-03-01 17:48: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
Pedro Pombeiro 2993dcc3db
Fix a couple race conditions in tests (#689)
* Fix race condition on `LoopSuite`
* Fix race condition in the access to a Otto.Value in tests (quick fix, need to improve approach in the future)
2018-02-21 13:18:32 +01:00
Adam Babik adbc7b5ae6 use s.Require() in Whisper tests 2018-02-14 10:45:29 +01:00
Alex Kohler 365bc662a2 Enable gometalinter on tests and fix static analysis issues #631 (#644)
* Enable gometalinter on tests and fix static analysis issues

* Remove unneeded change

* Fix additional lint errors

* Add nolint directives and error checks

* Add error assertions instead of nolint directives

* Go back to using lint directive for loop.Run goroutine

* Add error check to loop.Run
2018-02-12 13:16:06 +02: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
Sebastian Klier 70912ab8f6 Group tests in a dedicated testing package (#629) 2018-02-08 13:52:47 +01:00