Skip to content

What happens to runtime when the code contains conditional branches? #505

Answered by intoverflow
makoConstruct asked this question in Q&A
Discussion options

You must be logged in to vote

This is a great question!

The zkVM runs guest programs the same as any other CPU. In particular, it does not attempt to follow all possible code paths.

At the end of execution, the ZK proof does not precisely tell you the number of cycles that ran. Instead, it rounds up to the next power of 2. This rounding is a side effect of the STARK construction.

This side channel is likely to be removed in the future.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@makoConstruct
Comment options

@flaub
Comment options

Answer selected by makoConstruct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants