-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal/ethapi: restore eth_protocolVersion method #22064
internal/ethapi: restore eth_protocolVersion method #22064
Conversation
restores the `eth_protocolVersion` RPC call which was broken due to a regression during the snap refactor.
So, for |
It returns the lowest |
Hm, I wonder if this is ever actually used... Something that would be more useful, IMO, would be Testing on an older rleease (
So it returns Since the next release is a big one, I would rather drop this method (and possibly add a |
@ryanschneider do you have any metrics from Infura about if the eth_protocolVersion is ever used? |
@holiman it is used, way more often than I would've expected to be honest, but it's not clear from the context what the user is trying to do with it. It seems like it's often used in conjunction with |
@holiman as mentioned on Discord it's also used by vipnode to determine the client type, so probably used by other packages for similar functionality: https://github.com/vipnode/vipnode/blob/c90952223f23198d2b6f1f9082f8dd09abd34cc8/ethnode/rpc.go#L133 |
But...what are they doing..?? protocol, err := strconv.ParseInt(protocolVersion, 0, 32)
if err != nil {
return nil, err
}
// FIXME: Can't find any docs on how this protocol value is supposed to be
// parsed, so just using anecdotal values for now.
if agent.Kind == Parity && protocol == 1 {
agent.IsFullNode = false
} else if agent.Kind == Geth && protocol == 10002 {
agent.IsFullNode = false
} They somehow try to tell whether it's a fullnode, based on the protocol version.. But I don't understand what I suspect: Whatever they're doing, they're doing it wrong |
Ya I agree it looks like it's somewhat experimental/exploratory code, but the main issue was that if the RPC failed then vipnode agent fails to start (I had to cherry pick this PR into my branch to get it to work again). I might try to PR a fix (I don't think Shazow is actively maintaining the project any more though), I'm mainly just mentioning it as a data point that people still use this RPC (for almost definitely incorrect reasons though ;) ). |
@holiman since this RPC is definitely being used my suggestion would be to follow the same general course as the This will give any consumers of this RPC time to refactor without any immediate breakage. |
This was not a regression, it was removed deliberately. The old API exposed the highest version of
I can't really fathom a single use case where this API call is useful for anything. |
Btw, originally the point of this API call was for ethstats client to be able to retrieve and publish the protocol running so that client devs can more easily see what other PoC clients are doing. This was useful pre-Olympic. |
I totally get that the RPC doesn't make sense, I'm just advocating for deprecating it and removing it rather than removing it in the same version that's a required upgrade for Berlin since it's unclear who's currently using it and what all removing it might unexpectedly break. |
https://blog.ethereum.org/2021/03/03/geth-v1-10-0/ > Note, the eth_protocolVersion API call is gone as it made no sense. If you have a very good reason as to why it’s needed, please reach out to discuss it. Though this is not listed in the release notes anywhere. Rel ethereum/go-ethereum#22064 ethereum/go-ethereum#22441 Date: 2021-03-23 13:29:18-05:00 Signed-off-by: meows <b5c6@protonmail.com>
|
restores the
eth_protocolVersion
RPC call which was broken due to a regressionduring the snap refactor.