feat: surface block_hash in rpc get_live_cell - #680
Merged
eval-exec merged 5 commits intoAug 4, 2026
Conversation
Bump the ckb dependency stack to the 1.1/1.2 wave so ckb-jsonrpc-types 1.2.0 is resolved. That release adds a top-level `block_hash` field to CellWithStatus (upstream nervosnetwork/ckb#5269); since `rpc get_live_cell` serializes the raw CellWithStatus, the field now appears in the output. Cargo.lock-only dependency moves (the existing caret requirements already permitted these): - ckb-jsonrpc-types 1.0 -> 1.2.0 - ckb-types -> 1.1.3, ckb-fixed-hash -> 1.1.1 (schemars 0.8 -> 1.x) - ckb-sdk 5.0 -> 5.1.0 ckb-jsonrpc-types 1.2.0 also adds From impls directly into packed::* types, which collide with ckb-cli's own conversions and break type inference at .map(Into::into) sites. Disambiguate by naming the packed target type explicitly (src/utils/rpc/types.rs, src/subcommands/molecule.rs).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates ckb-cli’s CKB dependency stack to pick up the ckb-jsonrpc-types CellWithStatus change (adding top-level block_hash in get_live_cell), and resolves new trait-impl/type-inference collisions introduced by the updated crates.
Changes:
- Bump the ckb-* dependency stack (notably
ckb-jsonrpc-typesto 1.2.0,ckb-typesto 1.1.x,ckb-sdkto 5.1.0) and updateCargo.lockaccordingly. - Disambiguate
.map(Into::into)sites by explicitly selecting packed target types in RPC/molecule conversion code. - Add an
Unreleasedsection to the changelog documenting the user-visible change.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/utils/rpc/types.rs | Adds explicit Into::<packed::...>::into targets to avoid new From impl ambiguities after the dependency bump. |
| src/subcommands/molecule.rs | Same explicit Into::<packed::...>::into disambiguation for raw transaction conversion. |
| CHANGELOG.md | Documents the new block_hash field behavior and the dependency stack bump under Unreleased. |
| Cargo.lock | Updates the resolved dependency graph for the new ckb-* / schemars ecosystem versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
security-audit fails on anyhow 1.0.86 (RUSTSEC-2026-0190, unsound Error::downcast_mut after Error::context). This advisory is pre-existing — anyhow 1.0.86 was already in the lock on develop — and was surfaced by the recently-published advisory, not introduced by this PR. Bump anyhow to 1.0.104 (the caret range already permitted it), which clears the advisory and lets `cargo deny check advisories` pass with 0 errors.
Update the ckb node version used by `make integration` and `make integration-spec` from v0.204.0 to v0.209.0. v0.209.0 is the release line that includes the get_live_cell block_hash field (nervosnetwork/ckb#5269), so integration tests now exercise a node that returns it.
Collaborator
Author
|
@chenyukang I think this PR is ready to merge. |
ckb 0.209.0 emits a `Terminal` RPC module in ckb.toml, which the test
crate's ckb-app-config pin (">=1.0, <1.2", resolved to 1.1.0) could not
parse, panicking in test/src/setup.rs modify_ckb_toml during node setup.
Relax the pin to "1" so the test crate resolves to the 1.2 wave
(ckb-app-config 1.3.0, which has the Terminal variant), matching the
main crate. test/Cargo.lock is gitignored (CI regenerates it); no source
changes are needed — the test crate compiles and passes strict clippy
under the 1.2 wave (verified by simulating the CI linters flow).
chenyukang
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CKB PR nervosnetwork/ckb#5269 added a top-level
block_hashfield to theCellWithStatusresponse ofget_live_cell. This bumps ckb-cli onto ackb-jsonrpc-typesversion that includes it (1.2.0), sorpc get_live_cell— which serializes the rawCellWithStatus— now returnsblock_hash.Why this is a stack bump, not a one-liner
ckb-jsonrpc-types1.2.0 moved to schemars 1.x, sockb-fixed-hash/ckb-typesmust move with it — a single crate can't be bumped in isolation. This migrates the whole ckb-* stack from the 1.0 wave → 1.1/1.2 wave (caret ranges inCargo.tomlalready permitted this; onlyCargo.lockchanged):ckb-jsonrpc-types1.0 → 1.2.0ckb-types→ 1.1.3,ckb-fixed-hash→ 1.1.1 (schemars 0.8 → 1.x)ckb-sdk5.0 → 5.1.0ckb-sdkhas not published a release explicitly aligned to the 1.2/schemars-1.x wave yet (latest is 5.1.0, March 2026). It accepts the bump via caret ranges and compiles, but was not originally built/tested against this wave.Source fix
1.2.0 also adds
Fromimpls directly intopacked::*types, which collide with ckb-cli's own conversions and break type inference at.map(Into::into)sites. Fixed by naming the packed target type explicitly (Into::<packed::X>::into) in theFrom<Json> for packed::*impls insrc/utils/rpc/types.rsandsrc/subcommands/molecule.rs. No logic changed — only type annotations.Out of scope
test/is a deliberately-separated integration crate (ownCargo.lock, own[workspace], and a hardckb-app-config = ">=1.0, <1.2"pin). It runs ckb-cli as a subprocess rather than linking it, so it's unaffected by this bump and was left untouched.Verification
cargo check --all-targetscargo nextest run— 7/7 passcargo fmt --checkCargo.lockdiff is scoped to the ckb stack + schemars (no unrelated churn)CHANGELOG
Added an
# Unreleasedsection (v2.0.0is already tagged).