Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions pkgs/node/src/chain.zig
Original file line number Diff line number Diff line change
Expand Up @@ -744,25 +744,16 @@ pub const BeamChain = struct {
}
};

if (self.is_aggregator_enabled) {
// Process validated attestation
self.onGossipAttestation(signed_attestation) catch |err| {
zeam_metrics.metrics.lean_attestations_invalid_total.incr(.{ .source = "gossip" }) catch {};
self.logger.err("attestation processing error: {any}", .{err});
return err;
};
self.logger.info("processed gossip attestation for slot={d} validator={d}{f}", .{
slot,
validator_id,
validator_node_name,
});
} else {
self.logger.debug("skipping gossip attestation import (not aggregator): subnet={d} slot={d} validator={d}", .{
signed_attestation.subnet_id,
slot,
validator_id,
});
}
self.onGossipAttestation(signed_attestation) catch |err| {
zeam_metrics.metrics.lean_attestations_invalid_total.incr(.{ .source = "gossip" }) catch {};
self.logger.err("attestation processing error: {any}", .{err});
return err;
};
self.logger.info("processed gossip attestation for slot={d} validator={d}{f}", .{
slot,
validator_id,
validator_node_name,
});
Comment on lines +752 to +756
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processed gossip attestation... is logged at info level for every successfully imported attestation. Now that all nodes will process gossip attestations (not just aggregators), this can dramatically increase log volume and I/O overhead in normal operation. Consider downgrading this to debug (or adding sampling / rate limiting) to keep info logs actionable.

Copilot uses AI. Check for mistakes.
zeam_metrics.metrics.lean_attestations_valid_total.incr(.{ .source = "gossip" }) catch {};
return .{};
Comment on lines +747 to 758
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters consensus-critical behavior: gossip attestations are now processed regardless of is_aggregator_enabled. There are existing tests for attestation validation/processing, but none exercise the onGossip(.attestation) path with is_aggregator_enabled=false to prevent regressions of the original bug. Please add a unit test that constructs a chain with ChainOpts.is_aggregator=false, feeds a valid GossipMessage.attestation through BeamChain.onGossip, and asserts forkchoice recorded the signature/vote.

Copilot uses AI. Check for mistakes.
},
Expand Down
Loading