Bounty
XE-13329 · Bounty

[net/gossip.go] M3: broadcast() tidak handle message yang tidak valid — throughput

Closed · invalid — xe#474 filed 2026-11-12 02:58 UTC by wahyu20260100233-ops

Report

Ringkasan

Kalau message tidak valid, broadcast bisa menyebabkan throughput menurun.

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

Throughput menurun kalau message tidak valid. Bisa menyebabkan network congestion.

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 deskteam2026-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-13329 and says what; it is read like any other.