Commit Graph

30 Commits

Author SHA1 Message Date
Kyle Altendorf
ba3ac20c55
fix checking of matrix.configuration.checkout_blocks_and_plots (#15454)
* fix checking of matrix.configuration.checkout_blocks_and_plots

* enable more blocks and plots downloading
2023-06-29 20:48:50 -05:00
dustinface
49140b2b3c
server: Introduce ApiProtocol (#15466)
* server: Introduce `ApiProtocol`

* genericize (#5)

* `ApiProtocol.api_ready` -> `ApiProtocol.ready()`

* Add `ApiProtocol.log` and give APIs separate loggers

* Fix `CrawlerAPI`

* Drop some unrelated removals

* Fix some of the generic hinting

* Revert some changes in `timelord_api.py`

* Fix `CawlerAPI` readiness

* Fix hinting

* Get some `CrawlerAPI` coverage

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-06-13 20:12:25 -05:00
Arvid Norberg
00a3647643
optimize Mempool.add_to_pool() (#14988)
* optimize at-capacity check in mempool.add_to_pool() by only computing the total cost once and remove all items in a single call

* use sqlite logic

* add test for Mempool.add_to_pool() when it's full
2023-04-07 12:09:46 -05:00
Kyle Altendorf
a42bf49050
catch up with mypy 1.1.1 (#14767) 2023-03-07 11:34:07 -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
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
Arvid Norberg
5a5cb2e58e
simplify fee estimator by not leaking MempoolItem into its interface (#14685) 2023-02-27 16:34:11 -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
Arvid Norberg
60dacd9f36
remove some redundant fields from MempoolItem (#14652) 2023-02-27 12:56:06 -06:00
Arvid Norberg
ed8cee2b4b
Mempool private implementation (#14593)
* fix test asserts to not require the same object, just the same value

* make Mempool's implementation private and give it a public interface

* fixup test that used to count fee *levels* but now count transactions
2023-02-22 12:26:04 -06:00
Arvid Norberg
b48c91618f
require npc_result to be set in mempool items added to the mempool (#14624) 2023-02-21 12:25:22 -06:00
Amine Khaldi
98d4436f95
Merge commit '9be3c7d00ae99105c40913aff1b07e97657609fb' into checkpoint/main_from_release_1.7.0_9be3c7d00ae99105c40913aff1b07e97657609fb 2023-02-07 21:33:21 +01:00
Amine Khaldi
4ec43caf20
Merge commit '83c864b2f099afcbf93845d9e720a523d11a3eaa' into checkpoint/main_from_release_1.7.0_83c864b2f099afcbf93845d9e720a523d11a3eaa 2023-02-07 17:13:18 +01:00
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
97230ca3b0
Add a way to import a SpendSim and SimClient as a contextmanager (#14434) 2023-01-31 19:22:06 -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
Adam Kelly
0f2995e4a1
Move table of SpendBundle costs to backend (#14367) 2023-01-19 15:39:35 -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
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
Adam Kelly
b71eaa0a8e
Call method to process transactions added to mempool in Fee Estimator (#14290) 2023-01-06 14:18:52 -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
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
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
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
Adam Kelly
2762490fd1
Create logger object in module instead of passing it in (#14173) 2022-12-16 20:52:47 -06:00
Adam Kelly
5cbc415589
Preserve correct MempoolItem block height when rebuilding mempool (#13951) 2022-11-21 16:28:48 -06:00
Amine Khaldi
73acfc7409
Don't hold removals twice in mempool items as they're already part of the underlying spend bundle. (#13694) 2022-11-01 15:41:23 -05:00
Adam Kelly
73e9d15cf7
Fee estimation. (#13645) 2022-10-18 09:12:22 -05:00