Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Syscalls 3 update #466

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions website/docs/script/common-script-error-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ title: "Common Script Error Code"

CKB defines some basic error codes:

- 1: CKB_INDEX_OUT_OF_BOUND, means you have finished fetching all indices in a kind
- 2: CKB_ITEM_MISSING, means an entity is not present, such as fetching a type script from a cell that doesn’t have one.
- 3: CKB_LENGTH_NOT_ENOUGH, means some data length is wrong such as invalid script args or signature length.
- 4: CKB_INVALID_DATA, means there is something wrong with the [molecule serialization](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0008-serialization/0008-serialization.md).
| No. | Error code | Discription |
| --- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1 | CKB_INDEX_OUT_OF_BOUND | All indices of the specified type have been fetched. |
| 2 | CKB_ITEM_MISSING | The requested entity is not present, such as fetching a Type Script from a cell that doesn’t have one. |
| 3 | CKB_LENGTH_NOT_ENOUGH | The data length is invalid, such as incorrect script arguments or signature length. |
| 4 | CKB_INVALID_DATA | Error in [molecule serialization](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0008-serialization/0008-serialization.md). |
| 5 | CKB_WAIT_FAILURE | The file descriptor is invalid during syscall [Wait](https://github.com/nervosnetwork/rfcs/diffs?base_sha=198fc90ab7582953ed85a6655e88e51346857475&bytes=0&commentable=true&head_user=libraries&lines=0&pull_number=436&responsive=true&sha1=198fc90ab7582953ed85a6655e88e51346857475&sha2=cb0d1c2fde54b8520c33b7ac91f9e2e150df2ab2&short_path=fe60e15&start_entry=0&sticky=true&unchanged=expanded&w=false#wait). |
| 6 | CKB_INVALID_FD | The file descriptor is not owned by this process. |
| 7 | CKB_OTHER_END_CLOSED | The other end of the pipe is closed. |
| 8 | CKB_MAX_VMS_SPAWNED | The maximum count of spawned processes has been reached. |
| 9 | CKB_MAX_FDS_CREATED | The maximum count of created pipes has been reached. |

In scenarios where read, write, or wait operations block each other, the system could enter a deadlock state. In such cases, CKB-VM will throw an internal error and terminate immediately.

Molecule Error Codes from [CKB standard C library](https://github.com/nervosnetwork/ckb-c-stdlib/blob/61c7819c9ccf164f5e13d8439c554f80857e2c4b/molecule/molecule2_reader.h#L78-L85)

Expand Down
Loading
Loading