cmd/swarm, p2p, swarm: Enable ENR in binary/execadapter #19309
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains some preliminary changes to allow for using ENR to transmit the swarm overlay address between peers.
Currently, ENR is not being sent over the p2p handshake. The necessary changes for this to happen is pending an EIP submission (and approval, and implementation). This is described in this PR by @fjl which incidentally also contains a hack by him that provides a functional demonstration on how ENR record will be available through
PeerInfo
and on thep2p.Peer
object:#19220
In the meantime, the aim is to include the maximum amount of changes here that can be made towards the goal without relying on the implementation of the EIP. Some of the changes are cherry-picked from an experimental branch https://github.com/ethersphere/go-ethereum/tree/enr-bzz-poc building on the in the above mentioned PR.
In the experimental branch all handshake related code has been removed, and includes a temporary POC test
swarm/network/simulation/protocol_new_test.go:TestENR
that demonstrates a successfulWaitTillHealthy()
only using ENR.My proposed steps towards the basic but sound transition to handshake-free Swarm are:
BEFORE EIP
Preliminary changes in swarm/network and embed ENR in simulatioñ(done)AFTER EIP
swarm/network
swarm/network:BzzAddr
swarm/network:BzzPeer
andswarm/network:Peer
p2p/protocols
p2p/protocols
toswarm
package