Conversation
| val sidechainTransactionApiRoute: Route = SidechainTransactionApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, mockedSidechainTransactionActorRef, | ||
| sidechainTransactionsCompanion, params).route | ||
| val sidechainWalletApiRoute: Route = SidechainWalletApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, sidechainSecretsCompanion).route | ||
| val sidechainWalletApiRoute: Route = SidechainWalletApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, null, sidechainSecretsCompanion).route |
There was a problem hiding this comment.
Could you please mark variable, what is null?
There was a problem hiding this comment.
the null variable is the new SidechainNodeViewReindexer, since it is not used in this test I did not mocked it
There was a problem hiding this comment.
I guess Sergiy meant something like val sidechainWalletApiRoute: Route = SidechainWalletApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, sidechainNodeViewReindexer=null, sidechainSecretsCompanion).route
to clearly understand what was nullified.
MarcoOl94
left a comment
There was a problem hiding this comment.
It looks good. Just few comments:
- Maybe it can be good to check if the reindex is in progress also in the endpoints that use the StateStorage (e.g. hashCeased, getSidechainBlockIdForBackup).
- There can be issues in case of having a reindex in progress at the same time of a Certificate generation?
- Do we want to add also an optional parameter to the endpoints importSecret and importSecrets that can launch automatically a reindex (defualt=False)?
d09057b to
94ab40c
Compare
i-Alex
left a comment
There was a problem hiding this comment.
Tricky feature, a lot of curvy points there.
The overall design is very good!
sdk/src/main/scala/com/horizen/network/SidechainNodeViewSynchronizer.scala
Show resolved
Hide resolved
sdk/src/main/scala/com/horizen/network/SidechainNodeViewSynchronizer.scala
Show resolved
Hide resolved
sdk/src/main/scala/com/horizen/network/SidechainNodeViewSynchronizer.scala
Show resolved
Hide resolved
| val sidechainTransactionApiRoute: Route = SidechainTransactionApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, mockedSidechainTransactionActorRef, | ||
| sidechainTransactionsCompanion, params).route | ||
| val sidechainWalletApiRoute: Route = SidechainWalletApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, sidechainSecretsCompanion).route | ||
| val sidechainWalletApiRoute: Route = SidechainWalletApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, null, sidechainSecretsCompanion).route |
There was a problem hiding this comment.
I guess Sergiy meant something like val sidechainWalletApiRoute: Route = SidechainWalletApiRoute(mockedRESTSettings, mockedSidechainNodeViewHolderRef, sidechainNodeViewReindexer=null, sidechainSecretsCompanion).route
to clearly understand what was nullified.
+ storage recovery changes
sdk/src/main/scala/com/horizen/network/SidechainNodeViewSynchronizer.scala
Show resolved
Hide resolved
sdk/src/main/scala/com/horizen/network/SidechainNodeViewSynchronizer.scala
Outdated
Show resolved
Hide resolved
|
hope to have collected all the cases.. see also here @i-Alex : |
742c4db to
72c16eb
Compare
This PR adds reindex feature to a sidechain node.
The reindex resets state and wallet (except the secret storage) to the initial state , then all the blocks from the history are applied again one by one to them.
Reindexing is performed in an asynch way, so that the node is not blocked during the process.
All "write" operations (send of transactions, forging, tx or blocks received by other nodes) are not executed during the reindex.
All "read" operations, including sending local blocks to other peers, are allowed.
Two new endpoints has been added to the wallet/ , to launch the reindex and get info about its progress.
Furthermore, a new debug endpoint is added only in regtest, to allow to perform step by step the reindex, for debug pourposes
If the node is stopped during reindex, it will restart from the reached height at the next restart.
Mode details here: https://www.notion.so/horizen-labs/Wallet-rescan-d2ffe9298bfd468681088977cb4095d4
related PR: HorizenOfficial/developer-horizen-global#69