From 8f7bb719047e94786e0358e0b83d1ed69106531a Mon Sep 17 00:00:00 2001 From: Ian Suvak Date: Tue, 15 Oct 2024 14:40:12 -0400 Subject: [PATCH] add comment --- signature-aggregator/aggregator/proposer_height_cache.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/signature-aggregator/aggregator/proposer_height_cache.go b/signature-aggregator/aggregator/proposer_height_cache.go index b46ff48a..7911b18f 100644 --- a/signature-aggregator/aggregator/proposer_height_cache.go +++ b/signature-aggregator/aggregator/proposer_height_cache.go @@ -26,6 +26,11 @@ const ( maxHeightDifference = 30 ) +// ProposerHeightCache stores a list of recently accepted P-chain block heights and their blockTimes +// It exposes [GetOptimalHeight] method which returns the best guess for a proposerVM height of the P-chain +// that will result in a valid aggregated signature. +// ProposerVM currently uses the most recent block height outside of the 30 seconds lookback window. +// This struct reconstructs this value by querying for current height and block times for recent chain heights. type ProposerHeightCache struct { logger logging.Logger pChainClient validators.CanonicalValidatorClient