VM
发展路线
eBPF → rBPF → Solana rBPF → Solana Bytecode Format
BPF
这里我们说的 bpf 均为 ebfp: whats ebpf resp in Chinese
rBPF
GitHub - qmonnet/rbpf: Rust virtual machine and JIT compiler for eBPF programs
While BPF programs are originally intended to run in the kernel, the virtual machine of this crate enables running it in user-space applications; it contains an interpreter, an x86_64 JIT-compiler for eBPF programs, as well as a disassembler.
简而言之,rust 语言编写的,用户态的,有 JIT(only on x86 linux)的 ,eBPF 虚拟机
Solana rBPF & Solana Bytecode Format
GitHub - solana-labs/rbpf: Rust virtual machine and JIT compiler for eBPF programs
Forked for:
- 自定义的 LLVM 后端
- 删除一些原始 eBPF 的验证,例如循环检查,内存检查等等
- 重写 syscall
- 绑定智能合约的入口点
reference
这部分内容缺少文档,有意思的是在 dot社区有很多对 solana bpf vm的讨论很有意思,尤其是还与 wasm 作了比较。
Bringing solana's ebpf based smart-contract execution to polkadot
关于 Solana Bytecode Format ,现在不叫 sbf 了,现在叫 sBPF
Rename Solana Bytecode Format(SBF) toolchain · Issue #30566 · solana-labs/solana
Update references to platform-tools by dmakarov · Pull Request #30764 · solana-labs/solana