Post
Topic
Board CPU/GPU Bitcoin mining hardware
Re: DiabloMiner GPU Miner (Long Poll, BFI_INT, and never fail async networking)
by
DiabloD3
on 11/07/2011, 11:15:46 UTC
Quote
ANY client that EVER uses GET for JSON RPC is wrong. Read the HTTP spec, GETs should never have message bodies. DiabloMiner follows the HTTP specification and uses POST for all requests.

You are correct regarding the HTTP spec, of course. The LP specification is rather ambiguous at this point. However, a GET would actually make sense when the reply is a JSON-RPC notification (id: null). Then the procedure would be like this:

  • The client does a simple GET on the LP URL, indicating its interest in "interruption" by notification
  • Once the network finds a new block, the server replies with the fresh hash, as if the client just issued a getwork request
  • The client aborts/discards the obsolete calculation and starts on the received fresh one - no need for a getwork on the main connection!
  • The client re-reisters for "interruption" by starting again with the first GET step.

Of course this is just my interpretation of the LP spec. But it seems that at least poclbm agrees with me, from a quick glance at the sources.

Anyway, thanks for this nice piece of software, keep up the good work!


The LP spec doesn't say "the LP request is not a JSON RPC request" explicitly. If it did, then, yes, I could get away with doing GET. Receiving a JSON RPC response is questionable at best in the case that this is true (although normal JSON over HTTP obviously is GETtable).

I don't particularly like the idea of mixing JSON RPC and non JSON RPC in the same protocol. If the LP spec says that you don't need to send a JSON RPC request, then the LP spec is wrong.