I just spotted that Hermes deliberately updates its local BeaconStatus when it receives a ForkDigest different to the one specified.
Check method SetStatus() for more info:
if r.status != nil && !bytes.Equal(r.status.ForkDigest, status.ForkDigest) {
slog.Warn("reqresp status updated with different fork digests", "old", hex.EncodeToString(r.status.ForkDigest), "new", hex.EncodeToString(status.ForkDigest))
}
I'm unsure if this is a behaviour that we were looking for (I might be missing something here), but this would make the node set and advertise its ENR and subscribe to a specific ForkDigest and its topics, while then sharing a different one on the BeaconStatus RPC call.
Check example running Hermes with a local Prysm node in the Holesky network:
{"time":"2024-04-08T09:52:33.891074838+02:00","level":"WARN","msg":"reqresp status updated with different fork digests","old":"6a95a1a9","new":"69ae0e99"}
Far from ideal, this should heavily impact the connectivity with the connected nodes, as it is misleading for them, and they should drop any connection with a node that belongs to a different network.
Fix
We should ignore any status coming from a node in any other network or with a different ForkDigest:
// if the ForkDigest is not the same, we should drop updating the local status
// TODO: this might be re-checked for hardforks (make the client resilient to them)
if r.status != nil && !bytes.Equal(r.status.ForkDigest, status.ForkDigest) {
return
}
Description
I just spotted that Hermes deliberately updates its local
BeaconStatus
when it receives aForkDigest
different to the one specified. Check methodSetStatus()
for more info:I'm unsure if this is a behaviour that we were looking for (I might be missing something here), but this would make the node set and advertise its ENR and subscribe to a specific
ForkDigest
and its topics, while then sharing a different one on theBeaconStatus
RPC call.Check example running Hermes with a local Prysm node in the Holesky network:
causing:
Far from ideal, this should heavily impact the connectivity with the connected nodes, as it is misleading for them, and they should drop any connection with a node that belongs to a different network.
Fix
We should ignore any status coming from a node in any other network or with a different
ForkDigest
: