Commit Graph

2947 Commits

Author SHA1 Message Date
Adam Kelly
9be3c7d00a
Ensure fee estimates monotonically decrease with time (#14368)
* Ensure fee estimates monotonically decrease with time

* Improve function naming and document use

* type checking
2023-02-06 12:53:03 -06:00
Adam Kelly
83c864b2f0
Correct fee estimate calculation to be in mojos, not millimojos (#14474) 2023-02-04 14:09:39 -06:00
Matt Hauff
d1a4c579f4
Check incoming notification hints (#14450)
* add self notification test

* add a check that hint belongs to us

* lint
2023-01-31 18:58:46 -06:00
Kronus91
655eaad639
Rename notification config (#14397)
* Rename notification config

* Change unit test

* Fix test

* Set minimum required notification amount

---------

Co-authored-by: Matt Hauff <quexington@gmail.com>
2023-01-27 17:20:34 -06:00
Matt Hauff
655f6c2292
Add a persitent id table to notification store (#14418)
* Add a persitent id table to notification store

* rename table

* Add a test

* lint
2023-01-27 17:20:01 -06:00
Matt Hauff
1d4700dceb
Add some extra checks for size and existence to notification backend (#14398)
* Add some extra checks for size and existence to notification backend

* mypy
2023-01-25 23:45:23 -06:00
Almog De Paz
3f97435159
dont announce none response capability to peers (#14386)
* dont announce none response capability to peers

* comment out none response handling

* skip test instead of comment out
2023-01-25 13:53:38 -06:00
Jeff
c107001334
Add SigningMode and update verify_signature RPC to work with sign_message_by_* RPCs (#14213)
* Updated `verify_signature` RPC to support signatures made by `sign_message_by_*` RPCs

* Updated RPC to use "signing_mode" param name with value "chip_0002"
Added CHIP_0002_SIGN_MESSAGE_PREFIX string constant

* Tests for verify_signature

* Update chia/wallet/wallet.py

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

* Adds SigningMode enum with CHIP-0002 and BLS message augmentation schemes
chia keys sign/verify support JSON output
chia keys verify now accepts the -b as_bytes option

* Fix a mypy warning

* Updated link to CHIP-0002

* isort

* Fix tests

* improve error handling

* comment how test data was generated

* Update chia/rpc/wallet_rpc_api.py

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

* Update chia/rpc/wallet_rpc_api.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-01-25 12:44:37 -06:00
Amine Khaldi
05f1d257b4
Add a unit test for sending a spend bundle twice with a different spends order (and a coin eligible for deduplication) (#14387)
Add a unit test for sending a spend bundle twice with a different spends order (and a coin eligible for deduplication).
2023-01-25 09:59:47 -06:00
Jack Nelson
99fbb056e1
Fix chia wallet coins cli bugs (#14388)
* fix fee bug

The fee should not be taken into account when dealing with CAT's or other non XCH coins.

* fix broken CAT removals

it was never implemented ...

* Update wallet_rpc_api.py
2023-01-24 19:33:25 -06:00
Amine Khaldi
69c7172152
Add a unit test for sending a spend bundle (with a coin eligible for deduplication) twice (#14374)
* Add a unit test for sending a spend bundle (with a coin eligible for deduplication) twice.

* Have spend_bundle_from_conditions take a coin that defaults to TEST_COIN.

* Improve the expected cost readability.

* Prepare get_coin_record_for_test_coins for reuse in future tests.
2023-01-24 12:04:09 -06:00
Adam Kelly
9f0220771f
Limit rate of log messages when farmer is disconnected from pool (#14344)
* Limit rate of spammy log messages when farmer is disconnected from pool

* Remove typo

* Use reliably increasing clock

* Make test faster, more reliable
2023-01-23 16:43:42 -06:00
Geoff Walmsley
b480aded31
Fix target puz hash index for bulk mint nfts with airdrop (#14370)
* fix indexing for target puzhashes in nft bulk minting

* make pylint happy
2023-01-21 13:00:31 -06:00
Kronus91
ad51c3c251
Fix bulk tx (#14372)
* 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
2023-01-20 12:02:17 -06:00
Adam Kelly
7bdf7dc478
Change names used to look up estimated spendbundle sizes in get_fee_estimate RPC (#14369)
* Change names used to look up estimated spendbundle sizes in get_fee_estimate RPC

* Update tests

* add test for get_spendbundle_type_cost

* add spend_count to get_fee_estimate

* Update chia/rpc/full_node_rpc_api.py

Co-authored-by: Jeff <jeff@chia.net>

Co-authored-by: Jeff <jeff@chia.net>
2023-01-20 11:59:08 -06:00
Matt Hauff
8e0cabad7e
Add the expected offer ID to some RPCs that take offer blobs (#14366)
* Add the exected offer ID to some RPCs that take offer blobs

* Add ID to client too

* black
2023-01-20 11:58:23 -06:00
Adam Kelly
0f2995e4a1
Move table of SpendBundle costs to backend (#14367) 2023-01-19 15:39:35 -06:00
dustinface
a91265ffff
tests: Drop unused PeerInfos (#14122) 2023-01-19 15:37:41 -06:00
Geoff Walmsley
443875e945
Enable setting time between blocks in full node sim (#14310)
remove the reset on time_per_block in full node sim
2023-01-19 15:32:46 -06:00
Adam Kelly
5ba71957d8
Display complete exception info in log file (#14319)
* Display complete exception info in logfile

* Update mempool tests

* Update mempool tests
2023-01-19 15:31:26 -06:00
Kronus91
35b6738c49
Nft bulk transfer (#14329)
* Add NFT bulk transfer API

* Fix pre-commit

* Improve unit test

* Fix precommit

* Improve unit test

* Fix response json serialization
2023-01-19 13:21:04 -06:00
Matt Hauff
8bb8ae5fea
Add a wallet RPC for converting heights to timestamps (#14357)
* Add a wallet RPC for converting heights to timestamps

* flake8
2023-01-18 13:55:06 -06:00
Sebastjan Trepca
c7eeaa64e6
fix offer cancel balance (#14342) 2023-01-13 18:47:07 -06:00
Adam Kelly
d83c93bb2b
It is okay to return a result in some cases when median == -1 (#14285)
* It is okay to return a result in some cases when median == -1. These cases are handled in the call to parse()

* Remove incorrect test
2023-01-13 16:09:40 -06:00
Amine Khaldi
5303c0eecc
Add a unit test for mempool unknown unspent check (#14341)
Add a unit test for mempool unknown unspent check.
2023-01-13 12:51:24 -06:00
Adam Kelly
e59666b319
Improve command line info display for fee estimation (#14336)
* Improve command line info display for fee estimation

* Update test
2023-01-13 12:23:22 -06:00
Adam Kelly
06eb18217e
Test get_bucket_index (#14294)
* Test get_bucket_index

* Apply epsilon to test constants

* Simplify get_bucket_index
2023-01-13 11:16:23 -06:00
Arvid Norberg
0f9e4ee41a
infrastructure for upcoming soft-fork (#14302)
soft-fork infrastructure
2023-01-12 03:08:59 -06:00
Amine Khaldi
2f5bbd6875
Add a unit test for mempool reserve fee check (#14323)
Add a unit test for mempool reserve fee check.
2023-01-12 01:09:53 -06:00
Arvid Norberg
0ce46bc566
disallow empty SpendBundles in the mempool (#14305)
* disallow empty SpendBundles from being added to the mempool

* Update chia/full_node/mempool_manager.py

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
2023-01-10 18:57:12 -06:00
Arvid Norberg
ff3bb5c72e
optimize mempool's potential cache (#14297)
split potential cache into conflict- and pending cache. The pending cache can be organized more efficiently and can have higher capacity
2023-01-10 18:56:50 -06:00
Amine Khaldi
85ff27f9fa
Add a unit test for mempool minting coin check (#14314)
Add a unit test for mempool minting coin check.
2023-01-09 15:28:31 -06:00
dustinface
390b0f677f
tests: Use set literal in test_subscriptions.py (#14311) 2023-01-09 14:41:58 -06:00
Adam Kelly
b71eaa0a8e
Call method to process transactions added to mempool in Fee Estimator (#14290) 2023-01-06 14:18:52 -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
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
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
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
Amine Khaldi
5974f04257
Remove redundant check for duplicate inputs (#14272)
Remove redundant check for duplicate inputs.
2023-01-04 11:17:00 -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
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
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
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
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