Skip to content

feat(p2p/sensor): validate block signer before rebroadcast#946

Draft
minhd-vu wants to merge 1 commit into
mainfrom
feat/sensor-validate-block-signer
Draft

feat(p2p/sensor): validate block signer before rebroadcast#946
minhd-vu wants to merge 1 commit into
mainfrom
feat/sensor-validate-block-signer

Conversation

@minhd-vu

@minhd-vu minhd-vu commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

When block rebroadcasting is enabled, the sensor now only rebroadcasts blocks whose recovered signer is in the current Heimdall validator set. Blocks from unknown signers are still persisted and their bodies are still requested; they are simply not propagated to peers.

  • Add ValidatorSet (p2p/validators.go): fetches /stake/validators-set from Heimdall, blocking initial load + periodic refresh, IsAuthorized.
  • Add Conns.IsKnownSigner to gate rebroadcast by recovered signer.
  • Gate handleNewBlock; defer block-hash rebroadcast from handleNewBlockHashes to handleBlockHeaders so the fetched header can be validated first (body requests stay ungated).
  • Consolidate util.Ecrecover to take *types.Header.
  • Add --heimdall-url and --validator-set-refresh sensor flags.

Jira / Linear Tickets

Testing

  • 👀
  • Deployed Amoy
  • Deployed Mainnet

When block rebroadcasting is enabled, the sensor now only rebroadcasts
blocks whose recovered signer is in the current Heimdall validator set.
Blocks from unknown signers are still persisted and their bodies are
still requested; they are simply not propagated to peers.

- Add ValidatorSet (p2p/validators.go): fetches /stake/validators-set
  from Heimdall, blocking initial load + periodic refresh, IsAuthorized.
- Add Conns.IsKnownSigner to gate rebroadcast by recovered signer.
- Gate handleNewBlock; defer block-hash rebroadcast from
  handleNewBlockHashes to handleBlockHeaders so the fetched header can
  be validated first (body requests stay ungated).
- Consolidate util.Ecrecover to take *types.Header.
- Add --heimdall-url and --validator-set-refresh sensor flags.
@minhd-vu minhd-vu force-pushed the feat/sensor-validate-block-signer branch from b028f73 to 60d7cc3 Compare June 29, 2026 20:38
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant