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.
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.
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
* 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
* 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
- 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