# New tree structure for circuit tests Simple binary Merkle tree contains `2^N` items. Each item is an "account" that follows [this](https://github.com/matter-labs/sync_vm/blob/f8f54c653b21c49f24ddb89d886c4020c71086b3/src/data_structures/state/mod.rs#L11) declaration and follow [this](https://github.com/matter-labs/sync_vm/blob/f8f54c653b21c49f24ddb89d886c4020c71086b3/src/data_structures/state/mod.rs#L20) procedure for serialization into the vector of field elements. After serialization item is hashed with Rescue hash in a form of "committer" created like [here](https://github.com/matter-labs/sync_vm/blob/f8f54c653b21c49f24ddb89d886c4020c71086b3/src/circuit_structures/stack.rs#L253) There are few fields that are must have certain default values: - `pub balances_tree_root: E::Fr` - must be a merkle root of the simple binary merkle tree with `2^K` items each of them being zero (as field element) - `pub sync_pubkey_hash: E::Fr` - is zero by default - `pub self_state: E::Fr` - is zero by default - `pub contract_code_root: E::Fr` - is zero by default Merkle tree hasher is also the same rescue hasher with the same set of parameters, but instantiated as a different type that internally takes care of truncation of the output [link](https://github.com/matter-labs/sync_vm/blob/f8f54c653b21c49f24ddb89d886c4020c71086b3/src/data_structures/alg_binary_tree/rescue_impl.rs) For testing purposes it should be possible to create an empty tree (following the requirements of all default parameters), get account at index and a merkle path for it, update and account and insert it back Parameters `N` and `K` should be defined in runtime cause they will be different in tests and production # Extras - wrap a `balance` (element of the tree with `balances_tree_root`) into a separate data structure with a single field being a `SmallFixedWidthInteger<E, U64>` - `contract_code_root` will be setup (into non-default value) that is a merkle root of `2^L` simple binary merkle tree. For now it should be possible to assemble such a tree for testing purposes where leaf hashes(not leaf elements!) can be set to particular `E::Fr` values.