Commit graph

10192 commits

Author SHA1 Message Date
Adam Kelly
b9bef03714
If self.last_mempool_info is not yet set, return an empty FeeMempoolInfo, rather than None (#14282)
* If self.last_mempool_info is not yet set, return an empty FeeMempoolInfo, rather than None

* Initialize last_mempool_info early
2023-01-06 11:57:36 -06:00
Adam Kelly
1ecdb40c13
Use better check that we are on mainnet when deciding to use default Chia DNS server (#14254)
Use a better check for if we are on mainnet when using the default chia dns introducer
2023-01-06 11:56:14 -06:00
Earle Lowe
0a0c8920ff
Add a daemon heartbeat setting to config.yaml (#13886)
* make daemon heartbeat configurable and increase default

* Fix up daemon rpc test

* Fix dumb error with parameters

* Restore formatting

* Various updates from feedback

* Update tests/core/test_daemon_rpc.py

use config value for heartbeat

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

* black fixes

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-01-06 11:55:20 -06:00
Arvid Norberg
c74689dbbe
bump chia_rs dependency to the latest version (#14289) 2023-01-06 11:45:11 -06:00
dustinface
4c94f5f415
wallet: Drop duplicate puzzle hashes assert (#14287)
While #14187 fixes duplicated entries in new DBs, existing DBs still 
contain them and will trigger this assert so lets remove it again.
2023-01-05 20:19:36 -06:00
dustinface
c9b34bcc3e
wallet: Some simplifications in WalletNode.long_sync (#14185)
* Simplify puzzle hash subscribing

* Simplify coin id subscribing

* Use the result of `chunks` in the loop definition

* Calculate the duration in place

* Filter before split to chunks and update the already checked at the end

* Adjust empty set check
2023-01-05 19:54:47 -06:00
Adam Kelly
820493ffa8
Add new_block_height to FeeEstimatorInterface (#14277)
* Add new_block_height to FeeEstimatorInterface

* Fancy-up create_test_block_record, rename test

* Integrate new interface method
2023-01-05 15:34:53 -06:00
Kyle Altendorf
e1c986435a
return failure if mempool manager has no peak (#14274)
* ignore spend bundle if mempool manager has no peak

* return a failure status
2023-01-05 15:25:46 -06:00
Kyle Altendorf
92c2bd5b49
use config.get("trusted_peers", {}) for wallet (#14273) 2023-01-05 15:25:25 -06:00
Arvid Norberg
a5397ec0c3
factor out coin- and PH subscription handling in order to add unit tests (#14222)
* factor out coin- and PH subscription handling in order to add unit tests

* address review comments

* fixup rebase. test_simple_sync_protocol.py
2023-01-05 15:24:58 -06:00
dustinface
51fd1d8792
wallet: Don't add derived puzzle hashes to the WalletInterestedStore (#14187)
* wallet: Don't add derived puzzle hashes to the `WalletInterestedStore`

We already use the derived puzzle hashes when we subscribe to the node 
here 
39d733599d/chia/wallet/wallet_node.py (L1291). 
I assume this was done to make sure we subscribe to new puzzle hashes 
but at the end it leads to redundant entries in `derivation_paths` vs 
`interested_puzzle_hashes` so we can just subscribe here instead? If we 
want to keep them in both tables for some reason we may at least get rid 
of `get_puzzle_hashes_to_subscribe` and use the ones from the interest 
store only and maybe adjust the other related methods?

* See if there are duplicates in tests
2023-01-05 10:59:47 -06:00
Matt Hauff
4d482f6105
Add a height timestamp for wallet notifications (#14163)
* Add a height timestamp for wallet notifications

* import sqlite3

* lint

* isort

* catch specific error

* Add a test for db backcompat

* Add a test for correct height

* mypy
2023-01-05 10:58:38 -06:00
Adam Kelly
d658de4e08
Refactor get_bucket_index (#14270) 2023-01-05 10:56:23 -06:00
William Allen
f3a709e5e8
Fix GITHUB_OUTPUT in build workflows (#14276) 2023-01-05 00:38:59 -06:00
William Allen
0673cb624c
checkpoint: into main from release/1.6.2 @ ba1ff12b31 (#14265)
Source hash: ba1ff12b31
Remaining commits: 0
2023-01-04 19:08:13 -06:00
Amine Khaldi
5974f04257
Remove redundant check for duplicate inputs (#14272)
Remove redundant check for duplicate inputs.
2023-01-04 11:17:00 -06:00
Kyle Altendorf
83900d7147
use .get("testing", False) to avoid errors when missing (#14267)
https://github.com/Chia-Network/chia-blockchain/issues/14239
2023-01-03 20:50:58 -06:00
Adam Kelly
8364166de1
Add MempoolRemoveReason, which represents why we are removing a MempoolItem (#14263)
* Add MempoolRemoveReason, which represents why we are removing a MempoolItem

* Add integration tests for remove_from_pool. Generalize call count tracking in mock Fee Estimator.
2023-01-03 17:08:18 -06:00
Kyle Altendorf
559e58a47b
close websocket in ssl tests to avoid event loop closed errors (#14242) 2023-01-03 15:00:07 -06:00
dustinface
34dfdc262c
wallet: Drop unused WalletNode.get_coins_with_puzzle_hash (#14182) 2023-01-03 14:59:39 -06:00
Kyle Altendorf
026d4671af
add cache to speed up manage_clvm/clvm_hex pre-commit check (#14177)
* add cache to speed up manage_clvm/clvm_hex pre-commit check

* Update tools/manage_clvm.py

* add version to cache along with handling of incorrect versions

* force skipping the cache in ci
2023-01-03 14:59:09 -06:00
Amine Khaldi
3a8ffb1b47
Merge commit 'ba1ff12b31f8fea600e8ee2058bf472e211f1f7a' into checkpoint/main_from_release_1.6.2_ba1ff12b31f8fea600e8ee2058bf472e211f1f7a 2023-01-03 21:06:52 +01:00
William Allen
c826aec84e
checkpoint: into main from release/1.6.2 @ 85982974b3 (#14264)
Source hash: 85982974b3
Remaining commits: 1
2023-01-03 14:06:29 -06:00
Amine Khaldi
becd04ed25
Merge commit '85982974b360d28f77d8f97deeb2bf6594e24664' into checkpoint/main_from_release_1.6.2_85982974b360d28f77d8f97deeb2bf6594e24664 2023-01-03 21:02:54 +01:00
William Allen
ba1ff12b31
update changelog (#14147)
* Update changelog

* Changelog updates

* Minor update

* Add release date for 1.6.2

* Revert "Changelog updates"

This reverts commit 333e55f84a.

* undo historical changes

* Adding 1.6.2 change edits

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-01-03 13:32:22 -06:00
Kyle Altendorf
85982974b3
Force coverage==7.0.1 (#14255) (#14262)
Lots of failures in coverage processing.

https://github.com/Chia-Network/chia-blockchain/actions/runs/3825220672/jobs/6508036405#step:16:558
```python-traceback
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pluggy/_callers.py", line 55, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pytest_cov/plugin.py", line 297, in pytest_runtestloop
INTERNALERROR>     self.cov_controller.finish()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>     return meth(self, *args, **kwargs)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pytest_cov/engine.py", line 338, in finish
INTERNALERROR>     self.cov.stop()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/control.py", line 797, in combine
INTERNALERROR>     message=self._message,
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/data.py", line 158, in combine_parallel_data
INTERNALERROR>     new_data.read()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 815, in read
INTERNALERROR>     with self._connect():
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 342, in _connect
INTERNALERROR>     self._open_db()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 285, in _open_db
INTERNALERROR>     self._read_db()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 302, in _read_db
INTERNALERROR>     assert row is not None
INTERNALERROR> AssertionError
```

(cherry picked from commit 5fe05bd3a9)
2023-01-03 12:24:49 -06:00
Kyle Altendorf
5fe05bd3a9
Force coverage==7.0.1 (#14255)
Lots of failures in coverage processing.

https://github.com/Chia-Network/chia-blockchain/actions/runs/3825220672/jobs/6508036405#step:16:558
```python-traceback
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pluggy/_callers.py", line 55, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pytest_cov/plugin.py", line 297, in pytest_runtestloop
INTERNALERROR>     self.cov_controller.finish()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>     return meth(self, *args, **kwargs)
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/pytest_cov/engine.py", line 338, in finish
INTERNALERROR>     self.cov.stop()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/control.py", line 797, in combine
INTERNALERROR>     message=self._message,
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/data.py", line 158, in combine_parallel_data
INTERNALERROR>     new_data.read()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 815, in read
INTERNALERROR>     with self._connect():
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 342, in _connect
INTERNALERROR>     self._open_db()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 285, in _open_db
INTERNALERROR>     self._read_db()
INTERNALERROR>   File "/home/runner/work/chia-blockchain/chia-blockchain/venv/lib/python3.7/site-packages/coverage/sqldata.py", line 302, in _read_db
INTERNALERROR>     assert row is not None
INTERNALERROR> AssertionError
```
2023-01-03 09:36:14 -06:00
Kyle Altendorf
d53f249e5c
only send_to_all(), drop send_to_all_except() (#14229)
* only send_to_all(), drop send_to_all_except()

* catch up tools/ as well

* add default
2023-01-02 21:39:11 -06:00
Almog De Paz
18c95da752
add local max subscription config (#14188)
* add local max subscription config

* add and use trusted wallet config
tests

* lint

* unused import

* break early

* dont break because we need to iterate for hints

* fix off by one

* lint
2023-01-02 21:38:38 -06:00
Adam Kelly
d48e65e749
Fix fee estimator being re-created every block (#14175)
* Hold a ref to the fee estimator when the Mempool is destroyed and re-created. Unify the sharing of information between Mempool and MempoolManager

* Adjust tests to new Mempool create interface

* Store dynamic Mempool info in the FeeEstimator and static info in the Mempool

* Adjust tests

* Restore logging of block cost % calculation to use documented full block size

* Omit check for nil self.last_mempool_info

* Annotate Mempool members

* Add integration test for add_mempool_item

* Annotate types in BitcoinFeeEstimator class
2023-01-02 15:02:10 -06:00
Kyle Altendorf
8ea3f93339
use adjusted_timeout() for simulator helpers (#14221) 2022-12-23 11:34:42 -06:00
Kyle Altendorf
6e315e147a
allow more sqlite thread safety than the minimum we require (#14215)
https://docs.python.org/3.11/library/sqlite3.html#sqlite3.threadsafety

extracted from https://github.com/Chia-Network/chia-blockchain/pull/11407
2022-12-23 11:34:10 -06:00
Kyle Altendorf
3056db616c
use default_factory= for SpendableCAT mutable defaults (#14214)
extracted from https://github.com/Chia-Network/chia-blockchain/pull/11407
2022-12-23 11:33:42 -06:00
Amine Khaldi
7cba58eb00
Remove redundant check for maximum block CLVM cost (#14212)
Remove redundant check for maximum block CLVM cost.
2022-12-23 11:33:02 -06:00
Kyle Altendorf
64c57fdd78
fully hint test_pool_rpc (#14204) 2022-12-23 11:32:35 -06:00
Amine Khaldi
5d31f2679e
check_removals() doesn't need to be async (#14199)
check_removals() doesn't need to be async.
2022-12-23 11:32:06 -06:00
Adam Kelly
407c0ba4a4
Fixes the case when a fee estimation request is made before the FullNode has initialized a peak (#14193)
* Fixes the case when a fee estimation request is made before the FullNode has initialized a peak

* Clarify code by setting defaults early

* Only spawn one full node in test
2022-12-23 11:31:44 -06:00
Kyle Altendorf
b8068a856d
wait for wallet sync in test_wallet_coinbase_reorg() and test_wallet_tx_reorg() (#14202) 2022-12-22 00:12:50 -06:00
Kyle Altendorf
ccfaca8060
make wallet rpc client wallet id parameters accept int, not str (#14200)
* make wallet rpc client wallet id parameters accept int, not str

* Update chia/cmds/wallet_funcs.py
2022-12-22 00:12:33 -06:00
Kyle Altendorf
cb6c5fc17f
improve adjusted_timeout() to handle floats and None (#14198) 2022-12-21 23:59:36 -06:00
Amine Khaldi
a802007936
Remove redundant check for duplicate outputs (#14195)
Remove redundant check for duplicate outputs.
2022-12-21 23:59:17 -06:00
Kyle Altendorf
f2d99f6195
Add py310 to the black target version (#14159) 2022-12-21 23:58:35 -06:00
William Allen
8bf2d2ff3f
Updating PR template & adding exclusion tags (#14055)
* Updating PR template & adding exclusion tags

* Updating PR Template, and additional release note filtering label
2022-12-21 11:31:51 -06:00
Jeff
187e2648b5
Bump chia-blockchain-gui to c76d0dc6ddda0cfae729e66022daa69a55292f16 (#14205)
Includes:
NFT search/filtering and multiselect
Refactoring of the NFT LRU cache
Bump Electron to 20.3.8
"Wallet Connect" --> "WalletConnect" renaming
Many ESLint fixes
2022-12-21 11:18:42 -06:00
Kyle Altendorf
1d42886721
hint RpcClient.create() return type (#14197) 2022-12-20 14:11:10 -06:00
Earle Lowe
3140c223bd
TechDebt: add get_name to WalletProtocol (#13995)
* add get_name to WalletProtocol

* remove async from did_wallet::get_name

* Return "Standard Wallet" for get_name
2022-12-20 13:26:06 -06:00
Kyle Altendorf
55f5e371b3
Block and transaction processing helpers (#11535)
* Block and transaction processing helpers

* flake8

* more and hints

* More

* separate tests of the simulator from tests using the simulator

* move fixture to conftest

* amounts are uint64

* remove unneeded while loop

* backoff instead of fixed sleep times

* .farm_blocks() only forces tx blocks when needed

* fix test_wallet_create_hit_max_send_amount

* fix test_wallet_tx_reorg

* fix test_address_sliding_window

* rename to farm_blocks_to_wallet

* rename to farm_rewards_to_wallet

* undo changes to protocol endpoints

* reword farm_blocks_to_wallet() loop

* rename process_blocks() to farm_blocks_to_puzzlehash() for now

* timeouts

* debug

* debug

* debug... for 3,7

* fix

* up timeout per block to 2 seconds

* increase transaction processing default timeout

* make debug maybe ok to leave around

* tidy

* intersperse sleeps again for wallet progression

* remove debug code

* review tidy

* cheat on uint64() type

* Update tests/simulation/test_simulator.py

* another import fix

* more fixes

* farm_blocks_to_puzzlehash

* more

* tweak

* fix the two-tx-blocks-instead-of-one dilemma

thanks to almog for figuring this out

* fix

* fixup

* rework since it was still broken on 3.7/3.8...

* oops

* yucky timeout

* more timeout

* cleanup todos

* add balance assertion after reorg before resubmission processing

* Apply suggestions from code review

* rename funds to expected_confirmed_balance

* catchup
2022-12-19 16:40:58 -06:00
William Allen
8d8983275e
checkpoint: into main from release/1.6.2 @ 30b9173eb2 (#14179)
Source hash: 30b9173eb2
Remaining commits: 0
2022-12-19 12:58:29 -06:00
Arvid Norberg
a9b3e25d2a
bump default bladebit version to 2.0.1 in install-plotter.sh (#14181) 2022-12-19 10:55:28 -06:00
Kyle Altendorf
419342ed22
reorder gui install command instructions in install.sh/ps1 (#14180)
* reorder gui install command instructions in install.sh

* reorder gui install command instructions in Install.ps1
2022-12-19 10:55:07 -06:00