-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ADR-40: update on multi-store refactor and IBC proofs #10191
ADR-40: update on multi-store refactor and IBC proofs #10191
Conversation
@robert-zaremba I've made some updates on your ADR update branch to cover my root store proposal and what we've discussed on IBC in a little more depth |
Would also like to solicit @AdityaSripal to check that I've correctly summarized the IBC situation 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the design!
GetStoreCache(StoreKey, CommitKVStore) CommitKVStore | ||
Unwrap(StoreKey) CommitKVStore | ||
Reset() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we merge these interfaces?
- Do we need
RootStorePersistentCache
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is desired, but on second thought it probably won't look like this. I will just remove it for now and revisit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root store should be used only by the app. We can add interfaces if we need later when implementing. Then we can create a new PR to update the design. Let's start from the minimal interface. RootStore
should not allow to write objects into it. Only the "normal" stores should allow writes.
|
||
This workaround can be used until the IBC connection code is fully upgraded and supports single-element commitment proofs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about keeping the paragraph: "the RootStore
will have only two stores....".
Maybe we can be also more specific:
- IBC store key is
01
(2 bits) - "general" store key is
1
(1 bit).
Not sure though if we can only add as much as 1-2 bits though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I may have misunderstood Aditya's comment - I had thought ibc/clients
, ibc/connections
were the prefixes of separate stores. Now, if I've got it right, ibc
is the only store prefix for IBC data, and the rest are just parts of the key paths. I'll update it.
I'm not sure I understand the prefixes you're proposing though. If you mean how the data is partitioned in the DB, that doesn't seem to belong at this level of design, also I don't think it's feasible to have prefixes smaller than a byte - it would shift the alignment of all the following data.
For IBC proofs, I believe the IBC data must be under the ibc
store key, and the general data can just use the empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my understanding is that there is one store for IBC: the ibc/
. Then they have a 3 groups of objects: clients, connections, channels.
So my proposal is that in the root store we have 2 stores:
- IBC with
01
prefix (2 bits or 1 byte). AFAIU, IBC supports changing the prefix without doingx/ibc
update -- it requires a migration only. - "general" store for everything else.
@AdityaSripal , @colin-axner - could you validate this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IBC does not support changing the prefix unfortunately because the prefix is in the connection which is non-upgradable.
Can the separate IBC store retain the ibc/
prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, if we can't change it then we will keep it.
Co-authored-by: Robert Zaremba <[email protected]>
InitialVersion uint64 | ||
|
||
ReservePrefix(StoreKey, StoreType) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: validate if we really need all these interfaces. It seams to me that the app only needs the CommitRootStore
.
We let's add this TODO into the code and merge it - we can do that check in the "main" PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-Approving. This is a good update, let's add TODOs in the "code" and merge it and continue the discussion in the main PR.
Co-authored-by: Robert Zaremba <[email protected]>
…ert/adr-40-update
* adr-40: use prefix store instead of multistore * add note about prefix.Store * Update SC and SS setup information and historical versions sepc * add note about key prefix optimization * rephrased the changes related to multistore * Apply suggestions from code review Co-authored-by: Ryan Christoffersen <[email protected]> * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md Co-authored-by: Aleksandr Bezobchuk <[email protected]> * design update * update merkle proofs * Apply suggestions from code review Co-authored-by: Aleksandr Bezobchuk <[email protected]> * reword huffman compression paragraph * ADR-40: update on multi-store refactor and IBC proofs (#10191) * Update on multistore refactor and IBC proof * cleanup whitespace * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md Co-authored-by: Robert Zaremba <[email protected]> * revise for PR * add todo * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md Co-authored-by: Robert Zaremba <[email protected]> Co-authored-by: Robert Zaremba <[email protected]> * review updates * add todo for protobuf message type compression * add link to a discussion * guarantee atomic commit with IBC workaround proposal * adding more links to references * Apply suggestions from code review Co-authored-by: Roy Crihfield <[email protected]> * reword the module key compression part Co-authored-by: Ryan Christoffersen <[email protected]> Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Roy Crihfield <[email protected]>
* adr-40: use prefix store instead of multistore * add note about prefix.Store * Update SC and SS setup information and historical versions sepc * add note about key prefix optimization * rephrased the changes related to multistore * Apply suggestions from code review Co-authored-by: Ryan Christoffersen <[email protected]> * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md Co-authored-by: Aleksandr Bezobchuk <[email protected]> * design update * update merkle proofs * Apply suggestions from code review Co-authored-by: Aleksandr Bezobchuk <[email protected]> * reword huffman compression paragraph * ADR-40: update on multi-store refactor and IBC proofs (#10191) * Update on multistore refactor and IBC proof * cleanup whitespace * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md Co-authored-by: Robert Zaremba <[email protected]> * revise for PR * add todo * Update docs/architecture/adr-040-storage-and-smt-state-commitments.md Co-authored-by: Robert Zaremba <[email protected]> Co-authored-by: Robert Zaremba <[email protected]> * review updates * add todo for protobuf message type compression * add link to a discussion * guarantee atomic commit with IBC workaround proposal * adding more links to references * Apply suggestions from code review Co-authored-by: Roy Crihfield <[email protected]> * reword the module key compression part Co-authored-by: Ryan Christoffersen <[email protected]> Co-authored-by: Federico Kunze <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Roy Crihfield <[email protected]>
Description
Update on the proposal for the
RootStore
and how to handle the new proof scheme to support IBC.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change