From 128cf8ff18a2d8c1ef956e501312203b35657f01 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 7 Nov 2024 14:53:54 -0300 Subject: [PATCH] Jump verification description --- proposals/0179-stricter-verification.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proposals/0179-stricter-verification.md b/proposals/0179-stricter-verification.md index 5d65f16e7..6b837f529 100644 --- a/proposals/0179-stricter-verification.md +++ b/proposals/0179-stricter-verification.md @@ -69,6 +69,16 @@ All jump instructions, except for `call` (opcode `0x85`) and `callx` (opcode to arbitrary locations hinders a precise program verification. `VerifierError::JumpOutOfCode` must be thrown for offending this rule. +Such a check can be broken down in the following steps: + +1. The verifier keeps track of which function it is currently analyzing and +scans all instructions. +2. When it finds a jump instruction, it checks if the jump destination is +within the current function's range. +3. When it reaches the final address of the function, it advances to the next +symbol in the symbol table, which contains the next function's start address +and range. + `call imm` (opcode `0x85`) must only be allowed to jump to a program counter previously registered as the start of a function. Otherwise `VerifierError::InvalidFunction` must be thrown. Functions are registered by