* Make BlockStore.replace_proof own its write transaction
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add failure-path test for _replace_proof; fix log wording
The except block was re-indented by the previous commit and had no
coverage. The log message said "error while adding block, rolling
back", but this path replaces a compact proof and the rollback happens
inside the store's transaction now.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Move raw hints query from FullNodeAPI into HintStore
Co-authored-by: Cursor <cursoragent@cursor.com>
* Convert hints to list for to_batches and skip empty input
to_batches only supports list and set at runtime, but
get_coin_ids_by_hints accepts any Collection[bytes]. Convert to a list
before batching, and return early on empty input to avoid opening a
read transaction for nothing.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add unit test for get_coin_ids_by_hints
Covers empty input (the early return flagged by diff-coverage),
set dedup across hints sharing a coin id, the multi-batch path via a
small SQLITE_MAX_VARIABLE_NUMBER, and tuple input.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add BlockStoreProtocol; drop consensus dependency on chia.full_node
Co-authored-by: Cursor <cursoragent@cursor.com>
* Assert isinstance directly on bc.block_store
Review feedback: drop the intermediate block_store assignment; mypy
narrows the attribute expression after the isinstance assert.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove deprecated Python analyze-chain.py in favor of Rust version
Per Arvid: this tool was ported to Rust before the hard fork.
The Python version is unmaintained.
Made-with: Cursor
* 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
<!-- 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?) -->
### 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) -->
<!-- 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?) -->
### Purpose:
This PR removes a dependency that is inappropriate and caused a
dependency loop.
<!-- 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) -->
Move `get_unresolved_peer_infos` and `set_peer_info` from
`chia.util.config` to `chia.server.resolve_peer_info.py` so that
`chia.util` no longer depends upon `chia.server`.
* Deprecate `curry-and-treehash` and replace it with `curry`.
* Reduce cost at expense of readability.
* Improvements to `curry.clib`.
* Fix comment
* Tweak names.
* change dashes to underscores
* Use macro version by quexington.
---------
Co-authored-by: Matt Hauff <quexington@gmail.com>
* Avoid importing `test_constants` as it takes a long time.
* Factor out `parse_*` functions.
* First crack at refactoring `Streamable.parse`.
* Don't add `_parse_functions` attribute to `Streamable`.
This no longer requires an extra `_parse_functions` attribute on a
`Streamable`, as it may be confusing serializers or other functions
that use `__annotations__`.
* Fix lint problems with `black`.
* Fix `parse_tuple`.
* Defer some parsing failures to parse time rather than class-creation time.
* Tidy up & remove some obsolete stuff.
* Decorate `RequestBlocks` as `streamable`.
* Fix wrong uses of Streamable class
Revert an earlier commit and error out on class creation in case a
Streamable subclass is instantiated incorrectly, e.g. containing a
non-serializable member.
Fix cases where Streamable parent class was forgotten.
* Fix wrong types when creating DerivationRecord and WalletCoinRecord
* additional unit tests for streamable parsers
* add type annotations (#3222)
Co-authored-by: Rostislav <rostislav@users.noreply.github.com>
Co-authored-by: arvidn <arvid@libtorrent.org>
* Change input to ROM to `(coin-solution-inputs . extras)`.
* Add `deserializer` to `generator_for_single_coin`.
* Fix last test.
* ROM now outputs `(coin-spends . block-level-extras)`
* Bump clvm versions and replace `((c P A))` with `(a P A)`. Again.
* Modernize some clvm.
* Fix some comments and naming in `cc.clvm`.
* Prohibit `CREATE_ANNOUNCEMENT` in inner puzzle.
* fix cc.clvm
initial commit for innerpuz announcement test
Co-authored-by: matt <matt@chia.net>
* Revert "Bump clvm versions and replace `((c P A))` with `(a P A)`."
This reverts commit d0a08d2a93.
* Bump clvm versions and replace `((c P A))` with `(a P A)`. Again.