-
Notifications
You must be signed in to change notification settings - Fork 170
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
zoneconcierge: add checkpoint info and epoch info to FinalizedChainInfo
API
#210
Conversation
FinalizedChainInfo
APIFinalizedChainInfo
API
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.
Looks good! In the explorer, do we want to show the height of the BTC header in which the first transaction of the checkpoint is included or the second one?
|
||
ctx := babylonChain.GetContext() | ||
czChainID := string(datagen.GenRandomByteArray(10)) |
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.
What's the expected size of the chain id? We can have this a random string in the range of [1,50] for example.
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.
Normally ~10bytes. Randomised the length then.
err := fmt.Errorf("finalized epoch %d should have at least 1 checkpoint submission", finalizedEpoch) | ||
panic(err) | ||
} | ||
bestSubmissionKey := ed.Key[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.
just fyi without #204, this will not necessarily return best submission key (i.e the deepest one) but it will return the submission which was first subbmitted to babylon. (cc @SebastianElvis )
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.
Yep. I merged this PR due to the time constraint. Will simplify this part based on #204 in the future 👍
Resolves https://babylon-chain.atlassian.net/wiki/spaces/BABYLON/pages/41549900/Simple+Oracle+Page+for+Demo+Purpose?focusedCommentId=41910291
This PR adds the information of the checkpoint/epoch w.r.t. the finalised header to
FinalizedChainInfo
. The checkpoint information is in typeSubmissionKey
that provides the positions of two BTC txs and is implemented in BTCCheckpoint module. The epoch information is in typeEpoch
and is implemented in Epoching module.Along the way, this PR also changes the order of initialising keepers in
app.go
and adds some mocking functionality for testing ZoneConcierge.@KonradStaniec Do you think #204 will be useful for this PR?