Consensys / quorum

A permissioned implementation of Ethereum supporting data privacy
https://www.goquorum.com/
GNU Lesser General Public License v3.0
4.69k stars 1.3k forks source link

please consider to return more standardized answers about consensus algorithms #505

Closed drandreaskrueger closed 6 years ago

drandreaskrueger commented 6 years ago

please standardize Quorum's answers about itself

the canonical way to report the consensus algorithm in geth is

admin_nodeInfo --> protocols --> eth --> 

so it's either

admin_nodeInfo --> protocols --> eth --> clique ...

or

admin_nodeInfo --> protocols --> eth --> ethash ...

See this answer here, from the geth core team.

However, quorum IBFT does not even have a

admin_nodeInfo --> protocols --> eth: 

!

But instead there is a

admin_nodeInfo --> protocols --> istanbul ...

please consider to return a more standardized answer

Thanks.


geth Clique (https://github.com/javahippie/geth-dev )

admin_nodeInfo:
{'enode': 'enode://a230bd65177cce0bbecce94fc8ce1efeafa6da29b43d75e1a15f45ca0fc5b26c286996bea82f07f482d21658974ea02bae8b83278ae36ce8745aaecafec68a7c@[::]:30303',
 'id': 'a230bd65177cce0bbecce94fc8ce1efeafa6da29b43d75e1a15f45ca0fc5b26c286996bea82f07f482d21658974ea02bae8b83278ae36ce8745aaecafec68a7c',
 'ip': '::',
 'listenAddr': '[::]:30303',
 'name': 'Geth/v1.8.14-stable-316fc7ec/linux-amd64/go1.10.3',
 'ports': {'discovery': 30303, 'listener': 30303},
 'protocols': {'eth': {'config': {'byzantiumBlock': 4,
                                  'chainId': 326432352,
                                  'clique': {'epoch': 30000, 'period': 2},
                                  'eip150Block': 2,
                                  'eip150Hash': '0x0000000000000000000000000000000000000000000000000000000000000000',
                                  'eip155Block': 3,
                                  'eip158Block': 3,
                                  'homesteadBlock': 1},
                       'difficulty': 43,
                       'genesis': '0xd1df9047a44cede4fcc7b7d39eed3f74dd5f148520515670cd0e9e2b5da50cfc',
                       'head': '0x4ffcc73dc894e5dc3f76f508ab39391ff35f69b81142d01423257f1f0a876409',
                       'network': 500}}}

geth PoW (geth --rpc --rpcapi "admin,eth,net,web3"):


admin_nodeInfo:
{'enode': 'enode://8492d7f5e629ea2612202b6ecad07161dbc862cd8f07df962e6c8bce6ae74e581f5e145c4db22aed5512a97e09c3d9e10b4011e5a6f0792d2c6e03e40cc4570b@[::]:30303',
 'id': '8492d7f5e629ea2612202b6ecad07161dbc862cd8f07df962e6c8bce6ae74e581f5e145c4db22aed5512a97e09c3d9e10b4011e5a6f0792d2c6e03e40cc4570b',
 'ip': '::',
 'listenAddr': '[::]:30303',
 'name': 'Geth/v1.8.14-unstable/linux-amd64/go1.10.3',
 'ports': {'discovery': 30303, 'listener': 30303},
 'protocols': {'eth': {'config': {'byzantiumBlock': 4370000,
                                  'chainId': 1,
                                  'daoForkBlock': 1920000,
                                  'daoForkSupport': True,
                                  'eip150Block': 2463000,
                                  'eip150Hash': '0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0',
                                  'eip155Block': 2675000,
                                  'eip158Block': 2675000,
                                  'ethash': {},
                                  'homesteadBlock': 1150000},
                       'difficulty': 17179869184,
                       'genesis': '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3',
                       'head': '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3',
                       'network': 1}}}

but

quorum (https://github.com/blk-io/crux/tree/master/docker/quorum-crux)

admin_nodeInfo:

{'enode': 'enode://5c3c98e3a28a87e73ab40468212de7ab6cf0e2afa77781295925f32369c00baf30f664e52f8d152c02b069d6daa1a61f477e3c1eca64403529dfbd0c31e09524@[::]:21000',
 'id': '5c3c98e3a28a87e73ab40468212de7ab6cf0e2afa77781295925f32369c00baf30f664e52f8d152c02b069d6daa1a61f477e3c1eca64403529dfbd0c31e09524',
 'ip': '::',
 'listenAddr': '[::]:21000',
 'name': 'Geth/v1.7.2-stable-d7e3ff5b/linux-amd64/go1.10.1',
 'ports': {'discovery': 21000, 'listener': 21000},
 'protocols': {'istanbul': {'difficulty': 1,
                            'genesis': '0x70de94b4fefd4ef07e2d32c5d94d53ae8b1dfe5fd395148e17ca4214965a4564',
                            'head': '0x70de94b4fefd4ef07e2d32c5d94d53ae8b1dfe5fd395148e17ca4214965a4564',
                            'network': 1}}}

as you have released a new version of quorum, I also tried that one - but sadly, same story:

quorum IBFT (https://github.com/jpmorganchase/quorum-examples --> istanbul-{init,start}.sh):

admin_nodeInfo:
{'enode': 'enode://0ba6b9f606a43a95edc6247cdb1c1e105145817be7bcafd6b2c0ba15d58145f0dc1a194f70ba73cd6f4cdd6864edc7687f311254c7555cc32e4d45aeb1b80416@[::]:21001?discport=0',
 'id': '0ba6b9f606a43a95edc6247cdb1c1e105145817be7bcafd6b2c0ba15d58145f0dc1a194f70ba73cd6f4cdd6864edc7687f311254c7555cc32e4d45aeb1b80416',
 'ip': '::',
 'listenAddr': '[::]:21001',
 'name': 'Geth/v1.7.2-stable-99a83767/linux-amd64/go1.9.3',
 'ports': {'discovery': 0, 'listener': 21001},
 'protocols': {'istanbul': {'difficulty': 1,
                            'genesis': '0x044430b915d25f0a227b461625e5afe1f303e1729d30c4e972f7505e03bc6c7e',
                            'head': '0x044430b915d25f0a227b461625e5afe1f303e1729d30c4e972f7505e03bc6c7e',
                            'network': 10}}}

and for RAFT ... quorum (https://github.com/jpmorganchase/quorum-examples --> raft-{init,start}.sh):

{'enode': 'enode://0ba6b9f606a43a95edc6247cdb1c1e105145817be7bcafd6b2c0ba15d58145f0dc1a194f70ba73cd6f4cdd6864edc7687f311254c7555cc32e4d45aeb1b80416@[::]:21001?discport=0',
 'id': '0ba6b9f606a43a95edc6247cdb1c1e105145817be7bcafd6b2c0ba15d58145f0dc1a194f70ba73cd6f4cdd6864edc7687f311254c7555cc32e4d45aeb1b80416',
 'ip': '::',
 'listenAddr': '[::]:21001',
 'name': 'Geth/v1.7.2-stable-99a83767/linux-amd64/go1.9.3',
 'ports': {'discovery': 0, 'listener': 21001},
 'protocols': {'eth': {'difficulty': 0,
                       'genesis': '0x6a6605601e17bbfbc0a199104a05f222d11da37fe2320c023394ff1e516243a2',
                       'head': '0x6a6605601e17bbfbc0a199104a05f222d11da37fe2320c023394ff1e516243a2',
                       'network': 10}}}

that is

(a) a bit more standardized, because it has protocols --> eth but then does not have a protocols --> eth -->raft`.

but

(b) unfortunately, your quorum-examples forgets to open the raft RPC api, so not even my code workaround cannot detect that it is running raft.

drandreaskrueger commented 6 years ago

additionally, in case of RAFT:

 'protocols': {'eth': {'difficulty': 0,
                       'genesis': '0x6a6605601e17bbfbc0a199104a05f222d11da37fe2320c023394ff1e516243a2',
                       'head': '0x6a6605601e17bbfbc0a199104a05f222d11da37fe2320c023394ff1e516243a2',
                       'network': 10}}}

it is missing information about the chainId.

Compare with geth:

 'protocols': {'eth': {'config': {''chainId': 1, ...

please add the chainId to the raft answer, thanks.

drandreaskrueger commented 6 years ago

I'd wish for more standardization in Ethereum ... https://github.com/paritytech/parity-ethereum/issues/9432

fixanoid commented 6 years ago

Like #507 EEA spec defines a lot more detail here. We'll be adding this soon.

fixanoid commented 6 years ago

Please see https://entethalliance.github.io/client-spec/spec.html#web3_clientcapabilities

drandreaskrueger commented 6 years ago

interesting, thanks.

But within your own ONE client, the answers are not coherent (raft vs IBFT) - so if I were you, I would start with fixing that, no?

fixanoid commented 6 years ago

@drandreaskrueger those are valid points and the imp details are what we are gonna comply via the spec. This is a pretty light implementation, so I think we may have it in the next release.

drandreaskrueger commented 6 years ago

Very nice, thanks.

Also consider creating EIPs, otherwise you likely diverge so much from geth and parity, that stuff stops to be compatible.