Skip to content
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

Open
wants to merge 1 commit into
base: centauri-integration-ibc-v7-stable
Choose a base branch
from

Conversation

KonradStaniec
Copy link
Contributor

Hooks up picasso header decoding to babylon custom checkpointing logic

@@ -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)))
Copy link
Contributor Author

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 ?

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

Copy link
Contributor Author

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{

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 :)

Copy link
Contributor Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants