Skip to content

Add frequent node logging: attestations, blocks, justified/finalized, peers#431

Closed
ch4r10t33r wants to merge 10 commits intoleanEthereum:mainfrom
ch4r10t33r:main
Closed

Add frequent node logging: attestations, blocks, justified/finalized, peers#431
ch4r10t33r wants to merge 10 commits intoleanEthereum:mainfrom
ch4r10t33r:main

Conversation

@ch4r10t33r
Copy link
Collaborator

Adds observability logging to the leanSpec node:

  • Blocks: INFO when a block is received (peer, slot) and when processed (slot, root, peer)
  • Attestations: INFO when received (peer, slot, validator); INFO on validation/signature success, WARNING on failure
  • Aggregated attestations: Same pattern with optional peer_id
  • Periodic status (every 10s): Peers count, justified slot/root, finalized slot/root

Sync service accepts optional peer_id on on_gossip_attestation and on_gossip_aggregated_attestation; network service passes peer_id from gossip events so logs show the propagating peer.

ch4r10t33r and others added 10 commits February 6, 2026 15:05
Introduces a new --is-aggregator command-line parameter that enables
aggregator mode for consensus nodes. When enabled, the node performs
attestation aggregation operations and advertises this capability in
its ENR.

Changes:
- Add is_aggregator field to NodeConfig with default value False
- Add IS_AGGREGATOR ENR key constant for peer discovery
- Add is_aggregator property to ENR class for reading aggregator flag
- Add is_aggregator field to NetworkService for ENR advertisement
- Add --is-aggregator CLI argument with help text
- Thread flag through initialization paths (genesis and checkpoint sync)
- Add logging when aggregator mode is enabled

Usage:
  python -m lean_spec --genesis config.yaml --is-aggregator

The flag defaults to False, maintaining backward compatibility with
existing deployments. When True, the node's ENR will include the
is_aggregator key, allowing peers to discover aggregator nodes.
- Build image for linux/amd64 and linux/arm64 on every PR and push to main
- Publish ghcr.io/leanethereum/leanspec-node:latest only on merge to main
Avoid transient failures when uv fetches python-build-standalone
(HTTP/2 stream errors). Use Actions tool-cache Python instead.
… peers

- Sync: log block received/processed with peer and slot; log attestation and
  aggregated attestation with peer, slot, validator and validation/signature result
- Sync: optional peer_id on on_gossip_attestation and on_gossip_aggregated_attestation
- Network: pass peer_id from gossip events to sync handlers
- Node: periodic (10s) log of justified slot, finalized slot, and connected peers count
@ch4r10t33r
Copy link
Collaborator Author

Superseded by #432 (same changes, branch contains only the logging commits).

@ch4r10t33r ch4r10t33r closed this Mar 2, 2026
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