Commit Graph

28 Commits

Author SHA1 Message Date
Mariano Sorgente
817baa3096
Bind port 0 to fix race condition when grabbing available ports (#11578)
* port 0 to fix flakiness

* Try fixing setup_full_system

* Try fixing setup_full_system, and lint

* More attempts to fix

* No more calls to get random ports in setup_nodes

* Revert accidental changes

* Timelord extra arg

* Try with port 0

* Fix daemon test, and lint

* Try without 0.0.0.0

* Back to 0.0.0.0

* Try a few timelord changes to get test running

* Increase timeout again

* Use the correct interface to get the port

* INFO logging to debug issue

* Revert "INFO logging to debug issue"

This reverts commit 7c379e5cca.

* Fix advertised port log

* Add extra log

* Logging back

* Rollback the timelord changes

* Try port 0 timelord

* Revert "Try port 0 timelord"

This reverts commit 4997faf3b2.

* Try full green, change ordering

* Remove unused var

* speed up simulation and cleanup

* Now try without the port config

* Fix a flaky call to get_event_loop

* Try getting the port dynamically

* No dynamic port

* Try changing the ordering

* Try adding a sleep

* Back to what works

* Timelord before vdf clients

* Dynamic port for 1st timelord

* Revert "Dynamic port for 1st timelord"

This reverts commit 0f322a15b7.

* Revert "Timelord before vdf clients"

This reverts commit 3286c34696.

* Revert "Back to what works"

This reverts commit 30380dffb7.

* Revert "Try adding a sleep"

This reverts commit 9212b665a6.

* Revert "Try changing the ordering"

This reverts commit a62597d70d.

* Revert "No dynamic port"

This reverts commit 5d2e15749b.

* Revert "Try getting the port dynamically"

This reverts commit ef9cd75679.

* Revert "Fix a flaky call to get_event_loop"

This reverts commit 01a000fdfb.

* Try one to 0

* Just not 0

* Don't get port dynamically

* Cleanup a bit

* Fix

* Some cleanup work

* Some cleanup work

* Fix daemon test

* Cleanup

* Remove arguments
2022-05-23 08:13:49 -07:00
Florin Chirica
370ecd4f98
Fix timelord closing. (#10630) 2022-04-20 11:10:05 -07:00
dustinface
a48fd43100
streamable: Simplify and force correct usage (#10509)
* streamable: Merge `strictdataclass` into `Streamable` class

* tests: Test not supported streamable types

* streamable: Reorder decorators

* streamable: Simplify streamable decorator and force correct usage/syntax

* streamable: Just move some stuff around in the file

* streamable: Improve syntax error messages

* mypy: Drop `type_checking.py` and `test_type_checking.py` from exclusion

* streamable: Use cached fields instead of `__annotations__`

This is now possible after merging `__post_init__` into `Streamable`

* Introduce `DefinitionError` as `StreamableError`

* `/t` -> `    `
2022-04-08 18:29:32 -07:00
Mariano Sorgente
890c7d3754
Fix remaining linting issues (#10962)
* FIx remaining linting issues

* Revert type:ignore

* Revert token_bytes change
2022-04-02 13:22:55 -07:00
Kyle Altendorf
a691d3c4b2
asyncio.get_event_loop() is deprecated in 3.10, stop using it (mostly) (#10418)
* asyncio.get_event_loop() is deprecated in 3.10, stop using it

https://docs.python.org/3.10/library/asyncio-eventloop.html#asyncio.get_event_loop
> Deprecated since version 3.10: Deprecation warning is emitted if there is no running event loop. In future Python releases, this function will be an alias of get_running_loop().

* black
2022-03-28 13:20:50 -07:00
Kyle Altendorf
50857caf8c
make multiprocessing start method configurable (#10528)
* make multiprocessing start method configurable

* forkserver

* corrections

* fixup

* optional

* more optional

* stop attempting anchors in the yaml

* rework config handling

* comment
2022-03-03 10:27:36 -08:00
Arvid Norberg
7f3b61ddb4
slight simplification of interpreting the bytes received by the timelord. avoid redundant round-trips to strings (#10316) 2022-02-24 20:58:06 -08:00
Kyle Altendorf
89740234e7
spawn (not fork) for multiprocessing (#10322)
* spawn (not fork) for multiprocessing

* just append _worker to existing process names

* return properly in getproctitle()

* black

* ignore for unhinted getproctitle()

* Add comments about the setting of the multiprocessing start method
2022-02-24 20:08:06 -08:00
Chris Marslender
5e4c1a1f62
Timelord RPC + Misc Metrics Updates/Fixes (#10255)
* Add mempool_max_total_cost to RPC

* Add signage_point event

* Fix incorrect crawler RPC port lookup

* Set up initial timelord RPC server + finished_pot_challenge event

* Add new compact proof event

* Add skipping/new_peak to track when fastest or not

* Check for None on change_data

* Add skipping_peak + new_peak to changes for metrics

* Convert chain to value

* Rename iters

* Timelord RPC to 8557 - 8556 is used in simulation tests

* Make tests work with RPC server on timelord

* Change event name to finished_pot

* Use broadcast_farmer object

* Move state changed for `finished_pot` after proofs_finished.append

* Fix type on ips var + add vdf_info and vdf_proof

* fix event name on the state_changed function
2022-02-18 07:43:52 -08:00
xchdata.io
1495d40ff3
Cosmetic: fix timelord import sort order (#9441)
As introduced by the previous commit
ae8bdbc3c7.
2022-01-10 21:01:28 -08:00
xchdata.io
af0d6385b2
Remove unused Timelord#potential_free_clients (#9680)
`Timelord`'s `potential_free_clients` attribute is no longer used
anywhere. Seems to be a left-over from a big restructuring in
bbb3d28559.
2022-01-08 19:45:22 -03:00
Kyle Altendorf
8291f0221a
Make the sized bytes types hint compatible (#9369)
* Rework sized bytes for type hinting compatibility

* add a bunch of type: ignores

* this will be handled elsewhere

* noqa E501 instead of changing code

* normalize comment plurality

* @classmethod

* Revert "@classmethod"

This reverts commit 95db80e339.

* add ignore in benchmarks

* just E501 again...

* add some new type: ignores
2021-12-02 09:43:39 -08:00
Florin Chirica
ae8bdbc3c7
Windows blueboxing. (#8394)
* Windows bluebox.
2021-12-01 11:32:49 -08:00
Chris Ross
2c4aaa1ec9
Resolve v6 addresses (#8861)
* Address deficiency discussed in #8552, add ability to resolve to IPv6
addresses for hostnames.

* If there is no prefer_ipv6 in the config, set it True (per @hoffmang9)
and write it back to config.yaml

* Pass prefer_ipv6 flag to get_host_addr, which required a little digging
for it in a few places that call get_host_addr.

* Update a couple things for consistency

* Move the load_config into Wallet's __init__ so it doesn't get called so
many times as it would in has_full_node.

* Pass None into get_host_addr if there's no preference in config, so we have only that one place where the coded default lives.  also fix an oversight where we were building a PeerInfo from a PeerInfo in some cases.

* Change the default here to match the default coded into util/network.py.  It seems that github testers can't handle trying to use IPv6 and this may be easier for average users (sadly)

* A test to see if manually creating the server on :: (IP6_ANY) lets tests connect to localhost with IPv6 on

* Revert back to IPv4 default and remove the override inserted into
TCPSite for testing.

* Don't test for ip6-localhost, as it's not on all systems.

* Bah.  Forced formatting of commented code...

* Add a type annotation for the addrset variable

* If we don't quote the socket enums, pylint gets upset because it has issues figuring out where/how they're defined.  So, quote them here.

Co-authored-by: Chris Ross <cross+chia@distal.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-11-22 14:34:03 -08:00
Kyle Altendorf
05f67167fe
Correct some type hints adjacent to bytes32 (#8957)
* Correct some type hints adjacent to bytes32

Note that these errors won't show up until the sized bytes are
rewritten to "support" hinting.  They are too dynamic at the moment.

* drop some bytes32 hints with unneeded Optional

* Apply suggestions from code review

* remove code change, this pr is hints only
2021-11-22 13:16:52 -08:00
Arvid Norberg
a29b1158ee
fix lgtm issues (#9198) 2021-11-19 11:11:25 -08:00
Chris Ross
0a2294841d
Before calling gethostbyname(); check if host is an address (#8765)
* Before calling gethostbyname(), check to see if we already have an address.
That prevents an unnecessary call, and also allows for specifying IPv6
addresses which otherwise cause exceptions here.

* Also recognize addresses when passed to timelord spawn_process, so that
IPv6 addresses can be used.

* Missed importing PeerInfo

* Adjust style to match requirements and existing code

* Cast PeerInfo port to uint16
2021-10-07 16:56:34 -07:00
Chris Marslender
d172efa3a3
Allow host to be configurable for timelord launcher (#8434)
* Let the timelord laucher connect to a configurable hostname

* Use 'host' to be more consistent with the other config sections

* Add timelord launcher host to initial config
2021-09-10 17:00:10 -07:00
beechord
a59073fc38
coordinate blueboxes better (#7175)
* bluebox: simplify handling of uncompact orphan blocks

* bluebox: fix redundant work done by blueboxes at the bottom of the chain

* bluebox: do not tarpit when the chain is nearly fully compact

Co-authored-by: beechord <@>
2021-07-12 16:54:09 -07:00
Mariano Sorgente
79bc40f1d6
Fix timelord bug (#6761)
* Fix timelord bug

* Fix lint

* Another lint fix
2021-06-15 07:07:00 -07:00
An Long
5034fcc85d
Add more types (#3441) 2021-05-12 15:32:21 -07:00
Nikolaj Kuntner
cbc9141689
add all none's (#4503)
Co-authored-by: Nikolaj Kuntner <>
2021-05-10 22:05:45 -07:00
Mariano Sorgente
615d8af00d
Add limit for AGG_SIG condition message of 1024 bytes. Catch any exception thrown in mempool block creation, and catch any excepction making a block, then make an empty block. (#2013) 2021-04-17 23:57:07 -07:00
Mariano Sorgente
d2466ee822
Ms.mempool improvements (#1823)
* Remove overflow from list, and remove useless call to handle_eos

* Unindent

* Changes to mempool

* tests

* progress on tests

* Add tests for new mempool

* Fix lint and revert streamable changes

* Improve logging

* Test level warning

* Fix test

* Increase mempool size to 150x
2021-04-13 21:19:12 -07:00
Mariano Sorgente
bee0a42714
Ms.double count (#1734)
* Found the source of the counting issue. An overflow block which is not the first
2021-04-08 00:31:58 +09:00
Mariano Sorgente
876692631a
Fix issue with error handling in timelord. Show infusion rate for all… (#1716)
* Fix issue with error handling in timelord. Show infusion rate for all timelords (even slow ones), and fix logging for rate limiting

* Fix another issue

* Further improvements in crashes, and better counting

* Don't error if we cannot infuse

* flake8

* more flake8

* Improvements for not the fastest timelord

* Don't double count

* Don't double count (again)
2021-04-06 19:48:46 -07:00
Mariano
691534f3fe Removes warnings by renaming some protocol messages. Also improves error handling for timelord. 2021-04-04 23:54:11 -07:00
Richard Kiss
f2b577dda1 git mv src chia 2021-04-04 21:41:39 -07:00