Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

swarm/pss: Remove spurious forwarding #1008

Closed
wants to merge 6 commits into from

Conversation

nolash
Copy link
Contributor

@nolash nolash commented Nov 20, 2018

fixes #995

This PR is a cleanup of the change in forwarding algorithm introduced by @zelig in #971

Previously, redundancy forwards would be made if the previous peer was among nearest neighbors or within the "dark radius" (proximity order within the bounds of the part of the address not disclosed). However, it would not check if the next peer actually was within these bounds.

Further progress pending other merges:

@@ -915,39 +943,42 @@ func (p *Pss) forward(msg *PssMsg) error {
}

// get the protocol peer from the forwarding peer cache
sendMsg := fmt.Sprintf("MSG TO %x FROM %x VIA %x", to, p.BaseAddr(), sp.Address())
p.fwdPoolMu.RLock()
pp := p.fwdPool[sp.Info().ID]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use already assigned local var sp.Info() -> info

// TODO: debug, remove in production
// calculate proximity from returned kademlia peer to destination and log it
powill, _ := p.Kademlia.Pof(sp.Address(), to, 0)
log.Debug("forward", "topic", label(msg.Payload.Topic[:]), "self", label(p.BaseAddr()), "to", label(sp.Address()), "dest", label(to), "po", ponow, "advance", powill-ponow)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if we need debug lines still

@zelig zelig mentioned this pull request Nov 29, 2018
20 tasks
@zelig
Copy link
Member

zelig commented Dec 4, 2018

obsoleted by #1043

@zelig zelig closed this Dec 4, 2018
@nolash nolash deleted the pss-forward-nospurioussends branch June 5, 2019 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix pss forwarding
8 participants