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

cf-solana: add bank hash handling plus some refactoring #370

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

mina86
Copy link
Collaborator

@mina86 mina86 commented Aug 20, 2024

Firstly, add DeltaHashProof type which contains all the information that are needed to calculate delta hash. One piece of information in it is the accounts delta hash. As such, this struct together with a trusted bank hash acts as a proof for the accounts delta hash.

Secondly, create AccountHashData wrapper for the account_hash_data field of the AccountProof struct. This improves type safety and better encapsulates the account information used in hash calculation.

Lastly, fix a few instances where solana-program2 Cargo feature name was used instead of proper solana-program-2.

Firstly, add DeltaHashProof type which contains all the information that
are needed to calculate delta hash.  One piece of information in it is the
accounts delta hash.  As such, this struct together with a trusted bank
hash acts as a proof for the accounts delta hash.

Secondly, create AccountHashData wrapper for the account_hash_data field
of the AccountProof struct.  This improves type safety and better
encapsulates the account information used in hash calculation.

Lastly, fix a few instances where solana-program2 Cargo feature name was
used instead of proper solana-program-2.
@mina86 mina86 requested a review from dhruvja August 20, 2024 04:17
@dhruvja
Copy link
Collaborator

dhruvja commented Aug 20, 2024

we have to add solana-program-2 feature in cf-solana crate right? i can only see solana-program feature.
https://github.com/ComposableFi/emulated-light-client/blob/mpn/d/common/cf-solana/Cargo.toml#L30-L33

@mina86
Copy link
Collaborator Author

mina86 commented Aug 20, 2024

An optional dependency is implicitly a feature: https://github.com/ComposableFi/emulated-light-client/blob/mpn/d/common/cf-solana/Cargo.toml#L18

@dhruvja
Copy link
Collaborator

dhruvja commented Aug 21, 2024

An optional dependency is implicitly a feature: https://github.com/ComposableFi/emulated-light-client/blob/mpn/d/common/cf-solana/Cargo.toml#L18

oh i see. sounds good then.

@mina86 mina86 merged commit 9e8ebe6 into master Aug 21, 2024
4 checks passed
@mina86 mina86 deleted the mpn/d branch August 21, 2024 13:30
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