Step Errors (RS401)

Back to Error Catalog | Spec: step.md

Enforcement: rsc lint (rs edition only).


RS401: Step state outside cell context

error[RS401]: #[step] state accessed outside of cell context
  help: #[step] state must be accessed within a cell! block
  help: step reset is managed by the cell runtime

#[step] state is automatically reset at step boundaries by the cell runtime. Accessing it outside a cell context means no runtime manages its lifecycle — the reset would never happen, defeating the purpose of step scoping.

Fix

Access step state from within a cell:

cell! {
    name: MyCell,
    step_state {
        counter: u64,
    }

    pub fn tick(&mut self) {
        self.step_state.counter += 1;  // OK: inside cell context
    }
}

Dimensions

step
one tick of consensus time. signals enter, achieve finality, and the tru recomputes cyberank from the new state discover all concepts
rs/reference/step
Step-Scoped State Definition A step is a discrete, sequential interval identified by a monotonically increasing `u64`. Rs defines the step contract — the interface between a cell and its runtime: `current_step() -> u64` — returns the current step number `reset_step_state()` — called by the runtime…

Local Graph