Speculative pre-proving is off on the extension; rehosting it into the offscreen realm is unbuilt
- Lenguaje dominante
- TypeScript
- Estrellas
- 5
- Forks
- 28
- Merge medio
- 9 h 50 min
- PR fusionados (30 d)
- 123
Descripción
#714 stopped speculative pre-proving on the extension because its result could never be consumed there: the cache lives in the service worker, while the send that would claim it runs inside the offscreen document (`MIDEN_USE_OFFSCREEN_CLIENT` defaults `true` for the SW bundle). The work was being produced and discarded, so stopping it costs nothing today — but the feature is now absent on Chrome's default configuration, and that should be a deliberate state rather than a forgotten one.
**What it bought.** A pre-proved send skips the prove at Confirm (roughly 5–10s). Note it was already narrower than it sounds: the cache is skipped whenever a reclaim height is set, and the review screen seeds every same-chain send with a 7-day reclaim unless the user changes it to "Never".
**What rehosting needs** — this is a project, not a patch:
- a `SPECULATE` / `SpeculateInvalidate` producer channel into the offscreen realm (today the popup messages the SW, which holds the only `SpeculationManager`);
- the speculative prove to run *in* that realm (`executeAndProveForSpeculation`);
- the staged in-realm send branch to consult the cache — today it is only consulted on the branch that dispatches a prove *to* the offscreen document, which is unreachable from inside it;
- an abort path for superseded speculations that is not "close the offscreen document", since that would kill any concurrent write.
Whoever picks this up should first confirm the saving is worth it given the reclaim-height interaction above — it may be cheaper to make the cache usable for reclaimable sends than to move realms.
Context: PR #713, issue #714.
Guía de contribución
Línea de trabajo
Review PR #713 and issue #714 to understand the speculative pre-proving feature and why it was disabled. Examine the service worker and offscreen document code to see how the SpeculationManager and prove execution currently work. Determine if the performance saving is worthwhile given the reclaim-height interaction. The work involves creating a new communication channel and moving the prove execution into the offscreen realm.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- backend, performance
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100