Commit Graph

713 Commits

Author SHA1 Message Date
Felix Lange b0d9f7372a internal/ethapi: add missing output fields
- returned headers didn't include mixHash
- returned transactions didn't include signature fields
- empty transaction input was returned as "", but should be "0x"
- returned receipts didn't include the bloom filter
- "root" in receipts was missing 0x prefix
2016-08-04 01:40:50 +02:00
Bas van Kervel 47ff813012 rpc: refactor subscriptions and filters 2016-08-17 12:59:58 +02:00
Felix Lange e32925397b rpc: add context argument to EthSubscribe
It's inconsistent not to pass it and most callers will
work with contexts anyway.
2016-08-05 20:48:33 +02:00
Felix Lange f5f042ffdc rpc: ensure client doesn't block for slow subscribers
I initially made the client block if the 100-element buffer was
exceeded. It turns out that this is inconvenient for simple uses of the
client which subscribe and perform calls on the same goroutine, e.g.

    client, _ := rpc.Dial(...)
    ch := make(chan int) // note: no buffer
    sub, _ := client.EthSubscribe(ch, "something")
    for event := range ch {
        client.Call(...)
    }

This innocent looking code will lock up if the server suddenly decides
to send 2000 notifications. In this case, the client's main loop won't
accept the call because it is trying to deliver a notification to ch.

The issue is kind of hard to explain in the docs and few people will
actually read them. Buffering is the simple option and works with close
to no overhead for subscribers that always listen.
2016-08-05 20:48:33 +02:00
Felix Lange 464660651d rpc: don't exceed context deadline while waiting for send lock 2016-08-05 13:27:02 +02:00
Felix Lange 91b7690428 rpc: add new client, use it everywhere
The new client implementation supports concurrent requests,
subscriptions and replaces the various ad hoc RPC clients
throughout go-ethereum.
2016-07-22 23:21:27 +02:00
Felix Lange bb01bea4e2 rpc: fix bad method error for batch requests
If a batch request contained an invalid method, the server would reply
with a non-batch error response. Fix this by tracking an error for each
batch element.
2016-07-22 23:21:27 +02:00
Felix Lange c145589f25 rpc: remove grace period when shutting down the server
The server delayed closing of connections for 3s when stopping. This was
supposed to allow for slow handlers, but it didn't really work. When
geth quits, it will just exit immediately after quitting the server.

Removing the timer makes testing easier because all connections will be
closed after Stop returns.
2016-07-22 23:21:27 +02:00
Felix Lange 74be4a62c5 Godeps, rpc: switch back to package npipe
The named pipe implementation from go-winio has some issues
that need to be addressed before we can use it again.
2016-07-14 23:03:40 +02:00
Fabio Berger a3efdb13f2 README, core, rpc: fix various typos 2016-06-21 17:38:35 +01:00
Péter Szilágyi ffaf58f0a9 cmd, console: split off the console into a reusable package 2016-05-30 17:25:23 +03:00
Péter Szilágyi bc6fdad786 cmd/geth, internal/web3ext, rpc: surface rpc module, fix shh, fix miner 2016-05-11 11:49:44 +03:00
Bas van Kervel 5479097790 rpc: HTTP origin case insensitive 2016-05-10 18:01:58 +02:00
Péter Szilágyi a6ca8fd268 Merge pull request #2463 from fjl/rpc-context-key
rpc: remove NotifierContextKey
2016-04-19 10:22:48 +03:00
Felix Lange a40e61b4ac rpc: remove NotifierContextKey
Context keys must have a unique type in order to prevent
any unintented clashes. The code used int(1) as key.

Fix it by implementing the pattern recommended by package context.
2016-04-15 18:10:52 +02:00
Felix Lange e728aaca72 rpc: move web3.js extensions to internal/web3ext 2016-04-15 17:36:01 +02:00
Felix Lange 6fdd0893c3 all: fix go vet warnings 2016-04-15 11:17:27 +02:00
Felix Lange d04a2e7557 all: update license information 2016-04-15 09:48:05 +02:00
Péter Szilágyi 53016c1225 eth, rpc: make trace configs optional 2016-04-14 15:10:29 +03:00
Felix Lange bea56d84e5 internal/debug: add memStats and gcStats to API 2016-04-13 12:08:07 +02:00
Felix Lange bcd8aeefdd eth: add chaindbProperty to debug API 2016-04-13 12:08:07 +02:00
Jeffrey Wilcke 8627680e24 Merge pull request #2359 from bas-vk/rpc-optional-args
rpc: several fixes and support for optional arguments
2016-04-12 14:03:21 +02:00
Bas van Kervel aa9fff3e68 rpc: various fixes/enhancements
rpc: be less restrictive on the request id
rpc: improved documentation
console: upgrade web3.js to version 0.16.0
rpc: cache http connections
rpc: rename wsDomains parameter to wsOrigins
2016-04-12 11:02:39 +02:00
Bas van Kervel 18490d833c console: use transaction output formatter for eth.pendingTransactions output 2016-04-06 11:27:05 +02:00
Jeffrey Wilcke 7e02105672 Merge pull request #2417 from fjl/rpc-go-winio
rpc: use go-winio instead of vendoring a named pipe implementation
2016-04-05 09:43:45 +02:00
Felix Lange 467bb7a719 rpc: use go-winio instead of vendoring a named pipe implementation 2016-04-04 13:56:17 +02:00
Bas van Kervel f7328c5ecb rpc: add pub/sub support 2016-04-01 18:26:35 +02:00
Jeffrey Wilcke 75c86f8646 Merge pull request #2141 from obscuren/evm-init
core, core/vm, tests: changed the initialisation behaviour of the EVM
2016-03-23 23:20:51 +01:00
Jeffrey Wilcke 3601320ccd eth, rpc: implemented block debugging rpc calls
Implemented the following block debugging RPC calls

