Skip to content

Commit 5abb762

Browse files
committed
update the comment for Prover::SetupHeadersForUpdate
Signed-off-by: Masanori Yoshida <masanori.yoshida@datachain.jp>
1 parent 14dd6a4 commit 5abb762

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/provers.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ type LightClient interface {
4949
CreateInitialLightClientState(ctx context.Context, height exported.Height) (exported.ClientState, exported.ConsensusState, error)
5050

5151
// SetupHeadersForUpdate returns the finalized header and any intermediate headers needed to apply it to the client on the counterpaty chain
52-
// The order of the returned header slice should be as: [<intermediate headers>..., <update header>]
53-
// if the header slice's length == 0 and err == nil, the relayer should skips the update-client
52+
// CONTRACT:
53+
// 1. The order of the returned header stream should be as: [<intermediate headers>..., <update header>]
54+
// 2. If the header stream's length == 0 and err == nil, the relayer should skips the update-client
55+
// 3. Goroutines that create the header stream should check `ctx.Done()` and should terminate processing if `ctx` is cancelled by the caller.
5456
SetupHeadersForUpdate(ctx context.Context, counterparty FinalityAwareChain, latestFinalizedHeader Header) (<-chan *HeaderOrError, error)
5557

5658
// CheckRefreshRequired returns if the on-chain light client needs to be updated.

0 commit comments

Comments
 (0)