Skip to content

docs: add AppFlush trait design document#31

Merged
freesig merged 2 commits into
mainfrom
freesig/flush
Jan 14, 2026
Merged

docs: add AppFlush trait design document#31
freesig merged 2 commits into
mainfrom
freesig/flush

Conversation

@freesig
Copy link
Copy Markdown
Collaborator

@freesig freesig commented Jan 14, 2026

No description provided.

Design for fixing observer nodes not flushing pending state to the
merkle trie. Adds AppFlush trait to allow framework to flush app
state for observers without requiring proof generation.

<!-- ps-id: d9634340-0b82-47b8-8db0-d2ecabae350d -->
Observers don't generate proofs, so flush() was never called after
state transitions. This caused API inconsistencies where get_balance
worked (reads from pending writes) but get_burn_proof returned null
(only reads from flushed trie).

- Add AppFlush trait to transitions.rs
- Add App: AppFlush bounds to observer/optimistic functions
- Call flush() after api_update in observer_state_transition_with_storage
- Implement AppFlush for increment and transfers apps (no-op)

<!-- ps-id: 9126455a-c2b8-4070-a96b-c987a02571b9 -->
@freesig freesig merged commit 981a1cd into main Jan 14, 2026
2 checks passed
@freesig freesig deleted the freesig/flush branch January 14, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant