From 8b400d73fd554605bc33a298fdcc39b7b53cb735 Mon Sep 17 00:00:00 2001 From: Richard Kiss Date: Wed, 30 Oct 2019 14:46:37 -0700 Subject: [PATCH 1/5] Use lib version of prompt-toolkit. --- README.md | 1 - requirements.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 2189a7fd9ff5..154a2444e212 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ python3 -m venv .venv pip install wheel pip install . pip install lib/chiapos -pip install lib/python-prompt-toolkit cd lib/chiavdf/fast_vdf # Install libgmp, libboost, and libflint, and then run the following diff --git a/requirements.txt b/requirements.txt index 47b45e9652ac..cc2a65a05a5e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,6 @@ parso==0.5.1 pexpect==4.7.0 pickleshare==0.7.5 pluggy==0.13.0 -prompt-toolkit==3.0.0 ptyprocess==0.6.0 py==1.8.0 pybind11==2.4.3 @@ -47,3 +46,4 @@ typing-extensions==3.7.4 wcwidth==0.1.7 zipp==0.6.0 -e lib/aiter +-e lib/python-prompt-toolkit From 0ed21a4991052ff192097f29880ff7c077d8b3eb Mon Sep 17 00:00:00 2001 From: Richard Kiss Date: Wed, 30 Oct 2019 14:59:27 -0700 Subject: [PATCH 2/5] Use map_aiter instead of parallel_map_aiter. --- lib/aiter | 2 +- src/server/server.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/aiter b/lib/aiter index 81163c4e1066..106916a9493d 160000 --- a/lib/aiter +++ b/lib/aiter @@ -1 +1 @@ -Subproject commit 81163c4e1066c9e4320ef818a8f540a7bac97301 +Subproject commit 106916a9493dfe3f237cfaba252b409e0204b152 diff --git a/src/server/server.py b/src/server/server.py index a9bad9cb2c9e..c80dc03db2dd 100644 --- a/src/server/server.py +++ b/src/server/server.py @@ -5,7 +5,6 @@ from typing import Tuple, AsyncGenerator, Callable, Optional, List, Any, Dict from aiter.server import start_server_aiter from aiter.map_aiter import map_aiter from aiter.join_aiters import join_aiters -from aiter.parallel_map_aiter import parallel_map_aiter from aiter.iter_to_aiter import iter_to_aiter from aiter.aiter_forker import aiter_forker from aiter.push_aiter import push_aiter @@ -139,16 +138,16 @@ class ChiaServer: handshake_finished_2 = forker.fork(is_active=True) # Reads messages one at a time from the TCP connection - messages_aiter = join_aiters(parallel_map_aiter(self.connection_to_message, handshake_finished_1, 100)) + messages_aiter = join_aiters(map_aiter(self.connection_to_message, handshake_finished_1, 100)) # Handles each message one at a time, and yields responses to send back or broadcast - responses_aiter = join_aiters(parallel_map_aiter( + responses_aiter = join_aiters(map_aiter( partial_func.partial_async_gen(self.handle_message, api), messages_aiter, 100)) # Uses a forked aiter, and calls the on_connect function to send some initial messages # as soon as the connection is established - on_connect_outbound_aiter = join_aiters(parallel_map_aiter(self.connection_to_outbound, + on_connect_outbound_aiter = join_aiters(map_aiter(self.connection_to_outbound, handshake_finished_2, 100)) # Also uses the instance variable _outbound_aiter, which clients can use to send messages # at any time, not just on_connect. @@ -158,7 +157,7 @@ class ChiaServer: outbound_aiter_mapped])) # For each outbound message, replicate for each peer that we need to send to - expanded_messages_aiter = join_aiters(parallel_map_aiter( + expanded_messages_aiter = join_aiters(map_aiter( self.expand_outbound_messages, responses_aiter, 100)) # This will run forever. Sends each message through the TCP connection, using the From b03ce1c783079ff88a021c7e571eca4d24150ab1 Mon Sep 17 00:00:00 2001 From: Richard Kiss Date: Wed, 30 Oct 2019 15:10:09 -0700 Subject: [PATCH 3/5] Update aiter version. --- lib/aiter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aiter b/lib/aiter index 106916a9493d..2da160c58f84 160000 --- a/lib/aiter +++ b/lib/aiter @@ -1 +1 @@ -Subproject commit 106916a9493dfe3f237cfaba252b409e0204b152 +Subproject commit 2da160c58f848e2d67d57912eef59a8e8a62eacf From fae863af377b5a82546b7f6a89dee58e0a89b401 Mon Sep 17 00:00:00 2001 From: Richard Kiss Date: Wed, 30 Oct 2019 15:25:19 -0700 Subject: [PATCH 4/5] Improve installation a bit. --- README.md | 5 ++--- requirements.txt | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 154a2444e212..65443e473f05 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,8 @@ sudo apt-get install build-essential cmake python3-dev --no-install-recommends git submodule update --init --recursive python3 -m venv .venv . .venv/bin/activate -pip install wheel -pip install . -pip install lib/chiapos +pip install -e . +pip install -r requirements.txt cd lib/chiavdf/fast_vdf # Install libgmp, libboost, and libflint, and then run the following diff --git a/requirements.txt b/requirements.txt index cc2a65a05a5e..de2d1bbfc0d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,8 +7,6 @@ bitstring==3.1.6 blspy==0.1.11 cbor2==4.1.2 cffi==1.13.1 -chiablockchain==0.1.2 -chiapos==0.2.2 cppimport==18.11.8 cryptography==2.8 decorator==4.4.0 @@ -46,4 +44,5 @@ typing-extensions==3.7.4 wcwidth==0.1.7 zipp==0.6.0 -e lib/aiter +-e lib/chiapos -e lib/python-prompt-toolkit From 2b3236e10103d0868003a85b9d3d48938bf28dfc Mon Sep 17 00:00:00 2001 From: Florin Chirica Date: Thu, 31 Oct 2019 17:40:29 +0200 Subject: [PATCH 5/5] Remove pulmark for now in VDF --- lib/chiavdf/fast_vdf/vdf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chiavdf/fast_vdf/vdf.h b/lib/chiavdf/fast_vdf/vdf.h index be275fd09320..fb79a5718b1b 100644 --- a/lib/chiavdf/fast_vdf/vdf.h +++ b/lib/chiavdf/fast_vdf/vdf.h @@ -114,7 +114,7 @@ public: } void reduce(form& inf) { -#if 0 +#if 1 // Old reduce from Sundersoft form inf.reduce(); #else @@ -433,7 +433,7 @@ struct Proof { std::vector proof; }; -#define PULMARK 1 +#define PULMARK 0 form GenerateProof(form &y, form &x_init, integer &D, uint64_t done_iterations, uint64_t num_iterations, uint64_t k, uint64_t l, WesolowskiCallback& weso, bool& stop_signal) { auto t1 = std::chrono::high_resolution_clock::now();