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

fix: state sync #969

Merged
merged 23 commits into from
Nov 26, 2024
Merged

fix: state sync #969

merged 23 commits into from
Nov 26, 2024

Conversation

miraclx
Copy link
Member

@miraclx miraclx commented Nov 15, 2024

Remove type_id from calimero_storage, which unblocks sync.

Address other classes of misuse of the crdt subsystem and questionable design

@MatejVukosav
Copy link
Member

MatejVukosav commented Nov 22, 2024

Can you elaborate more on misuse and questionable design? What was wrong?

how removing type_id unblocks the sync?

Copy link
Member

@chefsale chefsale left a comment

Choose a reason for hiding this comment

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

ship it

@miraclx miraclx enabled auto-merge (squash) November 26, 2024 12:42
@miraclx miraclx disabled auto-merge November 26, 2024 12:46
@miraclx
Copy link
Member Author

miraclx commented Nov 26, 2024

Can you elaborate more on misuse and questionable design? What was wrong?

Misuse: Interface's functions were unintuitive and our attempts to abstract over it to provide easier-to-use APIs through Unordered{Set,Map} & Vector still required calling Interface::save on the collection after all mutations happen. When to call that and by whom was an open question, which led to one class of issues.

Questionable design:

  • Many functions in index.rs call get_index multiple times to extract bits of unmutated information, this is still the case, but it's been reduced to an extent.
  • Structures contained information like creation, update, merkle hash, etc.. that would be sent over the wire unnecessarily.
  • Many functions in interface.rs required a definition of T: Data which led to the type_id requirement.

how removing type_id unblocks the sync?

  • Just look at __private.rs from before. Since functions required knowledge of which type had which data updated, we had to exhaustively be aware of all types that constitute the state. That was unwieldy and led us down the path of __private.rs.
    That is no longer the case.

@miraclx miraclx enabled auto-merge (squash) November 26, 2024 12:51
@miraclx miraclx merged commit 55c6121 into master Nov 26, 2024
16 checks passed
@miraclx miraclx deleted the miraclx/sync-temp branch November 26, 2024 13:22
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.

4 participants