Speculative pre-proving is off on the extension; rehosting it into the offscreen realm is unbuilt
- Linguagem predominante
- TypeScript
- Estrelas
- 5
- Forks
- 28
- Merge médio
- 16h 40min
- PRs com merge (30d)
- 99
Descrição
#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.
Guia de contribuição
Direção de pesquisa
Revise o PR #713 e a issue #714 para entender o recurso de prova especulativa prévia (speculative pre-proving) e por que ele foi desativado. Examine o código do service worker e do documento fora da tela (offscreen document) para ver como o SpeculationManager e a execução da prova (prove execution) funcionam atualmente. Determine se a economia de desempenho vale a pena, dada a interação com a altura de recuperação (reclaim-height). O trabalho envolve criar um novo canal de comunicação e mover a execução da prova para o domínio fora da tela (offscreen realm).
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- typescript
- Domínio
- backend, performance
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100