Todas as lições · Light client · Começa aqui · Glossário
Light client sync progress poll racing set_scriptsAvançadoDe uma correção
De uma correção · Verificação: em parte certa · Verificada em 2026-11-19
If an app saves per-script sync progress from the light client's get_scripts while another path calls set_scripts to reset or re-register scripts, a get_scripts result read before the set landed can overwrite the reset progress. Do the get_scripts read and the progress write under the same lock that guards set_scripts, and have the poll use tryLock and skip that tick while a registration is in flight, so it never queues behind it. Pocket Node does this in SyncCoordinator.tryWithRegistrationLock.
Porque importa: A poll tick that read get_scripts before a resync's set_scripts landed writes the old block number back, so the user's reset is silently undone and the wallet resumes from stale progress.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- RaheemJnr/pocket-node:
android/app/src/test/java/com/rjnr/pocketnode/data/gateway/GatewayRepositoryResyncStrategyTest.kt,android/app/src/test/java/com/rjnr/pocketnode/data/gateway/RegistrationLockTest.kt,android/app/src/test/java/com/rjnr/pocketnode/data/gateway/TestGatewayRepository.kt
- Conceitos
- Indexer queries and cell collection, Network and RPC reliability
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-06
- Última mudança
- 2026-10-06
- Última verificação
- 2026-11-19
- Verificação contra o commit
- em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga
Fontes (1)
- 2026-10-06 · RaheemJnr/pocket-node · mais deste projeto
Mais sobre Light client
- Give light clients the committing block of a cell, not just its outpoint
- Light client set_scripts "all" replaces the whole registered script set
- Light client still reports a removed script until the new script set lands
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Light client sync progress poll racing set_scripts", CKB lessons, https://pulse.lusocryptolabs.com/learned/light-client/light-client-sync-progress-poll-racing-set-scripts, CC BY 4.0, last changed 2026-10-06.