go-ethereum/eth/txtracker
Csaba Kiraly f24161de71 eth/txtracker: replace cumulative Finalized with slow RecentFinalized EMA
The total-finalized protection category ranked peers by a monotonic
cumulative count, so a peer that had been productive in the past kept
a high score forever — even if they had since gone silent — and held
a protected slot without contributing.

Replace txtracker.PeerStats.Finalized (int64 cumulative) with
RecentFinalized (float64 EMA). On each chain head, finalization
credits accumulated over the newly-finalized range are folded into a
slow EMA (alpha=0.0001, half-life ~6930 blocks ≈ 23 hours on 12s
mainnet blocks). Peers that continue contributing keep a high score;
peers that stop decay toward zero over roughly a day.

The dropper category renames to "recent-finalized" accordingly. The
type's docstring is rewritten to describe both categories as EMAs
with different time horizons (slow finalized, fast included).

Refactors checkFinalization to return a per-peer credits map rather
than mutating state directly, so both EMAs update in the same loop
over tracked peers.
2026-04-19 12:14:23 +02:00
..
tracker.go eth/txtracker: replace cumulative Finalized with slow RecentFinalized EMA 2026-04-19 12:14:23 +02:00
tracker_test.go eth/txtracker: replace cumulative Finalized with slow RecentFinalized EMA 2026-04-19 12:14:23 +02:00