Solana!
January 27, 2022
eBPF instruction set architecture
rust BPF (user space, usually kernel) VM
- https://github.com/solana-labs/rbpf
- interpreter,
- an x86_64 JIT-compiler for eBPF programs,
- assembler,
- disassembler*
- verifier.
- fuzzing
- https://medium.com/wasmer/fuzz-testing-in-webassembly-vms-3a301f982e5a “//! This “verifier” performs simple checks when the eBPF program is loaded into the VM (before it is //! interpreted or JIT-compiled). It has nothing to do with the much more elaborated verifier inside //! Linux kernel. There is no verification regarding the program flow control (should be a Direct //! Acyclic Graph) or the consistency for registers usage (the verifier of the kernel assigns types //! to the registers and is much stricter). //! //! On the other hand, rbpf is not expected to run in kernel space. //! //! Improving the verifier would be nice, but this is not trivial (and Linux kernel is under GPL //! license, so we cannot copy it). //! //! Contrary to the verifier of the Linux kernel, this one does not modify the bytecode at all.”
Understand all this
- https://github.com/solana-labs/solana/tree/7ddf10e602d2ed87a9e3737aa8c32f1db9f909d8/sdk/program/src -https://docs.solana.com/developing/on-chain-programs/overview
examples: https://github.com/solana-labs/rbpf/tree/main/examples
linux kernel verifier?
Rust fork that can build bpf modules
LLVM fork https://github.com/solana-labs/llvm-project
JVM
- instruction verifier, type verifier (part of linking?)
- bytecode verifier
- branches valid (static in load time)
- data initialized and type-safe (static in load time)
- access violations (runtime dynamic)
- verification: https://docs.oracle.com/javase/specs/jvms/se6/html/ClassFile.doc.html#88597
Links
- Upstream issue
- https://github.com/solana-labs/solana/issues/21483
- learn more OS and systems! study some distrib systems