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

solana-ibc: use solana height and timestamp for cf-guest host metadata #393

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dhruvja
Copy link
Collaborator

@dhruvja dhruvja commented Sep 7, 2024

since the cf-guest light client would exist on rollup, the host metadata is the solana slot and the timestamp instead of those fetched from the guest chain since the rollup wouldnt have it.

But if the connection is established to another svm where the guest chain is used, then the above should be reverted.

@dhruvja dhruvja requested a review from mina86 September 7, 2024 07:23
@mina86
Copy link
Collaborator

mina86 commented Sep 7, 2024

I think this needs to be conditional. If we’re running on Solana we have chain account and we use time from there. But if witness account is enabled, we don’t have chain account and then we read data directly from blockchain.

This also made me realise that in my WIP commit adding witness to solana-ibc it should also remove the chain account since that won’t be used on Rollup.

let timestamp_sec = clock.unix_timestamp as u64;

let timestamp =
ibc::Timestamp::from_nanoseconds(timestamp_sec * 10u64.pow(9))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ibc::Timestamp::from_nanoseconds(timestamp_sec * 10u64.pow(9))
ibc::Timestamp::from_nanoseconds(timestamp_sec * 10u64.ipow(9))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we would need num dependency if we wanna use ipow right?

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