nervosnetwork / nervosnetwork/ckb-std

Document `SysError::LengthNotEnough` intended usage

Open
#100 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
28
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Following @XuJiandong advice:

The load_cell_data function can load all cell data at once. However, the cell data might be very large, potentially consuming all available memory in certain scenarios. It is recommended to use the following low-level syscall to load only a portion of the cell data

I switched iCKB load_cell_data calls from the highlevel to syscall. At that point all the contracts stopped validating, completely.

After too much digging I understood theSysError::LengthNotEnough lifecycle in correlation to syscalls from load_data implementation. I did not found any other documentation except that private function, not even in the relative RFC.

Please, could you update the syscall documentation with this crucial information about SysError::LengthNotEnough?

Keep up the great work 💪
Phroi

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the load_data implementation in ckb-std/src/high_level.rs and the load-cell-data section of RFC 0009, then trace the referenced SysError::LengthNotEnough behavior. The work is done when the syscall documentation explains when this error occurs and how callers should use it when loading partial cell data.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.