[go: up one dir, main page]

What should be the initial state of a PVM?

The following discussion from !4343 (merged) should be addressed:

  • @hans.hoglund started a discussion: (+4 comments)

    It is confusing that two PVMs can have identical state hashes (zero) even though they are in fact in different states (due to having different boot sectors).

    Fortunately, I don't think this special-casing is necessary. We could instead say that:

    • Pre-boot state means commitment_hash = 0. By implication state_hash = 0 and tick_count = 0.
    • The boot sector is may be written in a single tick using this function.
    • The machine now performs perform N>=0 or more computation steps, which we observe by iterating eval until is_input_state holds.
    • At this point the machine enters its regular loop, alternating set_input_state and (eval until is_input_state).

    So terminology-wise the machine is in pre-boot at tick 0, booting at tick [1..N+1] and running at tick N+2.

    In the context of this MR, this just means removing the requirement that [state_hash state = State_hash.zero] from this docstring, and removing the special-casing of Halted in state_hash.