diff --git a/CODEOWNERS b/CODEOWNERS index 3951b2d..90bb910 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,4 +2,4 @@ # later match takes precedence, they will be requested for review when someone # opens a pull request. -* @nomaxg @ImJeremyHe @sveitser +* @nomaxg @ImJeremyHe @sveitser @zacshowa @Sneh1999 diff --git a/light-client/light_client_reader.go b/light-client/light_client_reader.go index 4b2748c..00ec4f9 100644 --- a/light-client/light_client_reader.go +++ b/light-client/light_client_reader.go @@ -16,6 +16,7 @@ type LightClientReaderInterface interface { FetchMerkleRoot(hotShotHeight uint64, opts *bind.CallOpts) (types.BlockMerkleSnapshot, error) IsHotShotLive(delayThreshold uint64) (bool, error) + IsHotShotLiveAtHeight(height, delayThreshold uint64) (bool, error) } type LightClientReader struct { @@ -79,3 +80,13 @@ func (l *LightClientReader) IsHotShotLive(delayThreshold uint64) (bool, error) { } return !isDown, nil } + +func (l *LightClientReader) IsHotShotLiveAtHeight(h, delayThreshold uint64) (bool, error) { + threshold := new(big.Int).SetUint64(delayThreshold) + height := new(big.Int).SetUint64(h) + isDown, err := l.LightClient.LagOverEscapeHatchThreshold(&bind.CallOpts{}, height, threshold) + if err != nil { + return false, err + } + return !isDown, nil +}