Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jump verification description
Browse files Browse the repository at this point in the history
LucasSte committed Nov 7, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent fd05123 commit 128cf8f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions proposals/0179-stricter-verification.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 128cf8f

Please sign in to comment.