-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CheckRefreshRequired #12
Implement CheckRefreshRequired #12
Conversation
module/qbft.go
Outdated
@@ -82,7 +82,7 @@ func (cs *ConsensusState) ClientType() string { | |||
} | |||
|
|||
func (cs *ConsensusState) GetTimestamp() uint64 { | |||
panic("not implemented") | |||
return cs.Timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported::ConsensusState::GetTimestamp()
should return nanoseconds instead of seconds. ref. https://ibc.cosmos.network/v8/ibc/light-clients/consensus-state/#gettimestamp-method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing it out. I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIxed in 44369ab
module/prover.go
Outdated
if err := pr.chain.Codec().UnpackAny(resCons.ConsensusState, &cons); err != nil { | ||
return false, fmt.Errorf("failed to unpack Any into tendermint consensus state: %v", err) | ||
} | ||
lcLastTimestamp := time.Unix(int64(cons.GetTimestamp()), 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't forget to fix this line after fixing https://github.com/datachainlab/besu-ibc-relay-prover/pull/12/files#r1912604468
module/prover.go
Outdated
|
||
var cs exported.ClientState | ||
if err := pr.chain.Codec().UnpackAny(resCs.ClientState, &cs); err != nil { | ||
return false, fmt.Errorf("failed to unpack Any into tendermint client state: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/tendermint/besu/
module/prover.go
Outdated
|
||
var cons exported.ConsensusState | ||
if err := pr.chain.Codec().UnpackAny(resCons.ConsensusState, &cons); err != nil { | ||
return false, fmt.Errorf("failed to unpack Any into tendermint consensus state: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junichi-tanaka LGTM👍
Why
What
CheckRefreshRequired
like https://github.com/hyperledger-labs/yui-relayer/blob/f0347c7d61310d4f15d74173a5ea0a7eef32caf7/chains/tendermint/prover.go#L134QA
prepare QA
set the refresh threshold to 5minutes.
run test
check logs
I could see the relayer sent an
UpdateClients
message every 5minutes.I believe the first two lines are coming from
tx relay
andtx acks
.