Incremental verify checkpoints #4487
Open
+264
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #4454
Description
Adds
--trusted-hash-file
argument to theverify-checkpoints
command to support appending new verified checkpoints starting from the last checkpoint in the trusted hash file.Adds
--from-ledger
to support generating a verified checkpoint hash file starting from a specific ledger to LCL/specified end ledger.Design doc: https://docs.google.com/document/d/1GRzHAO4_YrfanXqoVc1UDIMhUV10PFqIMQyOxlPOW_s/edit
Usage example:
--from-ledger
:% src/stellar-core verify-checkpoints --from-ledger=53736369 --output-file=out.json --conf=../stellar-core.cfg
Result:
Append to existing file:
src/stellar-core verify-checkpoints --trusted-hash-file=out.json --output-file=out2.json --conf=../stellar-core.cfg
Result:
Usage of both
--from-ledger
and--trusted-hash-file
-> ERRORPerformance
Time for verification of checkpoints
--from-ledger=53737040
to LCL=53739327Output: hashes for checkpoints 53737023 to 53739327, total of 2304 ledgers = 2287 ledgers (from
--from-ledger=53737040
to LCL=53739327) + 13 ledgers (from checkpoint 53737023 to --from-ledger=53737040):205 seconds / 2304 ledgers = 0.09 seconds, 90 milliseconds / ledger
Caveat: There is an overhead as the LCL is obtained from the network. On average we will wait 1/2 a checkpoint (32 ledgers) to find a checkpoint boundary LCL (32 ledgers * 5 seconds = 160 seconds).
Checklist
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)