* Block(RLP)
* BlockByFile(fileName)
* BlockByNumber(number)
* BlockByHash(hash)
2016-03-23 23:02:44 +01:00
Bas van Kervel a7bae3b2a6 rpc/http: improve request handling 2016-03-23 11:27:08 +01:00
Jeffrey Wilcke 41f35d7913 Merge pull request #2280 from bas-vk/js-cleanup
console: cleanup old autocompletations relics
2016-03-02 21:23:47 +01:00
Bas van Kervel 789b9a9f16 console: cleanup old autocompletations relics 2016-03-01 18:27:08 +01:00
Felix Lange e8e6df5159 rpc: simplify inproc client
Fixes #2277
2016-03-01 12:47:36 +01:00
Péter Szilágyi df75dbfd68 cmd, node, rpc: readd inproc RPC client, expose via node 2016-02-09 14:10:40 +02:00
Péter Szilágyi 900e124bee cmd, common, node, rpc: rework naming convention to canonical one 2016-02-09 13:24:42 +02:00
Péter Szilágyi 7486904b92 cmd, node, rpc: move websockets into node, break singleton 2016-02-05 16:53:47 +02:00
Péter Szilágyi a13bc9d7a1 cmd, common, node, rpc: move HTTP RPC into node, drop singletone aspect 2016-02-05 13:45:36 +02:00
Péter Szilágyi ba7c125153 Merge pull request #2168 from karalabe/move-rpc-into-node
cmd, common, node, rpc: move IPC into the node itself
2016-02-05 11:33:24 +02:00
Péter Szilágyi 6b939fbeaa rpc: add jsonrpc version to module request, use json types 2016-02-04 16:55:50 +02:00
Péter Szilágyi 188ab928c3 cmd, common, node, rpc: move IPC into the node itself 2016-02-04 11:23:15 +02:00
Jeffrey Wilcke 3274db19c7 Merge pull request #2169 from karalabe/fix-http-rpc-method
rpc: allow RPC requests on GET too
2016-02-03 23:34:36 +01:00
Péter Szilágyi 5da7ec7c18 cmd, eth, rpc: fix some RPC issues with pending blocks 2016-02-03 10:35:59 +02:00
Péter Szilágyi a8fd0de0d3 Merge pull request #2156 from ppratscher/add_replay_tx
core/vm, rpc/api: added debug_replayTransaction RPC call
2016-02-03 10:34:52 +02:00
Péter Szilágyi 72c255caef rpc: allow RPC requests on GET too 2016-02-03 00:50:02 +02:00
Peter Pratscher 15780ead07 core/vm, rpc/api: renamed to debug.replayTransaction, migrated to new RPC, integrated feedback
Integrated code review suggestions

Integrated last review comments
2016-02-02 15:20:18 +01:00
Péter Szilágyi d3642b0715 core, eth, rpc/api: rpc method to inspect the txpool queue 2016-02-01 14:58:14 +02:00
Felix Lange 3750d835a1 internal/debug: APIs for profiling and tracing
The debug package provides an RPC wrapper for glog settings and the
debugging facilities of the Go runtime. They can be triggered through
both command line flags and the IPC listener.
2016-01-28 13:36:11 +01:00
Felix Lange 5728dd381d rpc: fix success response encoding for null return value
The "result" field of JSON-RPC 2.0 responses was omitted
if the result was nil, causing exceptions in web3.js.
2016-01-27 00:06:37 +01:00
Bas van Kervel 19b2640e89 rpc: migrated the RPC insterface to a new reflection based RPC layer 2016-01-26 13:51:50 +01:00
Felix Lange f2ab351e8d Merge pull request #2136 from fjl/glog-prefix
logger/glog: improve vmodule
2016-01-25 23:35:25 +01:00