Skip to content

refactor: replace byteorder crate usage with native rust methods#509

Merged
mohanson merged 1 commit intonervosnetwork:developfrom
mohanson-fork:remove_byteorder
Apr 9, 2026
Merged

refactor: replace byteorder crate usage with native rust methods#509
mohanson merged 1 commit intonervosnetwork:developfrom
mohanson-fork:remove_byteorder

Conversation

@mohanson
Copy link
Copy Markdown
Collaborator

@mohanson mohanson commented Apr 3, 2026

ckb-vm relied on the byteorder library to handle byte order. However, Rust's standard library (since version 1.44) already provides sufficient functionality to handle byte order, so we can consider removing the byteorder dependency.

https://doc.rust-lang.org/std/primitive.u32.html#method.from_le_bytes

Meanwhile, the byteorder repository appears to be no longer maintained, furthermore, the author no longer recommends its use: https://github.com/BurntSushi/byteorder?tab=readme-ov-file#alternatives

I believe we didn't choose byteorder over the Rust standard library, but simply because the ckb-vm repository was created before Rust 1.44

@mohanson mohanson requested a review from XuJiandong April 3, 2026 04:03
@mohanson
Copy link
Copy Markdown
Collaborator Author

mohanson commented Apr 3, 2026

The CI failure is not an issue with this PR.

Comment thread src/machine/asm/mod.rs
@mohanson mohanson merged commit c4ae777 into nervosnetwork:develop Apr 9, 2026
22 of 24 checks passed
@mohanson mohanson deleted the remove_byteorder branch April 9, 2026 03:14
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