Skip to content
Snippets Groups Projects
Unverified Commit 5c562f17 authored by Benjamin Loison's avatar Benjamin Loison
Browse files

Add `--verify-online-property` toggle

parent 3e1c4586
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ def get_parser():
help="Turn on debugging")
parser.add_argument("--verify-correctness", action="store_true",
help="Turn on correctness comparison")
parser.add_argument("--verify-online-property", action="store_true",
help="Turn on online property verification")
# Bitcoin block loading
parser.add_argument("--load-from-headers", action="store_true", help="Load data from headers")
......
......@@ -162,8 +162,9 @@ compressSize = []
compressScore = []
timestamps = []
previous_score = 0
previous_ℓ = 0
previous_score, previous_score_online = 0, 0
previous_ℓ, previous_ℓ_online = 0, 0
C = []
Π = []
headersNumber = bitcoin.loadHeaders(args.break_at)
for height in range(headersNumber):
......@@ -201,6 +202,12 @@ for height in range(headersNumber):
#printTimeSinceLastTimeCheck('dissolve computation')
for μ in D:
debug(bcolors.WARNING + f'μ: {μ}' + bcolors.ENDC + f', len(Π): {len(Π)}, ' + bcolors.OKGREEN + f'len(D[μ]): {len(D[μ])}' + bcolors.ENDC + f' ({[f"{b.height} ({b.level_min} - {b.level}, {round(b.score, 4)})" for b in D[μ]]})')
if args.verify_online_property:
C += [b]
Π_online, previous_score_online, previous_ℓ_online = Compress(m, k, C, previous_score_online, previous_ℓ_online)
if Π != Π_online:
print("Online property doesn't hold!")
exit(1)
#if ℓ == 2:
# break
if args.break_at:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment