Commit Graph
186 Commits
Author SHA1 Message Date
Almog De PazandGitHub 4e36460622 get_flags, fix pre_sp_tx_block, test CHIA-3861 (#20400)
* get_flags, fix pre_sp_tx_block, test

* genesis case for get_flags

* block height for flags below fork
2026-01-15 09:37:48 -08:00
Amine KhaldiandGitHub de04bacd67 Cherry-pick CHIA-3866 Prioritize trusted peers in FullNodeAPI's send_transaction (#20407)
PR #20401.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Implements peer-aware transaction submission with prioritization and
proper back-pressure handling.
> 
> - Change `send_transaction` to `send_transaction(request, peer, *,
test=False)` with `peer_required=True` in API metadata
> - Prioritize trusted peers when enqueueing; include `peer_id` in queue
put; catch `TransactionQueueFull` and return `TransactionAck` with
FAILED and "Transaction queue full"
> - Update stubs and numerous tests/helpers to pass a `WSChiaConnection`
peer (e.g., use `add_dummy_connection[_wsc]`/`connect_and_get_peer`);
adjust helper signatures to accept `peer`
> - Add test to verify correct `TransactionAck` when a peer's
transaction queue is full
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ba926a6ae7. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-15 09:37:18 -08:00
Amine KhaldiandGitHub 1e0bc4d153 CHIA-3844 Advertise requested mempool transactions instead of sending them (#20314)
Advertise requested mempool transactions instead of sending them.
2025-12-04 09:38:16 -08:00
8315f62ae6 Import check_time_locks() and CoinRecord (#19848)
* initial commit

* fix int to bool map

* another int bool map

* cast error to Err class

* cast to Err in a couple other places

* remaining couple

* ruff

* inline coinstore bool

* typing fixes

* import directly from rust and remove legacy file

* fix lingering ref to coinrecord

* another outdated import

* ruff

* typping fix

* minor simplifications

* Fix test

* fix import merge

* address comments

* undo coin_store change

---------

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
Co-authored-by: Matt <quexington@gmail.com>
2025-11-26 12:48:42 -08:00
Amine KhaldiandGitHub cbd7a5c875 CHIA-3817 Make TransactionQueue's put synchronous (#20292)
Make TransactionQueue's put synchronous.
2025-11-24 15:11:34 -08:00
Matt HauffandGitHub 40db4635a8 [LABS-245] Enable PEP604 Ruff rules (#20269)
* Enable PEP604 Ruff rules

* Fix harcoded signature in test

* Hack CLVMStreamable test with note to fast follow
2025-11-18 12:34:00 -08:00
Amine KhaldiandGitHub c3d9dbcf28 CHIA-3802 Simplify tx_request_and_timeout and make it iterate over a dynamic list of peers with transactions (#20257)
Simplify tx_request_and_timeout and make it iterate over a dynamic list of peers with transactions.
2025-11-18 09:54:58 -08:00
Amine KhaldiandGitHub 8f5a7e0a0d CHIA-3799 It's not reasonable to advertise a new transaction with zero cost (#20231)
It's not reasonable to advertise a new transaction with zero cost.
2025-11-15 10:53:30 -08:00
Arvid NorbergandGitHub 38d2d9f2d0 make sure to pass in the correct previous transaction block height (#20237)
* make sure to pass in the correct previous transaction block height to get_flags_for_height_and_constants()

* review comments
2025-11-14 16:29:51 -06:00
Richard KissandGitHub ec35492946 Api stubs (#19979)
* harvester_api_protocol

* move to apis

* Remove `chia.apis` => `chia.harvester` dependency.

* Remove circular dependencies between `chia.apis` and service modules.

* SolverAPIStub, and add solver to tach.toml.

* Make the stubs (lack of) implementations more consistent.

* Use `stub_metadata_for_type` instead of `class_for_type`.

The only thing ever used from `ApiProtocol` in `WSConnection`
was the metadata field, so let's pass along only that.

* NewSignagePointHarvester2

* remove some stuff
2025-11-12 09:06:12 -07:00
Arvid NorbergandGitHub 5664516dda Bump chia rs 0.34.0 (#20226)
bump chia_rs to 0.34.0
2025-11-10 17:02:10 -07:00
Arvid NorbergandGitHub ece6de2af5 [CHIA-3795] change v1 plot phase-out (#20216)
* change v1 plot phase-out to not affect required iters, and to be quantized to epoch blocks

* disable hard-fork 2 tests until we have a new test cache

* fix rate limits test

* address review comments
2025-11-06 09:36:29 -07:00
Amine Khaldi bae4615a57 Make sure the fee and cost specified in a NewTransaction match the ones from validating its spend bundle. 2025-10-29 11:47:25 +01:00
Amine KhaldiandGitHub a332befda6 CHIA-3788 Simplify tx_request_and_timeout by converting it from a closure into a FullNode class method (#20186)
Simplify tx_request_and_timeout by converting it from a closure into a FullNode class member.
2025-10-23 09:55:28 -07:00
Amine KhaldiandGitHub 480a060f24 CHIA-3779 Make sure the costs and fees match when a peer notifies us of a new transaction that we saw already (#20140) 2025-10-17 07:20:54 -07:00
Arvid NorbergandGitHub 3519265e36 [CHIA-3717] improve logging of NO_OVERFLOWS_IN_FIRST_SUB_SLOT_NEW_EPOCH (#20016)
improve logging of NO_OVERFLOWS_IN_FIRST_SUB_SLOT_NEW_EPOCH
2025-09-03 09:25:28 -07:00
Matt HauffandGitHub a803dc0fa6 [CHIA-3633] August 2025 pass of Ruff linting rules (#19929)
* Enable Ruff `PLR1704` (`redefined-argument-from-local`)

* Enable Ruff `PLR5501` (`collapsible-else-if`)

* Enable Ruff `PLW2901` (`redefined-loop-name`)

* bad change

* Enable Ruff `RUF043` (`pytest-raises-ambiguous-pattern`)

* Enable Ruff `RUF046` (`unnecessary-cast-to-int`)

* Enable Ruff `RUF052` (`used-dummy-variable`)

* Remove unused ignore `UP006`

* One mis-signaled regex

* Comments by @altendky

* bad change, my bad
2025-08-11 14:39:12 -07:00
cac84b5e05 Simplify BlockStore (#19880)
* Simplify `BlockStore`

* Update chia/full_node/block_store.py

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>

---------

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>
2025-07-31 20:35:54 -05:00
Kyle AltendorfandGitHub 7a26610e8f less pre-inting for ints (#19853) 2025-07-23 13:18:04 -07:00
matt-o-howandGitHub 9f8ba79ac8 Use chia_rs in API instead of clvm (#19803)
* initial commit

* fix precommit errors

* test passing

* ruff

* remove SpendInfo and mempool_check_conditions

* no need to call it _rust now

* fix mempool test

* fix precommit errors

* fix test generator tools

* add comment about impending chia_rs fix
2025-07-15 08:34:45 -07:00
Arvid NorbergandGitHub dac837e799 bump chia_rs (#19802) 2025-07-10 16:12:29 -05:00
Richard KissandGitHub 4f03890871 chia/full_node/signage_point.py -> chia/consensus/signage_point.py (#19706) 2025-06-12 11:14:27 -07:00
6050235bdb [CHIA-3043] Add (hopefully) non-controversial ruff rules (#19684)
* Add (hopefully) non-controversial ruff rules

* mypy-exclusions.txt

* PIE

* Fix pre-commit?

* PYI

* RSE

* S + ignores

* Whitespace fix

* Re-add build-init-files.py

* Add comment about security ignores

* Update mypy-exclusions.txt

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

* Fix the executable status of build-init-files.py

* Set executable bit for tools/run_block.py and readd shebang

* Fix new errors

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-06-11 08:36:08 -07:00
9289a05f12 New pos format (#19616)
* bump chia_rs

* update db_graftroot test

* refactor new pos format

* fix merge

* fix import

* fix missing param in test

* merge fixes/review fixes

* test prev_tx_block

* ermove double line

* # TODO: todo_v2_plots

* fix conftests monkeypatch

* fix spelling

* remove redundant merge code

* move prev_tx test

* add not impemented test to proof of space v2

* merge duplication fix

* fix typo, raise dont assert

* bump protocol, phase out test

* integer math

* add overflow case to test

---------

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
2025-06-10 11:27:17 -07:00
Almog De PazandGitHub a50f2c3c8e Bump chia rs >=0.25, <0.26 (#19685)
* bump_chia_rs

* update to use size()

* lint

* remove redundant imports
2025-06-05 15:07:08 -07:00
Arvid NorbergandGitHub 2b7a453e38 promote block-creation setting to user-facing (#19545)
* make the mempool block creation more configurable

* update tests to cover both block creation functions
2025-06-02 10:39:04 -05:00
Almog De PazandGitHub afd5427ce8 CHIA-2823 move sp broadcast (#19654)
* move sp broadcast

* refactor to avoid double calls

* move up
2025-05-30 09:51:36 -07:00
Richard KissandGitHub a803d18c3b The chia.protocols module no longer depends upon chia.server. (#19636)
<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->

The modules `chia.protocols` and `chia.server` form a dependency loop.
This change at least removes the direct dependency of `chia.protocols`
on `chia.server`.

### Purpose:

<!-- Does this PR introduce a breaking change? -->

### Current Behavior:

### New Behavior:

<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->

### Testing Notes:

<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->
2025-05-29 09:24:29 -07:00
c0410e97ec Bump chia rs >=0.24, <0.25 (#19615)
* bump chia_rs

* update db_graftroot test

* update SerializedProgram and Program use, to accommodate new chia_rs interface

* review comments

* review comments

---------

Co-authored-by: Matthew Howard <m.o.howard97@gmail.com>
2025-05-29 09:24:08 -07:00
Richard KissandGitHub 1a0eb383dc Remove dependency chia.types so chia.util no longer depends on it (#19633)
* Move chia.util.full_block_utils to chia.full_node.full_block_utils

* chia.util.generator_tools => chia.consensus.generator_tools

* chia.util.vdf_prover => chia.simulator.vdf_prover

* Move 'chia.util.condition_tools' to 'chia.consensus'.
2025-05-27 09:03:23 -07:00
Kyle AltendorfandGitHub 4a65e3a6b0 move tx processing queue entry classes (#19536) 2025-04-25 13:15:18 -05:00
Almog De PazandGitHub d10e665dbd use index when fetching SP (#19527)
* use index when fetching SP

* lint

* refactor redudant code

* refactor

* comment
2025-04-24 10:24:56 -05:00
Amine KhaldiandGitHub 6824b11ba0 CHIA-2743 Synchronous block generator creation (#19505)
Synchronous block generator creation.
2025-04-24 10:24:42 -05:00
Kyle AltendorfandGitHub fcd20ce543 more chia_rs directly (#19520)
* more `chia_rs` directly

* maybe

* undo, kinda
2025-04-21 14:05:05 -05:00
Arvid NorbergandGitHub 88d3fefa69 validate block generator created by the debug RPC (#19519)
* validate block generator created by the debug RPC

* address missing test coverage

* more logging. Don't limit block cost by cost header in test RPC
2025-04-21 10:21:49 -05:00
Kyle AltendorfandGitHub 1911044e97 use chia_rs directly for more types (#19475)
* use chia_rs directly for more types

* more more

* undo submodule change...
2025-04-18 11:45:44 -05:00
raceroleandGitHub 631215624c chore: fix some comments (#19293)
chore: fix comment

Signed-off-by: racerole <jiangyifeng@outlook.com>
2025-04-16 10:07:08 -05:00
Arvid NorbergandGitHub cf17f20ccf [CHIA-2052] Compressed blocks (#19270)
* introduce create_block_generator2() to mempool, which picks transactions and compresses them incrementally, allowing us to fill blocks even when compressing

* improve test, comment and pragma no cover

* fix mempool test

* simplify item selection logic in create_block_generator2()

* add test coverage of timeout in create_block_generator2()

* address review comments

* fixup
2025-03-27 12:42:46 -05:00
Arvid NorbergandGitHub 9147629b78 NewBlockGenerator as an extension of BlockGenerator (#19390) 2025-03-19 11:37:16 -07:00
RigidityandGitHub 4ae44855b1 Include removals in declare_proof_of_space (#19364) 2025-03-11 10:10:20 -07:00
Arvid NorbergandGitHub a7a81a567f cache get_unspent_lineage_info() (#19335)
* no need to pass get_unspent_lineage_info_from_puzzle_hash function into create_bundle_from_mempool(), we already have it as a member now

* cache results from get_lineage_info_for_puzzle_hash()
2025-03-04 09:05:41 -08:00
Kyle AltendorfandGitHub c57dea6512 use chia_rs directly for reward chain block (#19336) 2025-03-04 09:04:38 -08:00
Arvid NorbergandGitHub 9ba6c0407b address issue introduced in #19207 (#19328)
address issue introduced in #19207 where empty transaction blocks would not have None transactions_block_generator
2025-03-04 08:42:03 -06:00
Kyle AltendorfandGitHub dd01af2c2b use chia_rs directly for pool target (#19332) 2025-03-03 09:34:02 -08:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Earle LoweEarle LoweKyle Altendorf
d7e2358a32 build(deps): bump ruff from 0.8.5 to 0.9.6 (#19260)
* build(deps): bump ruff from 0.8.5 to 0.9.6

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.5 to 0.9.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.8.5...0.9.6)

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

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

* Update source to ruff 0.9.6

* Apply suggestions from code review

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

---------

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>
Co-authored-by: Earle Lowe <30607889+emlowe@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-02-27 09:53:34 -08:00
Kyle AltendorfandGitHub fb6b78ef07 use chia_rs directly for foliage (#19308) 2025-02-25 11:33:25 -08:00
Kyle AltendorfandGitHub e446d6b726 use chia_rs directly for sized ints (#19303)
* use chia_rs directly for sized ints

* Update data_layer_rpc_api.py
2025-02-24 14:33:09 -08:00
Arvid NorbergandGitHub 0f35f707bd create_block_generator refactor (#19207)
* make item_inclusion_filter optional and move it to the end with default None, to simplify calls

* move block generator creation into the Mempool class

* update benchmark

* add test
2025-02-13 19:20:45 -07:00
Almog De PazandGitHub 59583e75ef Assert height to hash in contains block (#19136)
* add assertions

* use_height_if_available

* use try_block_record

* fix recursion

* handle none

* remove assert

* remove assert

* use try in wallet blockchain

* fix height o and height to hash in augmented

* get_correct_block_for_fork

* remove debug code

* use try_block_record

* check main chain againt undelying blockchain

* pass augmented in tests

* lint

* revert changes to wallet blockchain

* remove redundant comment

* lint

* remove debug message

* revert bad merge

* make height mandatory

* make height mandatory

* use try_block_record

* fix unfinished test

* remove from hh, test contains block

* fix test

* fix mock and cache
2025-02-11 07:18:52 -07:00