Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

eth.getBlock() returns author which is same as miner + difference between geth output vs parity #2401

Closed
gituser opened this issue Sep 29, 2016 · 3 comments
Labels
M4-core ⛓ Core client code / Rust. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.

Comments

@gituser
Copy link

gituser commented Sep 29, 2016

getBlocks from parity give additional field author which is equal miner field, what's the point of having it, maybe it's redundant it should be removed?

here is an example from Parity v1.3.1

> web3.eth.getBlock(1701979);
{
  author: "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
  difficulty: 49841077365596,
  extraData: "0x4477617266506f6f6c",
  gasLimit: 4712388,
  gasUsed: 210000,
  hash: "0x6f16dc80ef466c8b2b082a662a744376eecd213e3b70198ae5e8d4ff12b0f6cb",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
  number: 1701979,
  parentHash: "0x2bb558ca9b5c2abf6106b9871f9ae949e31038b5141825a82fae38e60cc2bed2",
  receiptsRoot: "0xe969268e2feb3bb11a3c5970b30ae4754846e2fdc5f9c82a891bcf6d2b82d342",
  sealFields: ["0x9a2c92fbd17b2622d9871018c361fa2e6ca1dedf2265b238cfdb3a34fceef55e", "0x79435c31c834545d"],
  sha3Uncles: "0x87d19a9d7a285402b57c6af1b3effe14ccd2de78a7f7f15cf4e4e4d7ca1926aa",
  size: 2204,
  stateRoot: "0x3d275995c27b3f5a4833336a182f466e2ad9c2ff5326220a9692cfed191252eb",
  timestamp: 1465898193,
  totalDifficulty: 27419632628096444269,
  transactions: ["0x064f74ac7f5c63df95d102b41b3af48d8edb7f32e627474c1beaa7c5e0a70a5a", "0xff098518a828d493b1423894392e0448a27bc1be815ac12d4df69656ebf135ab", "0xf72d4c80e18f50586a2b74e4e4cc07762d2360e0f5e92621d0419abf9828f650", "0x313b9a7fdee24f61aa5f790041f9a43573b8b52fb1b08e3538b9a3edbd1a86f1", "0xc98a77e0e54748892e0e8fe176ab3c9b477c87b33f585d6973af42284510b557", "0x719d87de0b4ae1d2dae178769b0b0326901c12e7d1417fcc744a2cab48cde3b3", "0x53b701be7e64d4904e830d4dbdd1da50a79b0dde1456dc3ac7da0eaa2bce9414", "0xa2dbe94dce82238d26efbd7cc51221309a86869f4196cab45bb5f74064d2ccec", "0x280a4dd930efee05d98eb946fb3c9b680c0d76b28cd364c9748f009a4d4b9dd8", "0x8cb0c71bf7e89427c77def3a14699bfcd233c9842d77eebeca8ad782083c6830"],
  transactionsRoot: "0x8c57c6c446be70426d7f1c72d2216004a94d6623812cb5c87f107750cb29f0f5",
  uncles: ["0x43a2171e14991d5feacd5be715f7497011fab39b56425445e0ed4a7ce0a22c93"]
}

also if you compare output from geth vs parity from getBlock, you'll notice few differences:

--- parity_getBlock 2016-09-29 11:52:35.165106137 +0300
+++ geth_getBlock   2016-09-29 11:52:55.349119227 +0300
@@ -1,5 +1,4 @@
 {
-  author: "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
   difficulty: 49841077365596,
   extraData: "0x4477617266506f6f6c",
   gasLimit: 4712388,
@@ -7,10 +6,10 @@
   hash: "0x6f16dc80ef466c8b2b082a662a744376eecd213e3b70198ae5e8d4ff12b0f6cb",
   logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
   miner: "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
+  nonce: "0x79435c31c834545d",
   number: 1701979,
   parentHash: "0x2bb558ca9b5c2abf6106b9871f9ae949e31038b5141825a82fae38e60cc2bed2",
-  receiptsRoot: "0xe969268e2feb3bb11a3c5970b30ae4754846e2fdc5f9c82a891bcf6d2b82d342",
-  sealFields: ["0x9a2c92fbd17b2622d9871018c361fa2e6ca1dedf2265b238cfdb3a34fceef55e", "0x79435c31c834545d"],
+  receiptRoot: "0xe969268e2feb3bb11a3c5970b30ae4754846e2fdc5f9c82a891bcf6d2b82d342",
   sha3Uncles: "0x87d19a9d7a285402b57c6af1b3effe14ccd2de78a7f7f15cf4e4e4d7ca1926aa",
   size: 2204,
   stateRoot: "0x3d275995c27b3f5a4833336a182f466e2ad9c2ff5326220a9692cfed191252eb",

(or view here http://pastebin.com/Zad3na9k)

I understand sealFields is a new propose from parity (ethereum/EIPs#95).

But what about difference between receiptRoot and receiptsRoot? Is there any way to make the same naming to avoid confusion and breaking external scripts?

Thanks

@tjayrush
Copy link

+1. We really do need consistent output from all clients.

@tomusdrw
Copy link
Collaborator

tomusdrw commented Oct 4, 2016

The spec says that the field name should be receiptsRoot: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash
and this is what Parity is returning (so I guess it should rather be a bug filed in Geth's repo).

Miner field's name is specific to PoW, since we are supporting other consensus mechanism we've decided to include more generic name author also (similar thing with nonce and sealFields). So miner is most probably left for backward compatibility.

@tomusdrw tomusdrw added Z1-question 🙋‍♀️ Issue is a question. Closer should answer. M4-core ⛓ Core client code / Rust. labels Oct 4, 2016
@gituser
Copy link
Author

gituser commented Oct 4, 2016

I guess this can be closed then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M4-core ⛓ Core client code / Rust. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.
Projects
None yet
Development

No branches or pull requests

3 participants