Skip to content

Commit

Permalink
docs: solution to support atomic instructions (nervosnetwork#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuJiandong authored Sep 27, 2024
1 parent ab88bd6 commit ed3c951
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,15 @@ default_alloc!(4 * 1024, 516 * 1024, 64)
Check `examples` and [tests](https://github.com/nervosnetwork/ckb-std/blob/master/contracts/ckb-std-tests) to learn how to use.

See also [ckb-tool](https://github.com/nervosnetwork/capsule/tree/develop/crates/testtool) which helps you write tests.


### Upgrading Issues

Starting from ckb-std 0.16.0, RISC-V atomic instructions are generated by
default. However, ckb-vm doesn't directly support atomic instructions. To
address this, ckb-std provides the following solutions:

1. Use the "dummy-atomic" feature (enabled by default)
2. Adjust Rust compilation flags by adding `-C target-feature=-a` to `RUSTFLAGS`

For more detailed information on compilation flags, refer to the [CKB Script Templates repository](https://github.com/cryptape/ckb-script-templates/tree/main?tab=readme-ov-file#molecule-uses-bytes-crates).

0 comments on commit ed3c951

Please sign in to comment.