<!-- XE-13337 · [net/gossip.go] L1: broadcast() tidak handle message yang tidak valid — code quality · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13337>. The page is the record; this is the same page for reading.*

XE-13337 · Bounty

# \[net/gossip.go\] L1: broadcast() tidak handle message yang tidak valid — code quality

Closed · invalid
—
[xe#482](https://github.com/xeprotocol/xe/issues/482)
filed 2026-11-12 02:59 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:50 UTC

### Patches

None linked.

### History

- [559459](https://bounty.xe.network/log/559459) 2026-11-20 00:50 UTC reply.mirrored
- [558542](https://bounty.xe.network/log/558542) 2026-11-20 00:49 UTC reply.sent
- [554103](https://bounty.xe.network/log/554103) 2026-11-20 00:36 UTC github.state\_pushed
- [554102](https://bounty.xe.network/log/554102) 2026-11-20 00:36 UTC github.labels
- [553394](https://bounty.xe.network/log/553394) 2026-11-20 00:33 UTC proposal.adopted
- [553237](https://bounty.xe.network/log/553237) 2026-11-20 00:33 UTC proposal.adopted
- [553236](https://bounty.xe.network/log/553236) 2026-11-20 00:33 UTC ticket.status new → closed
- [552948](https://bounty.xe.network/log/552948) 2026-11-20 00:33 UTC proposal.adopted
- [552947](https://bounty.xe.network/log/552947) 2026-11-20 00:33 UTC ticket.facts area
- [552946](https://bounty.xe.network/log/552946) 2026-11-20 00:33 UTC proposal.adopted
- [552945](https://bounty.xe.network/log/552945) 2026-11-20 00:33 UTC ticket.facts
- [550227](https://bounty.xe.network/log/550227) 2026-11-20 00:28 UTC note.added

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

### Report

## Ringkasan

Kalau message tidak valid, broadcast bisa menyebabkan code quality issues.

## Lokasi

- File: `net/gossip.go`
- Lines: 171-187

## Kode

```
func (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {
    ...
    for _, pid := range peers {
        go g.sendToPeer(pid, key, msg)
    }
}
```

## Impact

Code quality issues kalau message tidak valid. Bisa menyebabkan code sulit dibaca.

## Suggested Fix

```
func (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {
    ...
    // validasi message sebelum broadcast
    if !g.isValidMessage(msg) {
        logging.Warnf("gossip: invalid message, not broadcasting")
        return
    }

    for _, pid := range peers {
        go g.sendToPeer(pid, key, msg)
    }
}

func (g *Gossip) isValidMessage(msg []byte) bool {
    // validasi message
    if len(msg) == 0 {
        return false
    }
    // dll
    return true
}
```

### Thread

**XE desk**team2026-11-20 00:50 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-13337 and says what; it is read like any other.
