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.
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.
Refactor and clean up Jail package:
Removes account.Manager and txqueue.Manager from Jail as they are not used anymore
Removes messageID related code from Jail.Send
Simplifies Jail.Send to be a wrapper around RPC client's CallRaw
Renames jail_cell* to cell*
Related cleanups
Geth js commands coming through jail with a callback will now be executed truly asynchronously blocking jail only when an actual interaction with VM is performed.
Technically, it registers a new handler jeth.sendAsync which executes functions with callbacks asynchronously.
Changes include:
1. Send and SendAsync now use cell.VM instead of otto.Otto providing proper locking.
2. Unmarshalling in ExecuionPolicy.ExecuteWithClient is now done into var result interface{} instead of var result json.RawMessage because test case 0 of TestJailWhisper failed providing byte codes instead of 5.0.
3. Due to the asynchronous nature of web3 calls new weird timeouts in tests have been introduced. They may fail sometimes but I gave up trying to implement a more reliable and readable solution.
The goal of this PR is to make geth/api tests to finally pass from the beginning to the end. I tried to achieve it here by:
Removing calls to common.PanicAfter so that we know which tests fail the most,
Better sync of some tests using channels,
Small test improvements.
This PR refactors RPC subsystem for status-go:
cleans up two different RPC client implementations (RPCManager and rpc.Client)
creates new package under geth/rpc
moves routing logic into this package (rpc.(*router))
add tests for routing
cleans up NodeManager
Now all transactions in both cases are waiting for CompleteTransaction or DiscardTransaction to proceed independently from their destination: upstream of local
* 3. Removed extra `jail` prefix in the jail package
* Removed sendMessage and showSuggestions handlers because they're already set in registerHandlers()
* Remove extra asserts
* Changed assertions everywhere to testify
* Exposed JailCell.Call and removed Jail.Cell duplicate method
* Fixed review comments
IMPORTANT: The known issue is that in case of configured UpstreamRPCServer transactions are sent immediately not waiting for CompleteTransaction or DiscardTransaction which brings inconsistency in behaviour and acts as a security breach.
* new UpstreamRPConfig in geth/params to provide upstream configuration
* conditional start of ethereum blockchain sequence based on NodeConfig.UpstreamConfig.Enabled flag state
Added a lightweight logger wrapper around go-ethereum/log which adds StatusIM prefix to all messages and allows to clearly distinguish between status-go and go-ethereum logs.
Logs under vendor/go-ethereum left unchanged because those pieces of code might undergo huge refactoring in the near term.
* Fixed tests (only when they run one by one; they can still fail if run together)
* Fixed TestJailSendQueuedTransaction: the second command in case 4 was altering status.message_id and thus the test was failing. Earlier it had been working because cells were cloned during every Call
* Added a check into TestJailVMPersistence: now its concurrent-resiliency is asserted
* Fixed CallRPC: shh_version now return "5.0" instead of "0x5"
* Fixed TestWhisperFilterRace: there was changed Whisper API which should just be adhered to
* Fixed geth1.6.7 rebase consequences: primarily genesis blocks which now contain metropolishash
* static: updates Whisper test (to work with Geth 1.6.1)
* jail: VM persistence implemented
* jail: sendMessage/showSuggestions minor fixes (to be squashed)
* node: CHT and boot nodes auto-load implemented
* Replaced CHT data file from farazdagi's to tiabc's
* Rewrote config_test.go using testify having reduced it twice in size
* Increased SyncTime and panic timeout in tests
* Fixed test - remove go default test to testify/suite (#207)
* Add flag setup for RPCEnabled and add comment (#225)
* jail: register method handlers before running initial js in jail (#226)
* Console Jail Mod #179 (#228)
* Added ./statusd-data into .gitignore
* Increased log level for the test node from INFO to ERROR
* Add call to loop.Run to evaluate all setTimeout/setIntervals methods. (#208)
* Rebase onto geth1.6.7 (#232)
* Got back sync duration from 60s to 30s, updated bindata.go
* Commit initial change for settimeout/setinterval
* Add initial tests for jail setTimeout/setInterval
* Add ottoext dependency
* Add fetch jail test with function
* Add dependencies of fetch from ottoext
* Refactor with regards to PR review
* Refactor with regards to PR review
* Fix syntax errors
* Fix missing return statement
- node: signals and node reset, fixes#152
- tests update (testify is used)
- node manager refactored, race conditions fixed
- node wrapper has been removed, we rely on go-ethereum node now
- tx queue refactored
- jail refactored
- backend and API introduced