Commit Graph

3556 Commits

Author SHA1 Message Date
dustinface
40ef694160
server: Drop outdated config update (#14592) 2023-03-06 15:58:40 -06:00
Adam Kelly
e31429c540
Move startup / shutdown logging to INFO (#14546) 2023-03-06 14:01:57 -06:00
Earle Lowe
6e140f24fb
simplify and improve daemon connection handling (#14662)
* simplify daemon connection handling

* Add tests

* return list of service names during removal

* set remove raises KeyError

* Better test type hints

* Add types and code refactor

* fix test typos

* small type adjustments

* test code improvements

* Better error handling for bad json

* handle proper but unexpected JSON values

* Update chia/daemon/server.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* test improvements

* check for empty thing equivalence

* Improved logging for ConnectionReset

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-03-06 12:49:38 -06:00
Kyle Altendorf
e5edbd9b3d
fix DataStore.get_tree_generation() detection of no generations (#14721)
* fix DataStore.get_tree_generation() detection of no generations

* revert unwanted change
2023-03-06 12:17:30 -06:00
Kyle Altendorf
542522e39d
hint chia.cmds.plotnft, plotnft_funcs (#14737) 2023-03-06 11:42:29 -06:00
Kyle Altendorf
31c25d7e78
hint chia.cmds.keys, keys_funcs (#14735) 2023-03-06 11:37:49 -06:00
Kyle Altendorf
96638628ff
hint chia.cmds.farm_funcs (#14734) 2023-03-06 11:37:21 -06:00
Kyle Altendorf
2c000a45eb
correct Announcement.__str__() to present hex (#14740)
A hash is quite unlikely to be valid UTF-8 data and even if it does decode it seems unlikely to be a useful representation.
2023-03-05 16:00:37 -06:00
Chris Marslender
db6bf72af3
Listen on ::0 so we can respond to both ipv4 and ipv6 (#14731)
* Listen on ::0 so we can respond to both ipv4 and ipv6

* Move the initial sleep to the end of the first attempt to load reliable peers, so that if we already have a database, it doesn't take 60 seconds to start responding
2023-03-03 19:59:54 -06:00
Sebastjan Trepca
a38da21ebd
no duplicate offers, handle conflict offers correctly (#14722)
* no duplicate offers, handle conflict offers correctly

* don't sync every offer with a bad spend, only pending ones
2023-03-03 15:13:39 -06:00
Arvid Norberg
9e8dae67b2
Bump chia_rs to 0.2.3. and ASSERT_MY_BIRTH_* (#14720)
* bump chia_rs to version 0.2.3

* add new error codes for assert_my_birth_*

* add new condition codes for ASSERT_MY_BIRTH_*

* add logic for ASSERT_MY_BIRTH_* conditions
2023-03-03 15:12:37 -06:00
Earle Lowe
2d721ec8bb
Quick fix to some hostname problems (#14725) 2023-03-03 15:05:02 -06:00
Arvid Norberg
c7301693e1
sqlite-backed mempool (#14657)
* implement Mempool using an in-memory sqlite database

* remove_from_pool with empty list is a no-op

* the order is not important in get_coin_records_by_puzzle_hash() or get_block_spends()

* use format string in log statement

* make MempoolItem not streamable, to improve performance of creating objects
2023-03-03 15:04:21 -06:00
Adam Kelly
341ecd6f9e
Fix Pool Wallet check for invalid state (#14711) 2023-03-01 14:20:44 -06:00
Arvid Norberg
8618ef0f52
Soft fork2 tests (#14712)
* use shorter names in test-ephemeral-coin test parameters

* use shorter names in TestConditions to make the test easier to read

* user shorter names in test_blockchain test_ephemeral_timelock, to make the test easier to read

* extend test_ephemeral_timelock to cover soft-fork 2

* extend test_conditions to cover soft-fork 2
2023-03-01 14:19:55 -06:00
Kyle Altendorf
f29eb44ffc
update mypy.ini (#14706) 2023-02-28 16:59:33 -06:00
Zachary Brown
c8149c4b28
Refine help text for chia peer -a (#14563)
* update help text for chia peer -a

* further chia peer -a language refinement
2023-02-28 14:26:03 -06:00
Kronus91
4accec4108
Extend did_find_lost_did API (#14673)
* Add NFT bulk transfer API

* Fix pre-commit

* Improve unit test

* Fix precommit

* Improve unit test

* Fix response json serialization

* Fix bulk API missing transaction

* Remove print

* Add get_transaction_memo API

* Add unit test for XCH

* Cover received coins

* Add parameter override

* Check old wallet

* Add address brute force

* Fix log
2023-02-28 13:11:28 -06:00
dependabot[bot]
cae628ccf7
Bump setproctitle from 1.2.3 to 1.3.2 (#13920)
* Bump setproctitle from 1.2.3 to 1.3.2

Bumps [setproctitle](https://github.com/dvarrazzo/py-setproctitle) from 1.2.3 to 1.3.2.
- [Release notes](https://github.com/dvarrazzo/py-setproctitle/releases)
- [Changelog](https://github.com/dvarrazzo/py-setproctitle/blob/master/HISTORY.rst)
- [Commits](https://github.com/dvarrazzo/py-setproctitle/commits)

---
updated-dependencies:
- dependency-name: setproctitle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* setproctitle has type hints now

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-02-28 12:26:50 -06:00
dustinface
fe321ea488
daemon: Fix server shutdown / wait for it (#14674)
* Create the shutdown event inside `WebSocketServer.__init__`

* Rename `WebSocketServer.start` to `run` and make it a contextmanager
2023-02-28 11:43:24 -06:00
Kyle Altendorf
3a5c1a5bd5
hint chia.harvester.harvester, harvester_api (#14690)
* hint chia.harvester.harvester

* hint chia.harvester.harvester_api
2023-02-28 11:42:58 -06:00
Kyle Altendorf
0ed70fd534
hint chia.plotting.check_plots (#14691)
* hint chia.plotting.check_plots

* use the hints
2023-02-28 11:42:39 -06:00
Kyle Altendorf
c29dc05d8b
hint chia.pools.pool_config (#14693) 2023-02-28 11:42:20 -06:00
Kyle Altendorf
377e95319a
hint chia.protocols.pool_protocol (#14695) 2023-02-28 11:42:00 -06:00
Kyle Altendorf
44c836f4d4
hint chia.rpc.crawler_rpc_api (#14696) 2023-02-28 11:41:36 -06:00
Kyle Altendorf
ef22a207e4
hint chia.rpc.farmer_rpc_api, client (#14697) 2023-02-28 11:41:15 -06:00
Kyle Altendorf
12ddc928c2
gc.collect() before unlinking the db in some tests (more) (#14702)
https://github.com/Chia-Network/chia-blockchain/pull/14491
https://github.com/python/cpython/issues/97641
2023-02-28 11:40:17 -06:00
Kyle Altendorf
c5d7339bd5
hint chia.farmer.farmer (#14687)
* hint chia.farmer.farmer

* we will update mypy.ini later
2023-02-28 03:05:08 -06:00
Kyle Altendorf
0940b5920a
hint and dataclass chia.daemon.keychain_server (#14686)
* hint and dataclass chia.daemon.keychain_server

* we will update mypy.ini later
2023-02-28 03:04:34 -06:00
Kyle Altendorf
381d1317de
hint chia.cmds.init, chia.cmds.init_funcs (#14682)
* hint chia.cmds.init, chia.cmds.init_funcs

* optional for now at least

* we will update mypy.ini later
2023-02-28 03:04:08 -06:00
Kyle Altendorf
4243603b3a
hint chia.cmds.db_upgrade_func (#14680)
* hint chia.cmds.db_upgrade_func

* we will update mypy.ini later
2023-02-28 03:03:47 -06:00
Kyle Altendorf
e0005ce6f9
hint chia.cmds.db (#14679)
* hint chia.cmds.db

* we will update mypy.ini later
2023-02-28 03:03:21 -06:00
Kyle Altendorf
73eb73bd4c
hint chia.cmds.configure (#14678)
* hint chia.cmds.configure

* we will update mypy.ini later
2023-02-28 03:02:53 -06:00
Kyle Altendorf
91a717b5f3
add hinting around get_any_service_client() (#14681) 2023-02-27 23:49:47 -06:00
Adam Kelly
94b60f153f
Improve chia wallet check help and diagnostic messages (#14688) 2023-02-27 16:51:34 -06:00
Adam Kelly
0a6856b498
Fix a DID Wallet issue where an old DID coin causes us to assert during wallet creation (#14668)
* wip

* Change test to reflect current DID Wallet operation

* Typecheck case where we do not know parent yet.
2023-02-27 16:48:10 -06:00
Arvid Norberg
5a5cb2e58e
simplify fee estimator by not leaking MempoolItem into its interface (#14685) 2023-02-27 16:34:11 -06:00
Amine Khaldi
37fcafa0d3
Separate mempool item's JSON response value from the internal structure (#14476)
* Separate mempool item's JSON response value from the internal structure.

* Call recurse_jsonify() on the members.
2023-02-27 13:17:49 -06:00
Arvid Norberg
e195d268fb
simplify the mempool filter to only pass in the spend_bundle name (#14665)
simplify the mempool filter to only pass in the spend_bundle name. That's the only thing we use
2023-02-27 12:57:32 -06:00
Kyle Altendorf
3943b3ee8b
write service groups as lists instead of splitting strings (#14664) 2023-02-27 12:57:03 -06:00
Kyle Altendorf
2b96a33c26
correct rate limiting of rate limit log message (#14659) 2023-02-27 12:56:34 -06:00
Arvid Norberg
60dacd9f36
remove some redundant fields from MempoolItem (#14652) 2023-02-27 12:56:06 -06:00
Kyle Altendorf
ff5ef6e073
remove leading newlines from indented code blocks (#14653)
* remove leading newlines from indented code blocks

* catch another one
2023-02-23 21:53:48 -06:00
Kronus91
9dcba09dda
Extend sign API to support hex string (#14448)
* Extend sign API to support hex string

* handle string input

* Resolve comments

* Fix pre-commit
2023-02-23 21:52:57 -06:00
Amine Khaldi
7b6785cb33
Annotate chia/rpc/full_node_rpc_api.py (#14658)
Annotate chia/rpc/full_node_rpc_api.py.
2023-02-23 10:43:42 -06:00
Kyle Altendorf
f2a6d8decf
drop trailing commas in unpacking assignment (#14655) 2023-02-23 10:43:14 -06:00
Kyle Altendorf
96dad39392
remove unneeded parentheses (#14654) 2023-02-23 10:42:44 -06:00
dustinface
c098ee9166
full_node: Rename some receive/respond prefixes to add (#14458)
* full_node: Rename `FullNode.resond_block` to `FullNode.add_bock`

The naming `respond_block` is confusing here imo, we have a full node
API method called `respond_block` but here in the `FullNode` class this
method is there to try adding a block to the full nodes's chain so i
think `add_block` is the better choice?

Also change the `respond_block: full_node_protocol.RespondBlock`
parameter to `block: FullBlock` which lets us get rid of many
`full_node_protocol.RespondBlock` wrappings.

* `FullNode.receive_block_batch` -> `FullNode.add_block_batch`

* `receive_unfinished_block` -> `add_unfinished_block` + change parameter

* `FullNode.respond_transaction` -> `FullNode.add_transaction`

* `FullNode.respond_end_of_sub_slot` -> `FullNode.add_end_of_sub_slot`

* `FullNode.respond_compact_vdf` -> `FullNode.add_compact_vdf`

* `respond_compact_proof_of_time` -> `add_compact_proof_of_time`

* `respond_transaction_semaphore` -> `add_transaction_semaphore`
2023-02-23 10:28:29 -06:00
Amine Khaldi
b019fe5962
Introduce BlockRecordProtocol as a subset of BlockRecord that the mempool manager uses for peak (#14628)
* Introduce BlockRecordProtocol as a subset of BlockRecord that the mempool manager uses for peak.

* Create BenchBlockRecord and use it for benchmarks/mempool.py.

* PR #14611 didn't land yet (keep 3.7 support for now).

* We don't need this guidance anymore.
2023-02-23 01:04:47 -06:00
dustinface
66d53f415d
wallet: Access trusted_peers with a default (#14643) 2023-02-22 17:16:57 -06:00