From a86c5000ef7a9d8f0e824de3e32756b287e232d2 Mon Sep 17 00:00:00 2001 From: ImJeremyHe Date: Fri, 2 Aug 2024 12:29:01 +0800 Subject: [PATCH 1/2] Fetch hotshot liveness with a given L1 height --- light-client/light_client_reader.go | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 +} From bf80828b72f5973d32d3b56d6991d5cfe0154fdb Mon Sep 17 00:00:00 2001 From: ImJeremyHe Date: Fri, 2 Aug 2024 13:07:04 +0800 Subject: [PATCH 2/2] Update CODEOWNERS --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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