Option to revert back to sequential read (#7644)

* Option to revert back to sequential read

* reverse logic for disable

* Add parallel_read to initial-config
This commit is contained in:
Earle Lowe 2021-07-21 10:37:07 -07:00 committed by GitHub
parent 30cb11a051
commit 2d1b19d871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 4 deletions

View File

@ -54,6 +54,7 @@ class Harvester:
self.state_changed_callback: Optional[Callable] = None
self.last_load_time: float = 0
self.plot_load_frequency = config.get("plot_loading_frequency_seconds", 120)
self.parallel_read: bool = config.get("parallel_read", True)
async def _start(self):
self._refresh_lock = asyncio.Lock()

View File

@ -124,7 +124,9 @@ class HarvesterAPI:
# Found a very good proof of space! will fetch the whole proof from disk,
# then send to farmer
try:
proof_xs = plot_info.prover.get_full_proof(sp_challenge_hash, index)
proof_xs = plot_info.prover.get_full_proof(
sp_challenge_hash, index, self.harvester.parallel_read
)
except Exception as e:
self.harvester.log.error(f"Exception fetching full proof for {filename}. {e}")
self.harvester.log.error(

View File

@ -53,8 +53,10 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d
if num == 0:
return None
parallel_read: bool = config["harvester"].get("parallel_read", True)
v = Verifier()
log.info("Loading plots in config.yaml using plot_tools loading code\n")
log.info(f"Loading plots in config.yaml using plot_tools loading code (parallel read: {parallel_read})\n")
kc: Keychain = Keychain()
pks = [master_sk_to_farmer_sk(sk).get_g1() for sk, _ in kc.get_all_private_keys()]
pool_public_keys = [G1Element.from_bytes(bytes.fromhex(pk)) for pk in config["farmer"]["pool_public_keys"]]
@ -100,7 +102,7 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d
for index, quality_str in enumerate(pr.get_qualities_for_challenge(challenge)):
# Other plot errors cause get_full_proof or validate_proof to throw an AssertionError
try:
proof = pr.get_full_proof(challenge, index)
proof = pr.get_full_proof(challenge, index, parallel_read)
total_proofs += 1
ver_quality_str = v.validate_proof(pr.get_id(), pr.get_size(), challenge, proof)
assert quality_str == ver_quality_str

View File

@ -130,6 +130,9 @@ harvester:
num_threads: 30
plot_loading_frequency_seconds: 120
# If True use parallel reads in chiapos
parallel_read: True
logging: *logging
network_overrides: *network_overrides
selected_network: *selected_network

View File

@ -4,7 +4,7 @@ dependencies = [
"blspy==1.0.4", # Signature library
"chiavdf==1.0.2", # timelord and vdf verification
"chiabip158==1.0", # bip158-style wallet filters
"chiapos==1.0.3", # proof of space
"chiapos==1.0.4", # proof of space
"clvm==0.9.7",
"clvm_rs==0.1.8",
"clvm_tools==0.4.3",