rust-cannon-template

所属分类:嵌入式/单片机/硬件编程
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2022-10-20 19:09:56
上 传 者sh-1993
说明:  用于构建在[Optimism Cannon]([https:gith...](https:github.com以太坊乐观加农炮)上下文中可执行的MIPS二进制文件的构建系统和最小Rust程序,
(Tooling to develop and emulate verifyable programs compatible with Optimism Cannon and the OP Stack ????)

文件列表:
Cargo.toml (106, 2023-11-26)
Dockerfile.cannon-builder (1160, 2023-11-26)
LICENSE (7652, 2023-11-26)
cannon-heap/ (0, 2023-11-26)
cannon-heap/Cargo.toml (259, 2023-11-26)
cannon-heap/src/ (0, 2023-11-26)
cannon-heap/src/lib.rs (1429, 2023-11-26)
cannon-io/ (0, 2023-11-26)
cannon-io/Cargo.toml (358, 2023-11-26)
cannon-io/src/ (0, 2023-11-26)
cannon-io/src/lib.rs (938, 2023-11-26)
cannon-io/src/logger.rs (722, 2023-11-26)
cannon-io/src/oracle/ (0, 2023-11-26)
cannon-io/src/oracle/key.rs (2424, 2023-11-26)
cannon-io/src/oracle/mod.rs (186, 2023-11-26)
cannon-io/src/oracle/oracle_reader.rs (7753, 2023-11-26)
cannon-io/src/syscalls/ (0, 2023-11-26)
cannon-io/src/syscalls/mod.rs (2265, 2023-11-26)
cannon-io/src/syscalls/raw.rs (3568, 2023-11-26)
cannon-test/ (0, 2023-11-26)
cannon-test/Cargo.toml (326, 2023-11-26)
cannon-test/justfile (555, 2023-11-26)
cannon-test/preimages.json (82, 2023-11-26)
cannon-test/src/ (0, 2023-11-26)
cannon-test/src/main.rs (1383, 2023-11-26)
cargo-cannon/ (0, 2023-11-26)
cargo-cannon/Cargo.toml (340, 2023-11-26)
cargo-cannon/src/ (0, 2023-11-26)
cargo-cannon/src/cli.rs (1384, 2023-11-26)
cargo-cannon/src/main.rs (1427, 2023-11-26)
mips-unknown-none.json (553, 2023-11-26)
... ...

# Cannon-rs cannon-rs logo [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![LGPL-3 License][license-shield]][license-url] A comprehensive collection of crates and tools to support development of Cannon programs in Rust Thinking about contributing? There are bounties available for meaningful contributions via our [OnlyDust page!](https://app.onlydust.xyz/p/cannon-rs) ## About The Project Cannon-rs aims to support the emerging number of projects using Rust to develop provable programs for Optimism Cannon. This is the evolution of the rust-cannon-template supported by the Optimism RetroPGF round 2. Advantages of using Rust are: - **Code Reuse** - Take advantage of existing, trusted crates in the crypto ecosystem - **Compact Binaries** - Cannon programs built using Rust are much smaller than their Golang equivalents - **Proving Speed** - Generating proofs through emulation for large programs can be slow. Effective use of Rust can reduce the length of the program trace required speeding up the proving process The project itself provides a number of tools to enable this: #### Build system using Docker Although MIPS is a standard Rust target the specific configuration needed to support the Cannon ISA is quite different. Cannon-rs provides a [custom Rust target](./mips-unknown-none.json) and a [Docker image](./Dockerfile.cannon-builder) configured to build elf files which can be patched to run within Cannon. #### Guest<->Host Communication Cannon uses syscalls for communication between the guest program and the host. The [cannon-io](./cannon-io/README.md) crate exposes a simple and safe wrapper around the low level syscalls to allow printing to stdout, retrieving data via the pre-image oracle and safely terminating a program with an exit code. #### Preimage Server The [Optimism Cannon emulator](https://github.com/ethereum-optimism/optimism/tree/develop/cannon) uses custom IO streams to communicate with a child process responsible for retrieving preimage data given its key. The Cannon preimage server implementation is geared toward providing access to the Ethereum data required for rollup execution. Cannon-rs provides a simple CLI tool for serving preimages stored in a JSON file. This can be extended with new implementations of the `PreimageProvider` trait in order to provide a tool suited to your application. #### Cargo Cannon tool (WIP) Makes generating and building new Cannon projects as easy as: ``` cargo cannon new cargo cannon build ``` ### Prerequisites Cross compiling for Cannon requires: - Docker - Just (`cargo install just`) ## Getting Started 1. Copy the `project-template` from this repo to get started 2. Build something awesome in Rust 3. Build for Cannon using `just build` ## Roadmap - [x] Rust build system for Cannon MIPS target (no_std) - [x] Heap implementation - [x] Guest<->Host Communication - [x] stdout - [x] Request data via Preimage Oracle - [x] Hints - [x] Template for bootstrapping own projects - [x] Preimage Server - [x] Server compatible with [Optimism Cannon emulator](https://github.com/ethereum-optimism/optimism/tree/develop/cannon) - [x] Serve preimages from JSON file - [ ] cargo cannon tooling - [ ] `cargo cannon build` to wrap docker cross-compilation - [ ] `cargo cannon new` to create new Cannon projects See the [open issues](https://github.com/BadBoiLabs/Cannon-rs/issues) for a full list of proposed features (and known issues). ## Contributing Contributions are very welcome! To contribute please 1. Fork the Project 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) 4. Push to the Branch (`git push origin feature/AmazingFeature`) 5. Open a Pull Request A huge thanks to all existing contributors from the community!! ## Used By

## License Distributed under the LGPL-3 License. See [LICENSE](./LICENSE) for more information. ## Contact Willem Olding - [@willemolding1](https://twitter.com/willemolding1) - willemolding@gmail.com Project Link: [https://github.com/BadBoiLabs/Cannon-rs](https://github.com/BadBoiLabs/Cannon-rs) [contributors-shield]: https://img.shields.io/github/contributors/BadBoiLabs/Cannon-rs.svg?style=for-the-badge [contributors-url]: https://github.com/BadBoiLabs/Cannon-rs/graphs/contributors [forks-shield]: https://img.shields.io/github/forks/BadBoiLabs/Cannon-rs.svg?style=for-the-badge [forks-url]: https://github.com/BadBoiLabs/Cannon-rs/network/members [stars-shield]: https://img.shields.io/github/stars/BadBoiLabs/Cannon-rs.svg?style=for-the-badge [stars-url]: https://github.com/BadBoiLabs/Cannon-rs/stargazers [issues-shield]: https://img.shields.io/github/issues/BadBoiLabs/Cannon-rs.svg?style=for-the-badge [issues-url]: https://github.com/BadBoiLabs/Cannon-rs/issues [license-shield]: https://img.shields.io/github/license/BadBoiLabs/Cannon-rs.svg?style=for-the-badge [license-url]: https://github.com/BadBoiLabs/Cannon-rs/blob/master/LICENSE.txt

近期下载者

相关文件


收藏者