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

swarm, p2p: Prerequities for ENR replacing handshake #19275

Merged
merged 8 commits into from
Mar 15, 2019

Conversation

nolash
Copy link
Contributor

@nolash nolash commented Mar 15, 2019

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 the p2p.Peerobject:

#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 successful WaitTillHealthy() only using ENR.


My proposed steps towards the basic but sound transition to handshake-free Swarm are:

BEFORE EIP

  1. Preliminary changes in swarm/network and embed ENR in simulation (this PR)
  2. Embed ENR in binary

AFTER EIP

  1. Remove handshake from swarm/network
  2. Eliminate swarm/network:BzzAddr
  3. Merge swarm/network:BzzPeer and swarm/network:Peer
  4. Remove handshake from p2p/protocols
  5. Move p2p/protocols to swarm package

swarm/network/enr.go Outdated Show resolved Hide resolved
@zelig zelig merged commit 4b4f03c into ethereum:master Mar 15, 2019
kiku-jw pushed a commit to kiku-jw/go-ethereum that referenced this pull request Mar 29, 2019
* swarm/api, swarm/network, p2p/simulations: Prerequisites for handshake remove

* swarm, p2p: Add full sim node configs for protocoltester

* swarm/network: Make stream package pass tests

* swarm/network: Extract peer and addr types out of protocol file

* p2p, swarm: Make p2p/protocols tests pass + rename types.go

* swarm/network: Deactivate ExecAdapter test until binary ENR prep

* swarm/api: Remove comments

* swarm/network: Uncomment bootnode record load
nonsense referenced this pull request in ethersphere/swarm May 8, 2019
* swarm/api, swarm/network, p2p/simulations: Prerequisites for handshake remove

* swarm, p2p: Add full sim node configs for protocoltester

* swarm/network: Make stream package pass tests

* swarm/network: Extract peer and addr types out of protocol file

* p2p, swarm: Make p2p/protocols tests pass + rename types.go

* swarm/network: Deactivate ExecAdapter test until binary ENR prep

* swarm/api: Remove comments

* swarm/network: Uncomment bootnode record load
@nolash nolash deleted the enr-bzz-preparations branch June 5, 2019 14:22
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

Successfully merging this pull request may close these issues.

3 participants