Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Tree sharding to process updates in parallel #62

Open
musalbas opened this issue Sep 27, 2021 · 5 comments
Open

Tree sharding to process updates in parallel #62

musalbas opened this issue Sep 27, 2021 · 5 comments

Comments

@musalbas
Copy link
Member

At the moment, the tree can only safely handle one update at a time. It would be desirable to shard the tree into multiple subtrees and allow parallel updates to the subtrees.

@tac0turtle
Copy link
Contributor

Does this get rid of atomic writes?

Does this have overlap with cosmos/cosmos-sdk#6370

@musalbas
Copy link
Member Author

musalbas commented Sep 27, 2021

It shouldn't do if implemented correctly! See https://github.com/google/trillian/blob/v1.4.0/merkle/smt/writer.go#L37 for a sharded SMT implementation (but without the efficiency improvements of the Libra SMT).

@liamsi
Copy link
Member

liamsi commented Sep 27, 2021

The SDK is about to remove / reduce (?) the multistore because it is not easy to implement this correctly I think. See specifically this comment: cosmos/cosmos-sdk#6370 (comment) (the problem is that the sub-trees are treated somewhat too independently and the abstractions did not make it easy that the writes were actually atomic).

IIUC, the code @musalbas posted is not about sharding into subtrees alá logical subtrees (like in the multistore) but rather about sharding into equal sized shards independent of any logical sub-trees (e.g. accounts, delegations, valsets etc would be logical sub-trees).

Either way, it is probably safe to say that this does not have the highest priority right now?

@musalbas
Copy link
Member Author

It's not high priority, but it would be important for execution environments like Solana that support parallel transaction execution.

@universe2439
Copy link

Agree not high priority

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants