solana-labs / rbpf

Rust virtual machine and JIT compiler for eBPF programs
Apache License 2.0
277 stars 169 forks source link

Add new `syscall` instruction to the verifier #620

Closed LucasSte closed 1 week ago

LucasSte commented 1 week ago

This is an alternative implementation of #614 for SIMD-0178.

This PR adds the new syscall instruction to the verifier and write tests for it. It also introduces a dense function registry in the loader and distinguishes it from the sparse registry.

Execution tests for syscalls are only working for SBPFv1 and will be revamped once the instruction is properly implemented in the interpreter and jitter.

Lichtso commented 1 week ago

How about having get_dense_function_registry() and get_sparse_function_registry(), we instead have get_function_registry(sbpf_version)?