## std::collections::smt
| Procedure | Description |
| ----------- | ------------- |
| set | Inserts the specified value under the specified key in a Sparse Merkle Tree defined by the
specified root. If the insert is successful, the old value located under the specified key
is returned via the stack.
If the VALUE is an empty word (i.e., [ZERO; 4]), the new state of the tree is guaranteed to
be equivalent to the state as if the updated value was never inserted.
Inputs:
Operand stack: [V, K, R, ...]
Outputs:
Operand stack: [V_old, R_new, ...]
Fails if the tree with the specified root does not exits in the VM's advice provider.
Cycles
Leaf empty
removal: 74 cycles
insertion: 133 cycles
Leaf single
removal: 227 cycles
insertion (leaf remains single): 205
insertion (leaf becomes multiple): unimplemented
Leaf multiple
unimplemented
|
| get | Returns the value located under the specified key in the Sparse Merkle Tree defined by the
specified root.
If no values had been previously inserted under the specified key, an empty word (i.e.,
[ZERO; 4]) is returned.
Inputs:
Operand stack: [K, R, ...]
Outputs:
Operand stack: [V, R, ...]
Fails if the tree with the specified root does not exits in the VM's advice provider.
Cycles
Leaf empty: 48 cycles
Leaf single: 99 cycles
Leaf multiple: unimplemented
|