The wallet sync path holds WalletStateManager.lock for the duration of
sync. When _add_coin_states discovers a DataLayer launcher and no
DataLayer wallet exists yet, it called
get_dl_wallet(create_if_not_found=True), which re-acquires the same
non-reentrant asyncio.Lock, deadlocking the sync task. Create the
wallet directly at the sync call site instead, leaving get_dl_wallet
unchanged for RPC callers.
Regression from #20320 (baf8bd05c0).
* [LABS-480] Remove interested_ph_cache and initialize coin cache in init
* [LABS-481] Remove unnecessary `server` field from WSM
* [LABS-486] Remove useless `add_transaction` from WSM
* [LABS-488] Extract signing functionality to its own module
* Test coverage
* Generate Wallet RPC
* Comment by @cursor
* fix test
* executable bit
* Comments by @cursor & fix tests
* Fix tests
* Fix tests
* Comments by @cursor
* test coverage
* Add pre-commit build for wallet stubs
* Comments by @cursor
* Comments by @cursor
* Comments by @cursor
* Comments by @cursor
* Port `get_coin_records` and `get_height_info` to `@marshal` decorator
* Remove executable bits?
* Comments by @cursor
* Comments by @cursor
* Add comment at top of .pyi file
Drop always-true metadata guard in DID CLI test helper
metadata is typed dict[str, str] with an empty-dict default, so the
None check was unreachable and tripped mypy's redundant-expr check.
* [LABS-470] Fix mismatching Wallets with WalletProtocol
* [LABS-471] Remove contravariant from WalletProtocol
* [LABS-472] Remove some `has/getattr` in favor of `runtime_checkable` protocols
* [LABS-473] Fix `clvm_streamable` to prevent typing through wrapping
* [LABS-474] Make sure `crcat` is always bound
* [LABS-475] Fix basedpyright errors
* Comments by @cursor
* fix tests
* remove trade_store from mypy exclusions
* some easy wallet_rpc_api fixes
* Another easy fix for WalletRpcAPI
* [LABS-476] Make CATWallet subclassing less problematic
* Comment by @cursor
* fix tests
* Remove puzzle_for_pk methods as unused
* Port `chia wallet notifications` to `@chia_command` framework
* Comments by @cursor
* Add parsing tests
* Fix tests
* Add context for AddressParamType
* Comments by @cursor
* Port `chia wallet vcs` to `@chia_command` framework
* Add context for AddressParamType
* Remove old CLI test
* [LABS-189] Port `chia wallet did` to `@chia_command`
* Fix tests
* Fix tests
* Comments by @cursor
* Comments by @cursor
* Comments by @cursor
* Test coverage
* Fix tests
* Comments by @cursor
* bad merge
* [LABS-480] Remove interested_ph_cache and initialize coin cache in init
* [LABS-481] Remove unnecessary `server` field from WSM
* [LABS-486] Remove useless `add_transaction` from WSM
* also remove `unlink_db`
* Port `chia wallet notifications` to `@chia_command` framework
* Comments by @cursor
* Add parsing tests
* Fix tests
* Add context for AddressParamType
* Comments by @cursor
* Port `chia wallet vcs` to `@chia_command` framework
* Add context for AddressParamType
* Remove old CLI test
* Fix tests
* Test coverage
* Comments by @cursor
* test coverage
* Comment by @cursor
* Comment by @cursor
* Comments by @cursor
* Test coverage
* 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>
* Add Bugbot consensus review context
Document the validation-state and sub-epoch-summary invariant so automated PR review has the same consensus context as local agents.
* Route Bugbot to repository context docs
Keep Bugbot guidance focused on subsystem context routing so automated reviews use the same module map as local agents.
* Add generated repository context docs
Include the expanded module context map and route Bugbot to the same subsystem docs used by local agents.
* Add EDC agent context pointer
Include the generated EDC agent guidance alongside the Cursor agent context docs.
* Fold EDC guidance into AGENTS
Keep agent context entrypoints consolidated in AGENTS.md and remove the separate EDC pointer.
* Remove generator name from agent guidance
Keep AGENTS.md focused on repository context locations rather than the tooling used to produce them.
* Consolidate context corpus into one source-verified canonical set
- Normalize all subsystem docs to canonical names without chia- prefix,
removing the split between old and new-dominant corpora.
- Merge new-dominant content into consensus.md, full-node.md, wallet.md;
split networking.md into server.md, protocols.md, apis.md; add types.md.
- Rename 15 genuinely-new subsystem docs; fold chia-root.md into
architecture-overview.md.
- Remove filter-branch leakage (filter_challenge, predictable filter,
protocol 0.0.38) from types.md, protocols.md, harvester.md.
- Correct factual inaccuracies: /push_tx vs wallet queue semantics,
Err sign/ban policy, protocol import-time coverage, server peer-serving,
address-manager mutation rule, wallet tx-store rollback, ValidationState
speculative advancement, block-creation default, MempoolItem fallback.
- Replace unreachable verification SHA with PR-head commit.
- Consolidate test guidance into one small router plus 12 on-demand
testing/ docs; remove duplicate auto-attached test guides.
- Make INDEX.md the authoritative routing manifest; update BUGBOT.md,
AGENTS.md, and context-routing.mdc to reference one canonical corpus.
- Replace context-chia-*.mdc rules with canonical narrow rules; remove
recursive .cursor/** rule and consolidate duplicate tooling rules.
- Tighten clvm-execution.md: remove stale cost_calculator.py reference,
fix block-creation default, replace opcode catalogue with pointer.
* Trim redundant context and testing docs after value audit
- Trim benchmarks.md: remove per-script Workload Groups narration that is
obvious from opening each script; keep fidelity, coupling, and fragility
sections.
- Trim testing/patterns.md: slim to the module-by-module setup map and
layered-assertion list; remove block/tx/assertion how-to that duplicates
per-area testing docs.
- Trim testing/full-node.md: slim to starter template and sync-convergence
tip; remove fixture list and assertion patterns duplicated by patterns.md
and architecture.md.
- Fold testing/service-wiring.md per-cluster correlation details into
testing/architecture.md; delete service-wiring.md (high overlap with
architecture.md).
- Fix protocols.md: correct NewSignagePointHarvester2 message-ID wording
(ID reassigned to 66, not literally the same ID).
- Update INDEX.md and testing-guide.mdc router to reflect service-wiring.md
removal.
* Fix verification SHA to reference the main source baseline
The docs were verified against source at PR base 24db9ad390 (origin/main),
not a5647a9327 (the original PR head, which only adds context docs and is
not a meaningful source baseline). The chia/ source tree is identical across
both commits since the PR changes no production code.
* Fix remaining V2 filter-branch leakage in harvester.md and types.md
- harvester.md: replace calculate_effective_plot_filter_bits() and
calculate_min_plot_strength() (filter-branch-only) with the actual main
source path: calculate_prefix_bits() with NUMBER_ZERO_BITS_PLOT_FILTER_V2
and height adjustments, then passes_plot_filter(); strength bounds checked
by check_plot_param() against MIN_PLOT_STRENGTH/MAX_PLOT_STRENGTH.
- harvester.md: use meta_group (actual PartialProofsData field name) instead
of "meta group".
- types.md: correct that candidate height feeds prefix-bit reductions for
both V1 and V2, not just V1; calculate_prefix_bits() branches on V1/V2
constants and height thresholds.