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

zoneconcierge: adding header timestamp to IndexedHeader #387

Merged
merged 2 commits into from
May 25, 2023

Conversation

SebastianElvis
Copy link
Member

This PR adds the CZ header's timestamp to IndexedHeader. It's needed for phase 3 integration, namely notifying CZ to unbond mature validators before this timestamp.

// time is the timestamp of this header on CZ ledger
// it is needed for CZ to unbond all mature validators/delegations
// before this timestamp when this header is BTC-finalised
google.protobuf.Timestamp time = 4 [ (gogoproto.stdtime) = true ];
Copy link
Member

@vitsalis vitsalis May 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our own modified staking we only use the block and we retrieve time from there. Why do we need to add the time here? Can you provide an example of how this is going to be used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our own modified staking we only use the block and we retrieve time from there.

Yes this is because Babylon checkpoints itself to Bitcoin and has access to the epoch boundary header (including height and time).

Why do we need to add the time here? Can you provide an example of how this is going to be used?

The situation is a bit different in the CZ side (I realised this during developing Babylon contract). The ApplyMatureUnbonding function in CZ side needs to use both height and time, which can only come from BTC-finalised IndexedHeader. However, The IndexedHeader does not have time at the moment. The current Babylon contract uses time of the Babylon header that timestamps this CZ header, which is not accurate.

@SebastianElvis SebastianElvis merged commit af59704 into dev May 25, 2023
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.

2 participants