getamis / go-ethereum

Official Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
34 stars 12 forks source link

`core.backlogs` potential memory leak with future messages #176

Closed trung closed 5 years ago

trung commented 6 years ago

In istanbul/core/backlog.go, backlog queue is retrieved from c.backglogs map: backlog := c.backlogs[src] and if no existing one found for the given src validator, new queue is created and added to c.backlogs. Tracing back reveals that the src validator is retrieved from c.valSet#GetByAddress() in istanbul/core/handler.go.

It seems there's an scenario that c.valSet changes. This causes c.backlogs keeping on growing.

Why does c.valSet change? and if it's by design, would the fix be to housekeep c.backlogs?