<!-- XE-13280 · [net/gossip.go] L9: rebroadcast() tidak rate-limit — potensi broadcast storm · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13280>. The page is the record; this is the same page for reading.*

XE-13280 · Bounty

# \[net/gossip.go\] L9: rebroadcast() tidak rate-limit — potensi broadcast storm

Closed · invalid
—
[xe#425](https://github.com/xeprotocol/xe/issues/425)
filed 2026-11-12 02:49 UTC
by wahyu20260100233-ops

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:51 UTC

Told
:   2026-11-20 00:49 UTC

### Patches

None linked.

### History

- [557297](https://bounty.xe.network/log/557297) 2026-11-20 00:49 UTC reply.mirrored
- [557060](https://bounty.xe.network/log/557060) 2026-11-20 00:48 UTC reply.sent
- [554051](https://bounty.xe.network/log/554051) 2026-11-20 00:35 UTC github.state\_pushed
- [554049](https://bounty.xe.network/log/554049) 2026-11-20 00:35 UTC github.labels
- [553333](https://bounty.xe.network/log/553333) 2026-11-20 00:33 UTC proposal.adopted
- [553126](https://bounty.xe.network/log/553126) 2026-11-20 00:33 UTC proposal.adopted
- [553125](https://bounty.xe.network/log/553125) 2026-11-20 00:33 UTC ticket.status new → closed
- [552568](https://bounty.xe.network/log/552568) 2026-11-20 00:33 UTC proposal.adopted
- [552567](https://bounty.xe.network/log/552567) 2026-11-20 00:33 UTC ticket.facts area
- [552563](https://bounty.xe.network/log/552563) 2026-11-20 00:33 UTC proposal.adopted
- [552562](https://bounty.xe.network/log/552562) 2026-11-20 00:33 UTC ticket.facts
- [551093](https://bounty.xe.network/log/551093) 2026-11-20 00:31 UTC note.added

[Full history](https://bounty.xe.network/log?ref=XE-13280) · [JSON](https://bounty.xe.network/v1/tickets/XE-13280) · [markdown](https://bounty.xe.network/XE-13280.md)

### Report

## Ringkasan

Tidak ada rate-limit pada `rebroadcast`. Kalau banyak goroutine panggil `rebroadcast` bersamaan, bisa terjadi broadcast storm.

## Lokasi

- File: `net/gossip.go`
- Lines: 189-203

## Kode

```
func (g *Gossip) rebroadcast(key string, msg []byte) {
    if g.rebroadcastMutex.TryLock() {
        defer g.rebroadcastMutex.Unlock()
        g.broadcast(key, msg, GossipUnicast)
        return
    }
    g.pendingRebroadcast.Add(1)
}
```

## Impact

Broadcast storm kalau banyak goroutine kompetisi. Network congestion, waste bandwidth.

## Suggested Fix

```
func (g *Gossip) rebroadcast(key string, msg []byte) {
    if g.rebroadcastMutex.TryLock() {
        defer g.rebroadcastMutex.Unlock()
        g.broadcast(key, msg, GossipUnicast)
        return
    }
    g.pendingRebroadcast.Add(1)
    // rate-limit: tunggu sebentar sebelum retry
    time.Sleep(time.Millisecond * 100)
    // atau gunakan rate limiter per key
}
```

Atau implement rate limiter per key:

```
type rateLimiter struct {
    mu    sync.Mutex
    last  map[string]time.Time
    limit time.Duration
}

func (rl *rateLimiter) allow(key string) bool {
    rl.mu.Lock()
    defer rl.mu.Unlock()
    now := time.Now()
    if t, ok := rl.last[key]; ok && now.Sub(t) < rl.limit {
        return false
    }
    rl.last[key] = now
    return true
}
```

### Thread

**XE desk**team2026-11-20 00:49 UTCgithub

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-13280 and says what; it is read like any other.
