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: map IBC client ids into u32 and refactor client state storage #98

Merged
merged 8 commits into from
Nov 18, 2023

Conversation

mina86
Copy link
Collaborator

@mina86 mina86 commented Nov 17, 2023

IBC client ids have <client-type>-<counter> format where counter is
a global sequential number. Take advantage of that by converting
client ids into u32 including just the counter.

Since we’re effectively ignoring the client-type part of the id, keep
counter → client id map in private storage and use it to verify that
id we were given is the one we know about.

Furthermore, rather than storing client information in a map keep it
in a vector which is more compact and faster to index. At the same
time, keep just a single vector for all per-client data rather than
having separate maps for each piece of information.

Issue: #35

@mina86 mina86 requested a review from dhruvja November 17, 2023 01:56
…rage

IBC client ids have ‘<client-type>-<counter>’ format where counter is
a global sequential number.  Take advantage of that by converting
client ids into u32 including just the counter.

Since we’re effectively ignoring the client-type part of the id, keep
counter → client id map in private storage and use it to verify that
id we were given is the one we know about.

Furthermore, rather than storing client information in a map keep it
in a vector which is more compact and faster to index.  At the same
time, keep just a single vector for all per-client data rather than
having separate maps for each piece of information.

Issue: #35
Copy link
Collaborator

@dhruvja dhruvja left a comment

Choose a reason for hiding this comment

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

LGTM

@mina86 mina86 merged commit a91c4f2 into master Nov 18, 2023
5 checks passed
@mina86 mina86 deleted the mpn/d branch November 18, 2023 16:06
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.

3 participants