Skip to content
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

p2p/discover: RLP encode/decode loses discovery-port information #815

Closed
karalabe opened this issue Apr 27, 2015 · 1 comment
Closed

p2p/discover: RLP encode/decode loses discovery-port information #815

karalabe opened this issue Apr 27, 2015 · 1 comment
Milestone

Comments

@karalabe
Copy link
Member

Currently the RLP encoder drops the Node.DiscPort field, and during decoding it injects the TCPPort into the DiscPort: https://github.com/ethereum/go-ethereum/blob/develop/p2p/discover/node.go#L125

It should be a trivial fix (Go side), but I don't know if simply refactoring rpcNode has outside effects too, like screwing up the discovery protocol wire format, or only touches the udp packet. @fjl Any input on this?

@karalabe karalabe added this to the Frontier milestone Apr 27, 2015
@fjl
Copy link
Contributor

fjl commented Apr 27, 2015

Not a bug. The v3 protocol doesn't carry two ports. Protocol v4 will, see #743.

@fjl fjl closed this as completed Apr 27, 2015
@fjl fjl removed the type:bug label Apr 27, 2015
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Jun 9, 2023
e699254 caused the iota assigned values of LvlCrit through LvlTrace to change from 0 to 5 to 1 to 6. (ethereum#815)

This restores the original enumerated const values by moving LvlDiscard after all the iota assigned constants.
Usage of auto-increment enumerations does not work the same way in golang as it does in C/C++ and its behaviour is detailed in the link below.
https://go.dev/ref/spec#Iota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants