ChainSafe / ChainSafe/lodestar
Do not extract roots for all gossip messages
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 483
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 150
Description
### Problem description
This is what happened if I don't extract roots for all messages (`te/minimal_exchange_gossipsub_message` branch)
on a holesky node subscribing to all subnets, this helped reduced max 0.4% of `gc` time
we extract roots of all possible messages, especially `beacon_attestation` for:
- if extracted root is known (skipped slot), we don't queue
- if extracted root is not known, queue messages by root then by slot
- actively search unknown gossip block by root
### Solution description
considering the gossip validation logic of `beacon_block`:
- it checks if proposer index is correct
- it checks if proposer signature is correct
- it checks if any blocks are known for the same proposer in the same slot
it's a guarantee we never have 2 blocks for the same slot passing through gossip validation
- still extract roots for some first messages of slot
- once gossip blocks are processed, no need to extract roots anymore
- for skipped slots, gossip block never comes, we'll keep extracting roots like the current flow
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.