multiple_psr_test.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. package mps
  2. import (
  3. "math/big"
  4. "sync"
  5. "testing"
  6. "github.com/ethereum/go-ethereum/common"
  7. "github.com/ethereum/go-ethereum/core/privatecache"
  8. "github.com/ethereum/go-ethereum/core/rawdb"
  9. "github.com/ethereum/go-ethereum/core/state"
  10. "github.com/ethereum/go-ethereum/core/types"
  11. "github.com/stretchr/testify/assert"
  12. )
  13. //TestMultiplePSRCopy tests that copying a the PSR object indeed makes the original and
  14. // the copy and their corresponding managed states independent of each other.
  15. func TestMultiplePSRCopy(t *testing.T) {
  16. testdb := rawdb.NewMemoryDatabase()
  17. testCache := state.NewDatabase(testdb)
  18. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  19. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  20. testState, _ := psr.StatePSI(types.PrivateStateIdentifier("test"))
  21. privState, _ := psr.StatePSI(types.DefaultPrivateStateIdentifier)
  22. for i := byte(0); i < 255; i++ {
  23. addr := common.BytesToAddress([]byte{i})
  24. testState.AddBalance(addr, big.NewInt(int64(i)))
  25. }
  26. testState.Finalise(false)
  27. for i := byte(0); i < 255; i++ {
  28. addr := common.BytesToAddress([]byte{i})
  29. privState.AddBalance(addr, big.NewInt(int64(i)))
  30. }
  31. privState.Finalise(false)
  32. psrCopy := psr.Copy().(*MultiplePrivateStateRepository)
  33. testStateCopy, _ := psrCopy.StatePSI(types.PrivateStateIdentifier("test"))
  34. privStateCopy, _ := psrCopy.StatePSI(types.DefaultPrivateStateIdentifier)
  35. addedState, _ := psrCopy.StatePSI(types.PrivateStateIdentifier("added"))
  36. // modify all in memory
  37. for i := byte(0); i < 255; i++ {
  38. testState.AddBalance(common.BytesToAddress([]byte{i}), big.NewInt(2*int64(i)))
  39. privState.AddBalance(common.BytesToAddress([]byte{i}), big.NewInt(2*int64(i)))
  40. testStateCopy.AddBalance(common.BytesToAddress([]byte{i}), big.NewInt(3*int64(i)))
  41. privStateCopy.AddBalance(common.BytesToAddress([]byte{i}), big.NewInt(3*int64(i)))
  42. addedState.AddBalance(common.BytesToAddress([]byte{i}), big.NewInt(3*int64(i)))
  43. }
  44. // Finalise the changes on all concurrently
  45. finalise := func(wg *sync.WaitGroup, db *state.StateDB) {
  46. defer wg.Done()
  47. db.Finalise(true)
  48. }
  49. var wg sync.WaitGroup
  50. wg.Add(5)
  51. go finalise(&wg, testState)
  52. go finalise(&wg, testStateCopy)
  53. go finalise(&wg, privState)
  54. go finalise(&wg, privStateCopy)
  55. go finalise(&wg, addedState)
  56. wg.Wait()
  57. //copies contain correct managed states
  58. assert.Contains(t, psr.managedStates, types.EmptyPrivateStateIdentifier)
  59. assert.Contains(t, psr.managedStates, types.DefaultPrivateStateIdentifier)
  60. assert.Contains(t, psr.managedStates, types.PrivateStateIdentifier("test"))
  61. assert.NotContains(t, psr.managedStates, types.PrivateStateIdentifier("added"))
  62. assert.Contains(t, psrCopy.managedStates, types.EmptyPrivateStateIdentifier)
  63. assert.Contains(t, psrCopy.managedStates, types.DefaultPrivateStateIdentifier)
  64. assert.Contains(t, psrCopy.managedStates, types.PrivateStateIdentifier("test"))
  65. assert.Contains(t, psrCopy.managedStates, types.PrivateStateIdentifier("added"))
  66. assert.Equal(t, psr.db, psrCopy.db)
  67. assert.Equal(t, psr.repoCache, psrCopy.repoCache)
  68. assert.NotEqual(t, psr.trie, psrCopy.trie)
  69. // Verify that the all states have been updated independently
  70. for i := byte(0); i < 255; i++ {
  71. addr := common.BytesToAddress([]byte{i})
  72. testObj := testState.GetOrNewStateObject(addr)
  73. testCopyObj := testStateCopy.GetOrNewStateObject(addr)
  74. privObj := privState.GetOrNewStateObject(addr)
  75. privCopyObj := privStateCopy.GetOrNewStateObject(addr)
  76. addedObj := addedState.GetOrNewStateObject(addr)
  77. if want := big.NewInt(3 * int64(i)); testObj.Balance().Cmp(want) != 0 {
  78. t.Errorf("empty obj %d: balance mismatch: have %v, want %v", i, testObj.Balance(), want)
  79. }
  80. if want := big.NewInt(3 * int64(i)); privObj.Balance().Cmp(want) != 0 {
  81. t.Errorf("priv obj %d: balance mismatch: have %v, want %v", i, privObj.Balance(), want)
  82. }
  83. if want := big.NewInt(4 * int64(i)); testCopyObj.Balance().Cmp(want) != 0 {
  84. t.Errorf("empty copy obj %d: balance mismatch: have %v, want %v", i, testCopyObj.Balance(), want)
  85. }
  86. if want := big.NewInt(4 * int64(i)); privCopyObj.Balance().Cmp(want) != 0 {
  87. t.Errorf("priv copy obj %d: balance mismatch: have %v, want %v", i, privCopyObj.Balance(), want)
  88. }
  89. if want := big.NewInt(3 * int64(i)); addedObj.Balance().Cmp(want) != 0 {
  90. t.Errorf("added obj %d: balance mismatch: have %v, want %v", i, addedObj.Balance(), want)
  91. }
  92. }
  93. }
  94. //TestMultiplePSRReset tests that state objects are cleared from all managedState statedbs after reset call
  95. //Any updated stateObjects not committed to statedbs before reset will be cleared
  96. func TestMultiplePSRReset(t *testing.T) {
  97. testdb := rawdb.NewMemoryDatabase()
  98. testCache := state.NewDatabase(testdb)
  99. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  100. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  101. testState, _ := psr.StatePSI(types.PrivateStateIdentifier("test"))
  102. emptyState, _ := psr.StatePSI(types.EmptyPrivateStateIdentifier)
  103. addr := common.BytesToAddress([]byte{254})
  104. testState.AddBalance(addr, big.NewInt(int64(254)))
  105. emptyState.AddBalance(addr, big.NewInt(int64(254)))
  106. // have something to revert to (rather than the empty trie of private states)
  107. psr.CommitAndWrite(false, types.NewBlockWithHeader(&types.Header{Root: common.Hash{}}))
  108. // testState2 should branch from the emptyState - so it should contain the contract with address 254...
  109. testState2, _ := psr.StatePSI(types.PrivateStateIdentifier("test2"))
  110. for i := byte(0); i < 254; i++ {
  111. addr := common.BytesToAddress([]byte{i})
  112. testState.AddBalance(addr, big.NewInt(int64(i)))
  113. testState2.AddBalance(addr, big.NewInt(int64(i)))
  114. emptyState.AddBalance(addr, big.NewInt(int64(i)))
  115. }
  116. testState.Finalise(false)
  117. testState2.Finalise(false)
  118. emptyState.Finalise(false)
  119. for i := byte(0); i < 255; i++ {
  120. addr := common.BytesToAddress([]byte{i})
  121. assert.True(t, testState.Exist(addr))
  122. assert.True(t, testState2.Exist(addr))
  123. assert.True(t, emptyState.Exist(addr))
  124. }
  125. psr.Reset()
  126. // test2 is no longer there in the managed states after reset
  127. assert.Contains(t, psr.managedStates, types.PrivateStateIdentifier("test"))
  128. assert.NotContains(t, psr.managedStates, types.PrivateStateIdentifier("test2"))
  129. assert.Contains(t, psr.managedStates, types.EmptyPrivateStateIdentifier)
  130. for i := byte(0); i < 254; i++ {
  131. addr := common.BytesToAddress([]byte{i})
  132. assert.False(t, testState.Exist(addr))
  133. assert.False(t, emptyState.Exist(addr))
  134. }
  135. addr = common.BytesToAddress([]byte{254})
  136. assert.True(t, testState.Exist(addr))
  137. assert.True(t, emptyState.Exist(addr))
  138. }
  139. //TestCreatingManagedStates tests that managed states are created and added to managedState map
  140. func TestCreatingManagedStates(t *testing.T) {
  141. testdb := rawdb.NewMemoryDatabase()
  142. testCache := state.NewDatabase(testdb)
  143. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  144. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  145. //create some managed states
  146. psr.DefaultState()
  147. psr.StatePSI(types.PrivateStateIdentifier("test"))
  148. psr.StatePSI(types.DefaultPrivateStateIdentifier)
  149. //check if they exist in managedStates map
  150. assert.Contains(t, psr.managedStates, types.EmptyPrivateStateIdentifier)
  151. assert.Contains(t, psr.managedStates, types.DefaultPrivateStateIdentifier)
  152. assert.Contains(t, psr.managedStates, types.PrivateStateIdentifier("test"))
  153. assert.NotContains(t, psr.managedStates, types.PrivateStateIdentifier("added"))
  154. }
  155. //TestMultiplePSRCommit tests that managedStates are updated, trie of states is updated but not written to db
  156. func TestMultiplePSRCommit(t *testing.T) {
  157. testdb := rawdb.NewMemoryDatabase()
  158. testCache := state.NewDatabase(testdb)
  159. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  160. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  161. header := &types.Header{Number: big.NewInt(int64(1)), Root: common.Hash{123}}
  162. block := types.NewBlockWithHeader(header)
  163. testState, _ := psr.StatePSI(types.PrivateStateIdentifier("test"))
  164. privState, _ := psr.StatePSI(types.DefaultPrivateStateIdentifier)
  165. //states have empty tries first
  166. testRoot := testState.IntermediateRoot(false)
  167. privRoot := privState.IntermediateRoot(false)
  168. assert.Equal(t, testRoot, emptyRoot)
  169. assert.Equal(t, privRoot, emptyRoot)
  170. //make updates to states
  171. for i := byte(0); i < 255; i++ {
  172. addr := common.BytesToAddress([]byte{i})
  173. testState.AddBalance(addr, big.NewInt(int64(i)))
  174. privState.AddBalance(addr, big.NewInt(int64(i)))
  175. }
  176. assert.Equal(t, rawdb.GetPrivateStatesTrieRoot(testdb, block.Root()), common.Hash{})
  177. psr.Commit(false, block)
  178. //trie root updated but not committed to db
  179. assert.NotEqual(t, psr.trie.Hash(), common.Hash{})
  180. assert.Equal(t, rawdb.GetPrivateStatesTrieRoot(testdb, block.Root()), common.Hash{})
  181. privateKey, _ := psr.trie.TryGet([]byte(types.DefaultPrivateStateIdentifier))
  182. assert.NotEqual(t, len(privateKey), 0)
  183. testKey, _ := psr.trie.TryGet([]byte(types.PrivateStateIdentifier("test")))
  184. assert.NotEqual(t, len(testKey), 0)
  185. emptyKey, _ := psr.trie.TryGet([]byte(types.EmptyPrivateStateIdentifier))
  186. assert.NotEqual(t, len(emptyKey), 0)
  187. notKey, _ := psr.trie.TryGet([]byte(types.PrivateStateIdentifier("notKey")))
  188. assert.Equal(t, len(notKey), 0)
  189. //managed state tries updated
  190. testRoot = testState.IntermediateRoot(false)
  191. privRoot = privState.IntermediateRoot(false)
  192. assert.NotEqual(t, testRoot, emptyRoot)
  193. assert.NotEqual(t, privRoot, emptyRoot)
  194. }
  195. //TestMultiplePSRCommitAndWrite tests that managedStates are updated, trie of states is updated and written to db
  196. func TestMultiplePSRCommitAndWrite(t *testing.T) {
  197. testdb := rawdb.NewMemoryDatabase()
  198. testCache := state.NewDatabase(testdb)
  199. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  200. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  201. header := &types.Header{Number: big.NewInt(int64(1)), Root: common.Hash{123}}
  202. block := types.NewBlockWithHeader(header)
  203. testState, _ := psr.StatePSI(types.PrivateStateIdentifier("test"))
  204. privState, _ := psr.StatePSI(types.DefaultPrivateStateIdentifier)
  205. //states have empty tries first
  206. testRoot := testState.IntermediateRoot(false)
  207. privRoot := privState.IntermediateRoot(false)
  208. assert.Equal(t, testRoot, emptyRoot)
  209. assert.Equal(t, privRoot, emptyRoot)
  210. //make updates to states
  211. for i := byte(0); i < 255; i++ {
  212. addr := common.BytesToAddress([]byte{i})
  213. testState.AddBalance(addr, big.NewInt(int64(i)))
  214. privState.AddBalance(addr, big.NewInt(int64(i)))
  215. }
  216. assert.Equal(t, rawdb.GetPrivateStatesTrieRoot(testdb, block.Root()), common.Hash{})
  217. psr.CommitAndWrite(false, block)
  218. //trie root updated and committed to db
  219. assert.NotEqual(t, psr.trie.Hash(), common.Hash{})
  220. assert.NotEqual(t, rawdb.GetPrivateStatesTrieRoot(testdb, block.Root()), common.Hash{})
  221. privateKey, _ := psr.trie.TryGet([]byte(types.DefaultPrivateStateIdentifier))
  222. assert.NotEqual(t, len(privateKey), 0)
  223. testKey, _ := psr.trie.TryGet([]byte(types.PrivateStateIdentifier("test")))
  224. assert.NotEqual(t, len(testKey), 0)
  225. emptyKey, _ := psr.trie.TryGet([]byte(types.EmptyPrivateStateIdentifier))
  226. assert.NotEqual(t, len(emptyKey), 0)
  227. notKey, _ := psr.trie.TryGet([]byte(types.PrivateStateIdentifier("notKey")))
  228. assert.Equal(t, len(notKey), 0)
  229. //managed state tries updated
  230. testRoot = testState.IntermediateRoot(false)
  231. privRoot = privState.IntermediateRoot(false)
  232. assert.NotEqual(t, testRoot, emptyRoot)
  233. assert.NotEqual(t, privRoot, emptyRoot)
  234. }
  235. //TestMultiplePSRIntroduceNewPrivateState tests that a newly introduced private state is branched from the empty state and maintained accordingly
  236. func TestMultiplePSRIntroduceNewPrivateState(t *testing.T) {
  237. testPS1 := types.PrivateStateIdentifier("PS1")
  238. testPS2 := types.PrivateStateIdentifier("PS2")
  239. testdb := rawdb.NewMemoryDatabase()
  240. testCache := state.NewDatabase(testdb)
  241. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  242. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  243. header1 := &types.Header{Number: big.NewInt(int64(1)), Root: common.Hash{123}}
  244. block1 := types.NewBlockWithHeader(header1)
  245. header2 := &types.Header{Number: big.NewInt(int64(2)), Root: common.Hash{124}}
  246. block2 := types.NewBlockWithHeader(header2)
  247. testState1, _ := psr.StatePSI(testPS1)
  248. emptyState, _ := psr.StatePSI(types.EmptyPrivateStateIdentifier)
  249. //states have empty tries first
  250. testState1Root := testState1.IntermediateRoot(false)
  251. emptyStateRoot := emptyState.IntermediateRoot(false)
  252. assert.Equal(t, testState1Root, emptyRoot)
  253. assert.Equal(t, emptyStateRoot, emptyRoot)
  254. //make updates to states
  255. for i := byte(0); i < 10; i++ {
  256. addr := common.BytesToAddress([]byte{i})
  257. testState1.AddBalance(addr, big.NewInt(int64(i)))
  258. emptyState.AddBalance(addr, big.NewInt(int64(i)))
  259. }
  260. assert.Equal(t, rawdb.GetPrivateStatesTrieRoot(testdb, block1.Root()), common.Hash{})
  261. psr.CommitAndWrite(false, block1)
  262. //trie root updated and committed to db
  263. psrRootHash1 := psr.trie.Hash()
  264. assert.NotEqual(t, psrRootHash1, emptyRoot)
  265. assert.Equal(t, rawdb.GetPrivateStatesTrieRoot(testdb, block1.Root()), psrRootHash1)
  266. emptyStateRootHash, _ := psr.trie.TryGet([]byte(types.EmptyPrivateStateIdentifier))
  267. assert.NotEqual(t, len(emptyStateRootHash), 0)
  268. ps1RootHash, _ := psr.trie.TryGet([]byte(testPS1))
  269. assert.NotEqual(t, len(ps1RootHash), 0)
  270. notKeyRootHash, _ := psr.trie.TryGet([]byte(types.PrivateStateIdentifier("notKey")))
  271. assert.Equal(t, len(notKeyRootHash), 0)
  272. //managed state tries updated
  273. testState1Root = testState1.IntermediateRoot(false)
  274. emptyStateRoot = emptyState.IntermediateRoot(false)
  275. assert.NotEqual(t, testState1Root, emptyRoot)
  276. assert.NotEqual(t, emptyStateRoot, emptyRoot)
  277. // begin adding state at block2
  278. psr, _ = NewMultiplePrivateStateRepository(testdb, testCache, rawdb.GetPrivateStatesTrieRoot(testdb, block1.Root()), privateCacheProvider)
  279. testState1, _ = psr.StatePSI(testPS1)
  280. testState2, _ := psr.StatePSI(testPS2)
  281. emptyState, _ = psr.StatePSI(types.EmptyPrivateStateIdentifier)
  282. //make updates to states
  283. for i := byte(10); i < 20; i++ {
  284. addr := common.BytesToAddress([]byte{i})
  285. testState1.AddBalance(addr, big.NewInt(int64(i)))
  286. testState2.AddBalance(addr, big.NewInt(int64(i)))
  287. emptyState.AddBalance(addr, big.NewInt(int64(i)))
  288. }
  289. psr.CommitAndWrite(false, block2)
  290. psr, _ = NewMultiplePrivateStateRepository(testdb, testCache, rawdb.GetPrivateStatesTrieRoot(testdb, block2.Root()), privateCacheProvider)
  291. testState1, _ = psr.StatePSI(testPS1)
  292. testState2, _ = psr.StatePSI(testPS2)
  293. emptyState, _ = psr.StatePSI(types.EmptyPrivateStateIdentifier)
  294. // we've only added addresses from 10 to 20 to testState2 but since it branched from emptyState it should also contain addresses from 0 to 10
  295. for i := byte(0); i < 20; i++ {
  296. addr := common.BytesToAddress([]byte{i})
  297. assert.True(t, testState1.Exist(addr))
  298. assert.True(t, testState2.Exist(addr))
  299. assert.True(t, emptyState.Exist(addr))
  300. }
  301. // check that PS2 does not exist in the PSR at block1 height
  302. psr, _ = NewMultiplePrivateStateRepository(testdb, testCache, rawdb.GetPrivateStatesTrieRoot(testdb, block1.Root()), privateCacheProvider)
  303. emptyStateRootHash, _ = psr.trie.TryGet([]byte(types.EmptyPrivateStateIdentifier))
  304. assert.NotEqual(t, len(emptyStateRootHash), 0)
  305. ps1RootHash, _ = psr.trie.TryGet([]byte(testPS1))
  306. assert.NotEqual(t, len(ps1RootHash), 0)
  307. ps2RootHash, _ := psr.trie.TryGet([]byte(testPS2))
  308. assert.Equal(t, len(ps2RootHash), 0)
  309. // check that PS2 does exist in the PSR at block2 height
  310. psr, _ = NewMultiplePrivateStateRepository(testdb, testCache, rawdb.GetPrivateStatesTrieRoot(testdb, block2.Root()), privateCacheProvider)
  311. emptyStateRootHash, _ = psr.trie.TryGet([]byte(types.EmptyPrivateStateIdentifier))
  312. assert.NotEqual(t, len(emptyStateRootHash), 0)
  313. ps1RootHash, _ = psr.trie.TryGet([]byte(testPS1))
  314. assert.NotEqual(t, len(ps1RootHash), 0)
  315. ps2RootHash, _ = psr.trie.TryGet([]byte(testPS2))
  316. assert.NotEqual(t, len(ps2RootHash), 0)
  317. }
  318. //TestMultiplePSRRemovalFromPrivateState tests that exist no longer picks suicided accounts
  319. func TestMultiplePSRRemovalFromPrivateState(t *testing.T) {
  320. testPS1 := types.PrivateStateIdentifier("PS1")
  321. testdb := rawdb.NewMemoryDatabase()
  322. testCache := state.NewDatabase(testdb)
  323. privateCacheProvider := privatecache.NewPrivateCacheProvider(testdb, nil, testCache, false)
  324. psr, _ := NewMultiplePrivateStateRepository(testdb, testCache, common.Hash{}, privateCacheProvider)
  325. header1 := &types.Header{Number: big.NewInt(int64(1)), Root: common.Hash{123}}
  326. block1 := types.NewBlockWithHeader(header1)
  327. header2 := &types.Header{Number: big.NewInt(int64(2)), Root: common.Hash{124}}
  328. block2 := types.NewBlockWithHeader(header2)
  329. testState1, _ := psr.StatePSI(testPS1)
  330. emptyState, _ := psr.StatePSI(types.EmptyPrivateStateIdentifier)
  331. //make updates to states
  332. for i := byte(0); i < 10; i++ {
  333. addr := common.BytesToAddress([]byte{i})
  334. testState1.AddBalance(addr, big.NewInt(int64(i)))
  335. emptyState.AddBalance(addr, big.NewInt(int64(i)))
  336. }
  337. assert.Equal(t, rawdb.GetPrivateStatesTrieRoot(testdb, block1.Root()), common.Hash{})
  338. psr.CommitAndWrite(false, block1)
  339. psr, _ = NewMultiplePrivateStateRepository(testdb, testCache, rawdb.GetPrivateStatesTrieRoot(testdb, block1.Root()), privateCacheProvider)
  340. testState1, _ = psr.StatePSI(testPS1)
  341. emptyState, _ = psr.StatePSI(types.EmptyPrivateStateIdentifier)
  342. removedAddress := common.BytesToAddress([]byte{1})
  343. testState1.Suicide(removedAddress)
  344. psr.CommitAndWrite(false, block2)
  345. psr, _ = NewMultiplePrivateStateRepository(testdb, testCache, rawdb.GetPrivateStatesTrieRoot(testdb, block2.Root()), privateCacheProvider)
  346. testState1, _ = psr.StatePSI(testPS1)
  347. emptyState, _ = psr.StatePSI(types.EmptyPrivateStateIdentifier)
  348. assert.False(t, testState1.Exist(removedAddress))
  349. assert.True(t, emptyState.Exist(removedAddress))
  350. }