Getting the State
The state of the Merkle tree: relayer and contract
Last updated
Was this helpful?
The state of the Merkle tree: relayer and contract
Last updated
Was this helpful?
The privacy pool's state is a set of the Merkle tree root and its current index ( additional details ). The state is described by the . In normal operations the client's local state should match both the relayer and the pool contract state. However there is no local state in the accountless mode, but we can monitor relayer and pool states.
The relayer node has two different states: the regular state (which should match the pool contract) and the optimistic one. The optimistic state contain transactions which will be included into the state but are not processed yet. In other words the optimistic state is a most likely future Merkle tree state. The optimistic index should always be greater or equal to the normal state.
The client local state should be up to date with the relayer state. Use the associated full-mode method to retrieve.
This is the primary state. All subsystems (relayer, client) must be synced with the pool state.
index
- the index of the merkle tree root to retrieve (use the latest index if undefined)
Promise
returns
This should match the pool state. Only the latest state can be requested, there is no way to specify an index.
The forcasted state by the relayer. This can be used to monitor transaction queue length. The index of the optimistic state should be greater or equal the index of the current state.
Promise
returns
Promise
returns