synechron-finlabs / quorum-maker

Utility to create and monitor Quorum nodes
Apache License 2.0
196 stars 97 forks source link

P2P NodeDatabase vs NetworkManagerContract #44

Closed vyarovoy closed 6 years ago

vyarovoy commented 6 years ago

Hi team,

Just curious why NetworkManagerContract was introduced instead of using what's exposed by quorum/node/api.go ?

Currently case is that on any peer connected to cluster it's possible to interact with NetworkManagerContract, execute its registerNode and add completely invalid peer (for example with public key = wqfqwf and enode id = wqfqwf).

Another outcome of using NetworkManagerContract right from start leads to fact p2p server is absolutely not aware of peers connected via smart contract.

Thanks in advance for understanding in case I missed pretty obvious reasons for this approach to be implemented.

dhyansraj commented 6 years ago

This contract is used for creating a Network Map Service. This is more of an application service rather than Quorum specific. In a larger application, multiple nodes may provide competitive services and clients can lookup to get details of the node including public key to send transaction.

Since Quorum is intended to be used in a persmissioned environment, any node trying to fake the details could be identified and punished. In a future release we would like to introduce an on-boarding service, that would further secure this updates to this contract.

Thanks for your question. Please feel free to discuss further.

vyarovoy commented 6 years ago

@dhyansraj ok, your aim is more less clear, current step could be considered as initial and small.

Just to clarify a bit more - this step is damaged currently. By damaged I mean complete absence of such NodeDB due to approach you enforce with current QM version - node API is not called in any way, means p2p server becomes aware of dynamically joined peer only when peer starts communications over whisper and constellation ports. Such live way of peer appearing doesn't match any of implemented ways node offers to add peer, nothing is reflected in NodeDB. Hence cluster consistence relies only on fact peer node did self-configuration via genesis and other params fetched from master when join happened.

dhyansraj commented 6 years ago

we still use raft.addPeer for adding new nodes. Contract is just for display purpose.