turbofish-org / orga

Deterministic state machine engine written in Rust
Apache License 2.0
148 stars 20 forks source link

Resolve heightless queries against latest snapshot #203

Closed mappum closed 1 year ago

mappum commented 1 year ago

Fixes intermittent "Cannot query at height 0" error. The commit process was not atomic since there was time between updating the store height and creating the snapshot which queries would be resolved against, resulting in some queries erroring when the snapshot was not found.

mappum commented 1 year ago

Note that queries at the start of a fresh network will still get this error since no snapshots exist yet. In the future, we should wait until the first snapshot before responding, rather than instantly erroring.