Accounts Tree: Global state for all the pubkey's registered.
State Tree: Hubble app specific tree for accounts on that application
Index of leaf in accounts-tree is AccID and index of leaf in state-tree is StateID
Right now the from and the to indexes in the transaction point to the AccID and hence it is used to do lookups in the accounts-tree. While this works well for on-chain only deposit mechanisms but breaks for off-chain account creations as now we can have 2 accounts with same set of (AccID, Balance, Nonce,Token) and could lead to corruption of state by introducing ambiguity.
The solution is to point the indexes in transactions to StateID's as they are always unique for an account.
There are 2 trees in hubble:
Index of leaf in accounts-tree is
AccID
and index of leaf in state-tree isStateID
Right now the
from
and theto
indexes in the transaction point to the AccID and hence it is used to do lookups in the accounts-tree. While this works well for on-chain only deposit mechanisms but breaks for off-chain account creations as now we can have 2 accounts with same set of (AccID, Balance, Nonce,Token) and could lead to corruption of state by introducing ambiguity.The solution is to point the indexes in transactions to StateID's as they are always unique for an account.