You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed here in #750, SMT and MMR would be easier to support if we change the way that the AdviceProvider handles clone and update operations.
Currently we offer the copy with modify operation mtree_cwm, but we would like to remove this and add mtree_clone instead. Users who want to make an update in the AdviceProvider would instead then call mtree_clone followed by mtree_set.
The required changes as described by @bobbinth are as follows:
To support a separate clone operation, we need to add a new method to the AdviceProvider interface. Something like:
In the implementation (e.g., MemAdviceProvider) this shouldn't be too difficult to support either - i.e., instead of using BTreeMap<[u8; 32], MerkleSet> we could use BTreeMap<[u8; 32], Vec<MerkleSet>> and then clone operation would add new item to the vector under the specified key.
add a new method to the advice provider
replace Assembly instruction mtree_cwm with mtree_clone
update the docs
The text was updated successfully, but these errors were encountered:
As discussed here in #750, SMT and MMR would be easier to support if we change the way that the
AdviceProvider
handles clone and update operations.Currently we offer the copy with modify operation
mtree_cwm
, but we would like to remove this and addmtree_clone
instead. Users who want to make an update in theAdviceProvider
would instead then callmtree_clone
followed bymtree_set
.The required changes as described by @bobbinth are as follows:
To support a separate clone operation, we need to add a new method to the
AdviceProvider
interface. Something like:In the implementation (e.g., MemAdviceProvider) this shouldn't be too difficult to support either - i.e., instead of using
BTreeMap<[u8; 32], MerkleSet>
we could useBTreeMap<[u8; 32], Vec<MerkleSet>>
and then clone operation would add new item to the vector under the specified key.mtree_cwm
withmtree_clone
The text was updated successfully, but these errors were encountered: