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

chore: refactor FinalizedChainInfo API #268

Merged
merged 8 commits into from
Jan 11, 2023

Conversation

SebastianElvis
Copy link
Member

This PR refactors the FinalizedChainInfo API in the following aspects:

  • Raw checkpoint, epoch metadata and BTC submission key become a part of proofs, and will be returned only when Prove is set to be true. This is because the oracle page does not need them if it does not verify the timestamp's correctness. We omit them to reduce the overhead of this API.
  • a new protobuf format ProofFinalizedChainInfo that contains everything needed for verifying a finalised chain info. This will be reused by the FinalizedChainInfoUntilHeight API.
  • some util functions in preparation for the standalone timestamp verifier implementation.
  • fixed a flaky test FuzzHeader

@SebastianElvis
Copy link
Member Author

Moved metadata (raw ckpt, epoch info, btc submission key) out from the proof as per an offline discussion with @vitsalis . These fields are useful for the frontend to display info relevant to the timestamps.

Copy link
Member

@vitsalis vitsalis left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the updates!

import "babylon/checkpointing/bls_key.proto";
import "babylon/checkpointing/query.proto";
import "babylon/checkpointing/checkpoint.proto";
import "babylon/epoching/v1/epoching.proto";
Copy link
Member

Choose a reason for hiding this comment

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

Do we need all those extra imports?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch. I have cleaned up dependencies in zoneconcierge.proto and query.proto. Too bad I cannot find a linter for protobuf things 😓

}

return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

Really like these methods 👏

@vitsalis
Copy link
Member

btw can we also update the swagger docs given that the proto files were upgraded.

@SebastianElvis SebastianElvis merged commit 9336994 into dev Jan 11, 2023
@SebastianElvis SebastianElvis deleted the zoneconcierge-api-timestamp-verifier branch January 11, 2023 23:26
KonradStaniec added a commit that referenced this pull request Jan 12, 2023
* zoneconcierge: API for querying the chain info of a given epoch (#260)

* zoneconcierge: API for querying headers in a given epoch (#261)

* zoneconcierge API: adding total number of timestamped headers to chainInfo (#263)

* zoneconcierge API: find the BTC-finalised chain info before specific CZ height (#264)

* zoneconcierge API: find header and fork headers at a given height (#266)

* checkpointing API: add checkpoint lifecycle in `RawCheckpointWithMeta` (#267)

* chore: refactor `FinalizedChainInfo` API (#268)

* Add integration test for zoneconcierge checkpointing (#269)

* Add integration test checking info about
opposing cz chain

* Fix: Increase gas in e2e test (#270)

Increase gas

* fix: checkpointing: Do not make the `home` flag a required one and unmarshall PubKey (#271)

* Fix build

Co-authored-by: Runchao Han <[email protected]>
Co-authored-by: Vitalis Salis <[email protected]>
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