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

fix(miner): ignore lastWork when selecting the best mining candidate + tests #12659

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions chain/exchange/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ func (c *client) sendRequestToPeer(ctx context.Context, peer peer.ID, req *Reque

// AddPeer implements Client.AddPeer(). Refer to the godocs there.
func (c *client) AddPeer(p peer.ID) {
if p == c.host.ID() {
return
}
c.peerTracker.addPeer(p)
}

Expand Down
2 changes: 1 addition & 1 deletion miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ minerLoop:

// Check for slash filter conditions.
if os.Getenv("LOTUS_MINER_NO_SLASHFILTER") != "_yes_i_know_i_can_and_probably_will_lose_all_my_fil_and_power_" && !buildconstants.IsNearUpgrade(base.TipSet.Height(), buildconstants.UpgradeWatermelonFixHeight) {
witness, fault, err := m.sf.MinedBlock(ctx, b.Header, base.TipSet.Height()+base.NullRounds)
witness, fault, err := m.sf.MinedBlock(ctx, b.Header, base.TipSet.Height())
if err != nil {
log.Errorf("<!!> SLASH FILTER ERRORED: %s", err)
// Continue here, because it's _probably_ wiser to not submit this block
Expand Down
10 changes: 4 additions & 6 deletions node/hello/hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,11 @@ func (hs *Service) HandleStream(s inet.Stream) {
return
}

if ts.TipSet().Height() > 0 {
hs.h.ConnManager().TagPeer(s.Conn().RemotePeer(), "fcpeer", 10)
hs.h.ConnManager().TagPeer(s.Conn().RemotePeer(), "fcpeer", 10)

// don't bother informing about genesis
log.Debugf("Got new tipset through Hello: %s from %s", ts.Cids(), s.Conn().RemotePeer())
hs.syncer.InformNewHead(s.Conn().RemotePeer(), ts)
}
// don't bother informing about genesis
Copy link
Contributor

@Kubuxu Kubuxu Nov 8, 2024

Choose a reason for hiding this comment

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

Suggested change
// don't bother informing about genesis

log.Debugf("Got new tipset through Hello: %s from %s", ts.Cids(), s.Conn().RemotePeer())
hs.syncer.InformNewHead(s.Conn().RemotePeer(), ts)
}

func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
Expand Down
Loading