Skip to content

feat: surface block_hash in rpc get_live_cell - #680

Merged
eval-exec merged 5 commits into
nervosnetwork:developfrom
eval-exec:chore/get_live_cell_block_hash
Aug 4, 2026
Merged

feat: surface block_hash in rpc get_live_cell#680
eval-exec merged 5 commits into
nervosnetwork:developfrom
eval-exec:chore/get_live_cell_block_hash

Conversation

@eval-exec

Copy link
Copy Markdown
Collaborator

Summary

CKB PR nervosnetwork/ckb#5269 added a top-level block_hash field to the CellWithStatus response of get_live_cell. This bumps ckb-cli onto a ckb-jsonrpc-types version that includes it (1.2.0), so rpc get_live_cell — which serializes the raw CellWithStatus — now returns block_hash.

Why this is a stack bump, not a one-liner

ckb-jsonrpc-types 1.2.0 moved to schemars 1.x, so ckb-fixed-hash / ckb-types must 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 in Cargo.toml already permitted this; only Cargo.lock changed):

  • 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

⚠️ Note: ckb-sdk has 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 From impls directly into packed::* 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 the From<Json> for packed::* impls in src/utils/rpc/types.rs and src/subcommands/molecule.rs. No logic changed — only type annotations.

Out of scope

test/ is a deliberately-separated integration crate (own Cargo.lock, own [workspace], and a hard ckb-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-targets
  • cargo nextest run — 7/7 pass
  • cargo fmt --check
  • Cargo.lock diff is scoped to the ckb stack + schemars (no unrelated churn)

CHANGELOG

Added an # Unreleased section (v2.0.0 is already tagged).

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).
Copilot AI review requested due to automatic review settings August 3, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-types to 1.2.0, ckb-types to 1.1.x, ckb-sdk to 5.1.0) and update Cargo.lock accordingly.
  • Disambiguate .map(Into::into) sites by explicitly selecting packed target types in RPC/molecule conversion code.
  • Add an Unreleased section 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.

Comment thread CHANGELOG.md Outdated
eval-exec and others added 3 commits August 4, 2026 15:29
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.
@eval-exec

Copy link
Copy Markdown
Collaborator Author

@chenyukang I think this PR is ready to merge.

@eval-exec
eval-exec requested a review from chenyukang August 4, 2026 08:07
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).
@eval-exec
eval-exec merged commit 13fd05d into nervosnetwork:develop Aug 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants