solana-labs / rbpf

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

Enable dense indexing in `FunctionRegistry` and `BuiltinProgram` #619

Closed LucasSte closed 1 week ago

LucasSte commented 1 week ago

This PR is an alternative to #617. It contains less changes and better deals with dense indexes.

The FunctionRegistry data structure has been changed to accept dense indexes in a predefined range. As we may have unregistered functions in dense indexing as well, using the Btree is advantageous because it obviates the tombstone syscall. If a syscall is deactivated, it is simply not present in the tree.