-
Notifications
You must be signed in to change notification settings - Fork 175
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
Wire up grandpa decoder to babylon custom logic #360
base: centauri-integration-ibc-v7-stable
Are you sure you want to change the base?
Wire up grandpa decoder to babylon custom logic #360
Conversation
@@ -35,6 +39,25 @@ func GetHeaderInfo(ctx sdk.Context, m exported.ClientMessage) *HeaderInfo { | |||
ChaindId: msg.Header.ChainID, | |||
Height: uint64(msg.Header.Height), | |||
} | |||
case *ibcwasm.Header: | |||
// try to decode wasm.data as a picasso header | |||
gh, err := grandpa.DecodeHeader(grandpa.NewDecoder(bytes.NewReader(msg.Data))) |
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.
@blasrodri just to be sure, does ibcwasm.Header.Data
field contains only serialized picasso header or there is some other data here ?
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.
It only contains grandpa light-client header
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.
oh and how this header relates to the header parser that Eduardo implemented here - https://github.com/babylonchain/babylon/blob/centauri-integration-ibc-v7-stable/x/zoneconcierge/types/grandpa/header.go ?
return nil | ||
} | ||
|
||
return &HeaderInfo{ |
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.
don't you need any extra validation? Just asking, I'm totally new to 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.
it does not need more validation as it is called only in our modified UpdateClient
function after client message is already verified with VerifyClientMessage
and CheckForMisbehaviour
.
This function should probably be package private, but this just a detail :)
Hooks up picasso header decoding to babylon custom checkpointing logic