ethereumproject / go-ethereum

Go language implementation of the original/classic design of the Ethereum protocol
GNU Lesser General Public License v3.0
441 stars 166 forks source link

Feature request: Submit Block RPC #719

Closed BelfordZ closed 5 years ago

BelfordZ commented 5 years ago

New JSON-RPC method submitBlock

Purpose

I would like to be able to submitWork, but have the address used be one other than the etherbase of the node the work is being submitted by.

This would allow signing of new blocks to occur outside of the client, similar to sendRawTransaction allows you to externally sign a tx.

Proposed solution

Named as per @sorpaas suggestion, perhaps this could be done as a submitBlock. It would look as follows: image

Here is an OpenRPC describing the method doc if you want to play with it.

{
  "openrpc": "1.1.8",
  "info": {
    "version": "1.0.0",
    "title": "Example submitBlock"
  },
  "methods": [
    {
      "name": "parity_submitBlock",
      "summary": "Submit a new block proposal",
      "description": "Given a new block, it will validate the block, and broadcast it to connected peers.",
      "params": [
        { "$ref": "https://raw.githubusercontent.com/etclabscore/ethereum-json-rpc-specification/master/openrpc.json#/components/contentDescriptors/Block" }
      ],
      "result": {
        "name": "isBlockAccepted",
        "schema": {
          "type": "boolean"
        }
      }
    }
  ],
  "components": {
    "schemas": {
      "OpenRPCDocument": {
        "title": "OpenRPC Document",
        "description": "an open rpc document as defined by https://spec.open-rpc.org."
      }
    }
  }
}
soc1c commented 5 years ago

Moved to https://github.com/etclabscore/go-ethereum/issues/24