Skip to content

Commit

Permalink
merge main into testnet7 (#3534)
Browse files Browse the repository at this point in the history
* 2 harvesting features (#3331)

* 3 harvesting features:
- Debug level shows the time for every quality lookup
- Warning level if takes longer than 5 seconds
- Allow configuration of plot loading interval (default 2 minutes)

* Comment out super logging

* Improve wallet consistency (#3305)

* Improve wallet consistency

* Improve CLI significantly, and fix self-tx balances

* Fix await

* Fix deadlock and test

* Remove spam.sh

* Changelog for 1.1.3 (#3345)

* Changelog for 1.1.3

* minor updates

* updates part 3

* Those engineers who don't update changelogs... :)

* Apologies to @Chida82 who added log rotate count! (#3369)

* Rust parse serialized (#3444)

* use rust implementation for finding length of a serialized clvm program

* bump clvm_rs version

* Don't retry respond_peers message (#3508)

Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: Gene Hoffman <30377676+hoffmang9@users.noreply.github.com>
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
  • Loading branch information
4 people committed May 3, 2021
1 parent 2ae4031 commit 3f1b9ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
19 changes: 11 additions & 8 deletions chia/server/ws_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def inbound_handler(self):
self.log.error(f"Exception Stack: {error_stack}")

async def send_message(self, message: Message):
""" Send message sends a message with no tracking / callback. """
"""Send message sends a message with no tracking / callback."""
if self.closed:
return
await self.outgoing_queue.put(message)
Expand Down Expand Up @@ -346,13 +346,16 @@ async def _send_message(self, message: Message):
f"peer: {self.peer_host}"
)

async def wait_and_retry(msg: Message, queue: asyncio.Queue):
try:
await asyncio.sleep(1)
await queue.put(msg)
except Exception as e:
self.log.debug(f"Exception {e} while waiting to retry sending rate limited message")
return
# TODO: fix this special case. This function has rate limits which are too low.
if ProtocolMessageTypes(message.type) != ProtocolMessageTypes.respond_peers:

async def wait_and_retry(msg: Message, queue: asyncio.Queue):
try:
await asyncio.sleep(1)
await queue.put(msg)
except Exception as e:
self.log.debug(f"Exception {e} while waiting to retry sending rate limited message")
return

asyncio.create_task(wait_and_retry(message, self.outgoing_queue))
return
Expand Down
8 changes: 4 additions & 4 deletions chia/types/blockchain_format/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from clvm.casts import int_from_bytes
from clvm.EvalError import EvalError
from clvm.operators import OP_REWRITE, OPERATOR_LOOKUP
from clvm.serialize import sexp_buffer_from_stream, sexp_from_stream, sexp_to_stream
from clvm_rs import STRICT_MODE, deserialize_and_run_program
from clvm.serialize import sexp_from_stream, sexp_to_stream
from clvm_rs import STRICT_MODE, deserialize_and_run_program, serialized_length
from clvm_tools.curry import curry, uncurry

from chia.types.blockchain_format.sized_bytes import bytes32
Expand Down Expand Up @@ -148,8 +148,8 @@ class SerializedProgram:

@classmethod
def parse(cls, f) -> "SerializedProgram":
tmp = sexp_buffer_from_stream(f)
return SerializedProgram.from_bytes(tmp)
length = serialized_length(f.getvalue()[f.tell() :])
return SerializedProgram.from_bytes(f.read(length))

def stream(self, f):
f.write(self._buf)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"chiabip158==1.0", # bip158-style wallet filters
"chiapos==1.0.1", # proof of space
"clvm==0.9.6",
"clvm_rs==0.1.6",
"clvm_rs==0.1.7",
"clvm_tools==0.4.3",
"aiohttp==3.7.4", # HTTP server for full node rpc
"aiosqlite==0.17.0", # asyncio wrapper for sqlite, to store blocks
Expand Down

0 comments on commit 3f1b9ff

Please sign in to comment.