SIMD-0178

SBPF Static Syscalls

Author: Alessandro Decina, Alexander Meißner, Lucas Steuernagel · Category: Core Protocol GitHub →

Feature Gate Status

Mainnet Inactive
Testnet Inactive
Devnet Inactive

BUwGLeF3Lxyfv1J1wY8biFHBB2hrk2QhbNftQf3VV3cC

TL;DR

This SIMD introduces static syscalls, using the eBPF call instruction encoding, to remove runtime relocations while keeping compatibility with the eBPF encoding.

Summary

This SIMD introduces static syscalls, using the eBPF call instruction encoding, to remove runtime relocations while keeping compatibility with the eBPF encoding.

Motivation

The resolution of syscalls during ELF loading requires relocating addresses, which is a performance burden for the validator. Relocations require an entire copy of the ELF file in memory to either relocate addresses we fetch from the symbol table or offset addresses to after the start of the virtual machine's memory. Moreover, relocations pose security concerns, as they allow the arbitrary modification of program headers and programs sections. Introducing static syscalls allows us to resolve all program relocations during link time.

Impact

The changes proposed in this SIMD are transparent to dApp developers. The compiler toolchain will emit correct code for the specified SBF version. Static syscalls obviate relocations for call instructions and move the virtual machine closer to eliminating relocations altogether, which can bring considerable performance improvements.

Security Considerations

None.