Open frozeman opened 7 years ago
cc @tomusdrw @jacogr
net_version
is returning Network Id in Parity and Geth (not sure about other clients).
https://github.com/ethcore/parity/blob/master/rpc/src/v1/impls/net.rs#L39
https://github.com/ethereum/go-ethereum/blob/3885907c7deb598ed491ca4deccc562b27b31d66/eth/api.go#L1952 https://github.com/ethereum/go-ethereum/blob/fed692f67e81bd3937a5efab38f56a9b99d04d41/eth/backend.go#L210
Maybe we should just update the spec or rename the method?
It looks like parity and geth are not following the spec and both return the network id instead of the network protocol version.
I would suggest:
HEXNUM
instead of a string. Maybe instead of a single version a min and max supported version.net_id
that returns the network id as HEXNUM
I guess the reason for this is that there is already eth_protocolVersion
that returns current protocol version. This is why I suggested to rename the method (or update spec).
If we are going to update this method I suggest it should return id and also latest fork block hash (or at least number) to distinguish possible forks (ETH vs ETC).
I'd prefer a non breaking migration path. If we change net_version to net_id, add the new method some period of time before deprecating the old method.
Otherwise, I think updating the spec is a decent immediate step.
Making the network id accessible on the RPC will allow dapps to know on which network they are right now.
We would need that in mist to know the difference between networks and store accounts accordingly.
@bas-vk @debris @chriseth