Commit Graph

835 Commits

Author SHA1 Message Date
Frank Mueller 30cf19e0ae
Wrong command order (#879) 2018-04-30 23:36:28 +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
Frank Mueller 92e02189c7
Add doc for shhext_requestMessages (#872) 2018-04-27 13:59:01 +02:00
Frank Mueller c85e0802eb
Remove mention of DevMode (#869)
* Remove mention of DevMode

* Remove prodMode
2018-04-26 19:59:57 +02:00
Andrea Franz 5f45f6498d
Add LogEnabled attribute to NodeConfig to, used in the call from status-react (#866)
* add LogEnabled attribute to NodeConfig, used in the call from status-react

* fix use of OverrideRootLogin in tests

* enable logger in tests based on LogLevel

* move LogEnabled before LogFile
2018-04-26 18:28:42 +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
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 f3e2631c1d
Add signals for notifying react about discovery activity (#859)
* Add signal for notifying react on discovery activity

* Whitelist expected signals in e2e tests
2018-04-25 10:13:59 +03: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
Alex Kohler 75471f2c27 #759 Codeclimate config (#843)
* Initial stab at CodeClimate configuration file

* Enabling everything to analyze usefulness of output

* Disabling some useless metrics

* Ignore static directory

* Disable similar code metric

* Exclude identical code in test files

* glob

* Reduce max file lines to 750

* Fix exclude pattern

* Exclude t/

* Up max file length + remove t directory

* Ignore t/ directory only for identical code metrics

* Exlcude patterns to exclude paths

* testing

* more testing

* reindent

* Revert back to excluding t directory
2018-04-23 15:55:21 +02:00
Adam Babik 0473f29a8a
Fix race conditions in tests (#857) 2018-04-23 15:35:48 +02:00
Adam Babik b85e50cbc9
Remove any logic from api.go [breaking-change] (#851)
Deprecated `Notify` binding got removed.
2018-04-23 15:34:49 +02:00
Adam Babik 5f075eeaba
Enable logs in tests (#852)
Pass `-log` option to `go test` in order to change the log level. By default, it's `INFO`.
2018-04-22 18:50:34 +02:00
Ivan Danyliuk 56292fb505 Make Limits type a struct 2018-04-21 00:03:40 +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
Adam Babik a45b05969a
Add a priority queue to TopicPool (#840) 2018-04-19 17:18:49 +02:00
Dmitry Shulyak fa526e7444 Prevent potential call on discv5 which became nil
It could happen when we found multiple relevant peers and they were
processed before discv5 closed. For example we have max limit of 1:
- found peer A and B in the same kademlia cycle
- process peer A
- max limit is reached -> closed discv5 and set it to nil
- process peer B
- panic!!!
2018-04-19 16:01:48 +03:00
Alex Kohler 6c9ec5b337 Fix 'make lint' not running megacheck inside travis (#821)
After running gometalinter in debug mode, it was found megacheck was being killed by travis due to reaching its memory limits. For more information, see this comment.

Run "Lint & Vendor Check" using a fully virtualized environment instead of a container-based one.
2018-04-19 11:58:34 +02:00
Igor Mandrigin f0f55d408f Make sure that only `personal_sign` and `personal_ecRecover` are exported. 2018-04-18 18:22:21 +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
Andrea Franz c32a82b88d
add file/stream log handlers to StatusNode (#833)
* add file/stream log handlers to StatusNode

* move log initialisation to the lib pkg used by react

* remove error check in log initialisation
2018-04-18 16:13:43 +02:00
Igor Mandrigin 19556554a6 Fix dataraces in e2e/transactions tests 2018-04-18 15:02:59 +02:00
Igor Mandrigin f3332cd7bb Fix data races in pending_requests_test.go 2018-04-18 10:12:01 +02:00
Igor Mandrigin f694a6d52b Fix a deadlock when timeout happens while a sign request is being approved. 2018-04-18 10:12:01 +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 2f5e75c33b
Improve Travis comments (#826) 2018-04-13 16:38:38 +02:00
Adrià Cidre e277ae8b2d
Mockgen import cycle not allowed && recover missing mockgens (#824) 2018-04-13 15:10:37 +02:00
Dmitry Shulyak 5014e4e3b0
Fix two race conditions in peerpool tests (#827)
Multiple concurrent topic pool stops could result in the close of the closed
quit channel. Fixed by using atomic compare and swap and closing only if swap
happened.

Added events feed to peer pool for tests purpose. Otherwise it is impossible to run
simulation with -race flag enabled. In the essence it happens because we are managing global
object , which is server.Discv5, but unfortunately there is no way around it.
2018-04-13 11:34:30 +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 a7a2e01b4a
Peerpool failover (#801) 2018-04-12 16:08:49 +03:00
Andrea Franz ecd9762648
remove redundant "if" before "return" statement (#823) 2018-04-12 12:26:25 +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 e6610f3b15
Fix lint on unused method (#816) 2018-04-10 16:00:01 +02:00
Dmitry Shulyak fc3decf661 Add tests for topic flags 2018-04-10 16:18:02 +03:00
Daniel Regeci e34af8d6eb Create status-go API to return a current revision (#804)
Change `BUILD_FLAGS` in Makefile and update `github.com/status-im/status-go/geth/params.VersionMeta` value with the current Git SHA.
2018-04-10 12:36:11 +02:00
Dmitry Shulyak 02309e81e9
Peer pool to manage v5 peers (#736) 2018-04-10 09:44:09 +03:00
Igor Mandrigin a9eb5a7d2b Generalize signing requests.
We need to be able to sign more than just transactions to make DApps
work properly. This change separates signing requests from the
transactions and make it more general to prepare to intoduce different
types of signing requests.

This change is designed to preserve status APIs, so it is
backward-comparible with the current API bindings.
2018-04-09 20:48:00 +02:00
Adam Babik f3e53441d9 update Gopkg.lock 2018-04-09 19:23:45 +02:00
Dmitry Shulyak b120587c9b Update bindata 2018-04-09 15:42:36 +02:00
Dmitry Shulyak b71b7eeadb Use web3code from separate repo and remove static 2018-04-09 15:42:36 +02:00
Adam Babik 32d71da046
fix linter in transactions_test.go (#811) 2018-04-09 14:14:02 +02:00
Dmitry Shulyak 4d00fa80b0 Ensure that To field is nil when contract is created 2018-04-09 14:41:50 +03:00
Dmitry Shulyak 38d7194a2a Use chain aware signer in simulated backend 2018-04-09 14:41:50 +03:00
Dmitry Shulyak 3f2e39d525 Update vendor because new geth modules were imported 2018-04-09 14:41:50 +03:00
Dmitry Shulyak ced8335600 Remove admin,debug,db api from exposed modules 2018-04-09 12:32:39 +03:00
Adrià Cidre df35ad6dbe
[#797] Unify EnsureSync on t/utils/utils.go and StatusManager (#806) 2018-04-09 09:16:43 +02:00