Commit Graph

273 Commits

Author SHA1 Message Date
Igor Mandrigin 3b92b61ef1 Add API to listen to app state changes. 2018-03-15 12:48:22 +01:00
Frank Mueller 81c8669518
Code review for Mainnet (#706)
* Add debug log to test package t

* Add comments for test restrictions

* Add explicit errors for mainnet

* Panic instead of error in case of mainnet during tests

* Now panic with illegal network

* Validate the compiler flag for mainnet

* Made test for unset mainnet explicit

* Forgot to use my flag

* Linter has troubles with unused field

* Add default network id

In e2e tests there's no default anymore in go code. So ensure in Makefile.

* Fix dumb syntax error

* CI needs build with Mainnet

* Explicit rebuild only for tests

* No more separation of mainnet and testnet builds

* Build flags now set in Makefile
2018-03-15 12:36:28 +01:00
Andrea Franz a1da71e968
add entropyStrength type 2018-03-14 10:42:55 +01:00
Igor Mandrigin aabbcbe522 Make DiscoveryV5 follow node config. 2018-03-08 19:40:45 +02:00
Pedro Pombeiro 7aec65b976
Adapt unit tests with new static nodes (#722) 2018-03-02 18:44:55 +01:00
Pedro Pombeiro ec83efc26a
Add two Whisper v6 full nodes to `staticpeers.json` (#721) 2018-03-02 16:48:45 +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
Igor Mandrigin f7baca7835 Don't hide RPC error reason. 2018-02-27 12:10:48 +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
Adam Babik 0a15c9ff9a
Configure mainnet nodes (#701)
Add mainnet static peers to static/config/staticpeers.json.
2018-02-26 19:36:04 +01:00
Pedro Pombeiro eca5e04cc4
Replace `ping` notification payload with `You have a new message` 2018-02-26 18:17:42 +01:00
Pedro Pombeiro 134d01fcc1
Fix incorrect path in Makefile and run `make generate`. Part of #692 2018-02-22 12:19:31 +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
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
Igor Mandrigin b83666a90e Fix linter warnings for StatusBackend. (#675) 2018-02-16 15:58:13 +02:00
Ivan Danyliuk 716f1b1cb0 Fix comment 2018-02-16 13:02:41 +01:00
Ivan Danyliuk f78b79b49b Change default connection state to unknown 2018-02-16 13:02:41 +01:00
Ivan Danyliuk bc1c3e6337 Make linters happy 2018-02-16 13:02:41 +01:00
Ivan Danyliuk 4982e1b8b8 Add ConnectionChange API call to backend for handling network state changes 2018-02-16 13:02:41 +01:00
Alex Kohler 228bda9fb3 Remove //nolint: gas directives from fmt.Fprintf #590 (#656)
Summary:
Filter out gas linter error checks for fmt.Fprintf commands. This required defining a custom linter around gas that additionally included the offending code.

Notes:

Gas format, without piping it through gometalinter, gives output like this:

$ gas -fmt=csv geth/jail/console/console.go
geth/jail/console/console.go,21,Errors unhandled.,LOW,HIGH,"fmt.Fprintf(w, ""%s: %s"", consoleEventName, formatForConsole(fn.ArgumentList))"
Gometalinter, by default, does not grab the line of code when it filters gas errors. To resolve this, I created a wrapper around gas (I wasn't sure what to call this "gas wrapper", I opted for gasv2, open to other names).

The first part of the regular expression was taken directly from gometalinter (see https://github.com/alecthomas/gometalinter/blob/master/linters.go#L236), and I then appended ,\".*\" to additionally grab the line of code of the offending line. Lastly, I excluded ".*Errors unhandled.*fmt.Fprintf.*" to filter out only fmt.Fprintf errors around omitted errors.

Also as a result of this change, gas lint output will now include the offending code.

Closes #590
2018-02-14 19:58:20 +02:00
Dmitry Shulyak 0b979c507d Fix async status api (#663) 2018-02-14 17:32:36 +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
Pedro Pombeiro 8c3aa9a619
Fix a couple of lint warnings 2018-02-09 10:28:27 +01:00
Adrià Cidre 3c83c93039 Update jail README (#626) 2018-02-09 02:25:17 +02:00
Dmitry Shulyak 4cddc362ac
Fix all data races in jail package (#632)
* Rework how loop is stopped

* Use atomic int32 for DummyTask

* Close loop channel only once

* Rename closeChan to closedChan
2018-02-08 15:03:04 +02:00
Sebastian Klier 70912ab8f6 Group tests in a dedicated testing package (#629) 2018-02-08 13:52:47 +01:00
Azer Koçulu 5bea85fa9b Improve `fetch` tests in Cell (#627) 2018-02-08 12:41:07 +01:00
Adrià Cidre 00df3ff9f8 [#618] Jail.Call to return valid JSON string based results (#619) 2018-02-08 12:25:01 +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
Dmitry Shulyak d0ef64a177 Maintain local copy of the nonce for each used address (#538) 2018-02-08 00:23:57 +02:00
Caner Çıdam ca719af71c Sync blockchain before running e2e tests on public testnet #568 (#612) 2018-02-07 11:48:03 +01:00
Dmitry Shulyak ca5a8f6669 Enable ethereum metrics collection (#616) 2018-02-05 21:25:40 +02:00
Caner Çıdam 0dd47ab7bc Cover transaction manager with additional test cases #561 (#601) 2018-02-05 17:28:21 +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 653da5bcd0 Result of tx processing returned as QueuedTxResult
Currently it is quite easy to introduce concurrency issues while working
with transaction object. For example, race issue will exist every time
while transaction is processed in a separate goroutine and caller will
try to check for an error before event to Done channel is sent.

This change removes all the data that is updated on transaction and leaves
it with ID, Args and Context (which is not used at the moment).

Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>
2018-02-02 09:47:56 +02: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 ba0b20e53f Remove mocks for transaction manager and transaction queue
It is very unlikely that there will be 2 or more implementations
of tx manager and queue, as they are tailored specifically to status project
requirements.
2018-01-26 15:21:34 +01:00
Dmitry Shulyak 680d0513b7 Refactoring of TxQueue and Manager (#530) 2018-01-25 21:59:21 -08: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
Daniel Nephin 755a646bd4 Use gometalinter config instead of makefile (#560) 2018-01-24 00:25:28 -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
Dmitry Shulyak 0771e7d1b7 Use single codepath for sending transactions to a local and remote nodes (#527)
- new EthereumTransactor that provides higher level API for working with ethereum network, and it is fully conformant with ethclient
- new test rpc service that improves flexibility and coverage of txqueue manager tests
- run complete transaction sequantially for each address
- go-ethereum: Get pending nonce from transaction pool
- add a patch with getting nonce from transaction pool
2018-01-18 17:55:17 +01:00