File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/mobile-app/data/wallet Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,20 @@ export class WriteQueue {
103
103
sequence : block . sequence - 1 ,
104
104
} ) ;
105
105
106
+ // There are several unresolved cases with removing blocks, but removing more than a couple
107
+ // blocks should be very uncommon, so they're listed here:
108
+ //
109
+ // * We could remove multiple blocks at a time. Again, the chain shouldn't generally be
110
+ // removing more than a couple blocks unless something is wrong.
111
+ //
112
+ // * To be totally correct, the nullifier set should only include nullifiers between the DB
113
+ // head and the writeQueue head, so we should remove nullifiers when we queue up a REMOVE.
114
+ // However, we're only using the nullifierSet for checking existence, and assuming that the wallet
115
+ // server validated the blocks correctly, these nullifiers should never be spent until they're readded
116
+ // (probably by the same transaction on a different block). However, the nullifiers may not ever be
117
+ // readded, which would cause them to get stuck in our nullifier set forever.
118
+ //
119
+ // * Related to the above, we could merge ADDs and REMOVEs if they apply to the same block.
106
120
this . writeQueue . push ( {
107
121
type : DBWriteType . REMOVE ,
108
122
accountId,
You can’t perform that action at this time.
0 commit comments