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

Use recent trusted height and hash instead of hardcoding to the first block #78

Closed
ebuchman opened this issue Jul 4, 2024 · 0 comments · Fixed by #89
Closed

Use recent trusted height and hash instead of hardcoding to the first block #78

ebuchman opened this issue Jul 4, 2024 · 0 comments · Fixed by #89
Assignees
Labels
devx Issues related to improving dev experience / tooling
Milestone

Comments

@ebuchman
Copy link
Member

ebuchman commented Jul 4, 2024

Quartz initialization requires initializing a light client which requires a trusted height and hash. Currently we set the trusted height to 1 and fetch the corresponding hash. However if the chain is already more than a couple weeks old, this will be stale (outside the trusting period) and light client verification will fail. Dave just ran into this issues since our remote chain is now >2 weeks old.

Instead when we setup the light client we should fetch the most recent height and hash and use that instead.

The light client setup happens in the start.sh script

We currently do a silly thing where we try to get a proof for height 1 with a bogus hash, and then we let it print the correct hash. This is completely unnecessary. Instead we should just query the blockchain for the latest block, and get the latest hash from that.

The other thing we do is hardcode the height and hash in the manifest file: https://github.com/informalsystems/cycles-quartz/blob/main/apps/transfers/enclave/quartz.manifest.template#L24

And we use sed to overwrite the value of the hash: https://github.com/informalsystems/cycles-quartz/blob/main/apps/transfers/scripts/start.sh#L42

Instead we should figure out how to use variables in the manifest file, so we can just set those variables instead of having to use sed and overwrite things.

This is similar to what we want to do with passing in the port per #77

Currently to get things working Dave just hardcoded a new hash for himself, but we should do it properly. That will clean up the start.sh script, make sure we don't run into this problem again, and it will make it easier to build the quartz start command per #61

@ebuchman ebuchman added this to the Quartz Cleanup milestone Jul 5, 2024
@dangush dangush added the devx Issues related to improving dev experience / tooling label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devx Issues related to improving dev experience / tooling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants