Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Method needed to stop block synchronization at specified round or blockheight #119

Closed
Isabello opened this issue May 11, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@Isabello
Copy link
Contributor

In order to produce clean snapshots that can be verified a method to stop block chain synchronization is needed. Under current state block height will continue to happily sync and get blocks even after verification is complete. While this is positive for nodes running the chain, its less than optimal for nodes running for the purpose of securing and validating snapshots.

A sub function of verifyOnLoad is needed to remedy this. A new config.json entry will be required and could be either blockHeight = ### or roundHeight = ###

The loader would need to be modified to check one of these two new entries and cease processing upon recieving the specified block at the end of the round or at the block height. This way there would be no dirty records uncommited or pulled from blocks past that point. Clean backups could be taken and verified from the node state since there should be no inconsistency in records produced.

@fix
Copy link
Contributor

fix commented May 14, 2016

Actually the real issue is to be able to have a clean database whatever happens. The code is not organised clearly to do so. Otherwise the only option is to rebuild the mem_* tables from ground up at each restart.

@Isabello
Copy link
Contributor Author

So cycling the database at all can cause issues ?

@karmacoma karmacoma added ready and removed ready labels May 19, 2016
@fix
Copy link
Contributor

fix commented May 20, 2016

well the thing is that there is NO 100% sure way to actually check if the database is clean, except rebuild the mem_* from ground up and compare the results.

The only thing we can do is try to trigger a backup WHEN we think this should be ok (after flushing the mem_round for instance).

This is something to be thought in long term. To give you an idea, Bitcoin has created SPV (Simplified Payment Verification, https://en.bitcoin.it/wiki/Thin_Client_Security#Simplified_Payment_Verification_.28SPV.29_Clients), in order to perform on blockchain "100%" (ie provided no sybil or partitionning attack) sure transaction proof and not rely on internal states of bitcoin peers (which can be tampered with or simply wrong). We should think about something similar, like a STV (Simplified Transaction Verification), maybe to be included in white paper. This STV could be applied regularly on the database, cherry picking "interesting transactions" to validate its internal state. It can be applied also on "sensitive" (high amount, unknown address...) transactions validation.

cc @karmacoma @MaxKK

@fix
Copy link
Contributor

fix commented May 27, 2016

After quite a few tests, it sounds that the best place to stop is here:
https://github.com/LiskHQ/lisk/blob/7c8aedd82bf09449389a75a3dc7e21176ba98cd9/modules/delegates.js#L507

Never had to rebuild when i triggered some process exit here.

@karmacoma karmacoma modified the milestone: Version 0.3.2 Jun 14, 2016
@karmacoma karmacoma modified the milestones: Version 0.3.2, Version 0.4.0 Aug 1, 2016
@karmacoma karmacoma removed the ready label Aug 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants