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: store and read commitments from the trie #74

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

mina86
Copy link
Collaborator

@mina86 mina86 commented Nov 1, 2023

Firstly, since packet and ack commitments are 32-byte long hashes,
store them directly in the provable trie rather than storing their
hash.

Secondly, implement retrieval of the commitments properly. Rather
than trying to interpret sequences as commitment, read the hashes from
the provable storage.

Lastly, get rid of sequence_sets maps in the private store which don’t
serve any actual purpose.

Firstly, since packet and ack commitments are 32-byte long hashes,
store them directly in the provable trie rather than storing their
hash.

Secondly, implement retrieval of the commitments properly.  Rather
than trying to interpret sequences as commitment, read the hashes
from the provable storage.

Lastly, get rid of sequence_sets maps in the private store which don’t
serve any actual purpose.
@mina86 mina86 requested a review from dhruvja November 1, 2023 16:07
@mina86 mina86 enabled auto-merge (squash) November 1, 2023 16:08
@dhruvja
Copy link
Collaborator

dhruvja commented Nov 2, 2023

I think we would also need to store the packet commitments and acks. Something like this for the moment

pub packet_commitments: BTreeMap<(PortId, ChannelId, Sequence), Vec<u8>>,
pub packet_acks: BTreeMap<(PortId, ChannelId, Sequence), Vec<u8>>,

@mina86
Copy link
Collaborator Author

mina86 commented Nov 2, 2023

They are stored in the trie. We don’t need to store them in private storage.

@dhruvja
Copy link
Collaborator

dhruvja commented Nov 2, 2023

They are stored in the trie. We don’t need to store them in private storage.

I thought u were hashing it. If you are just storing it as it is, i can just fetch it from the trie

@mina86 mina86 merged commit 98e4567 into master Nov 2, 2023
4 checks passed
@mina86 mina86 deleted the mpn/b branch November 2, 2023 13:24
@mina86
Copy link
Collaborator Author

mina86 commented Nov 2, 2023

<&CryptoHash>::try_from(commitment.as_ref()).unwrap(); interprets the commitment as 32-byte hash which is then stored directly.

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