Skip to content

v0.13.0: B5-B9 host-mode state

Choose a tag to compare

@Jim8y Jim8y released this 27 Jun 23:54
· 52 commits to master since this release

v0.13.0 — B5–B9 host-mode state for runtime syscalls

v0.13.0 closes out the v0.7.0 audit's TIER 1+2 findings
(B1–B9). The wasm32 path for B5–B9 (get_random, get_time,
get_invocation_counter, get_gas_left, current_signers,
get_notifications) was already correct (each wrapper calls
an extern). The host-mode test framework, however, returned
0 / empty because the host had no state to return — making
it impossible to test contracts that use these syscalls.

Highlights

  • B5 — get_random host-mode state. New
    NeoVMSyscall::set_active_random(i64) setter.
  • B6 — get_time + get_invocation_counter host-mode state.
    New set_active_time(i64) and
    set_active_invocation_counter(i32) setters.
  • B7 — get_gas_left host-mode state. New
    set_active_gas_left(i64) setter.
  • B8 — current_signers host-mode state. The dispatch reads
    ACTIVE_WITNESSES and serialises each witness as a
    [account, Global-scope] 2-element array.
  • B9 — get_notifications host-mode state. The dispatch
    drains the existing notification recorder. reset_host_state
    now also clears the recorder.
  • 6 new tests in rust-devpack/tests/b5_b9_host_state.rs.

Test status

  • 67 workspace test suites (was 66 at v0.12.0)
  • 0 clippy errors, 0 failures
  • 4 L7 conformance tests pass
  • The v0.7.0 audit's TIER 1+2 (B1–B9) is fully closed.

See CHANGELOG.md for full details.