Je ne sais pas comment sont gérés les rollbacks en interne, mais quand on regarde les logs subsquid, on voit de temps en temps des rollbacks (je n’en ai pas sous la main parce qu’apparemment on n’est plus que deux validateurs).
Donc à mon avis il utilise des transactions postgresql ou quelque chose similaire qu’il est capable de rollback si le bloc n’est plus dans la branche principale. Et la finalisation permet d’oublier les transactions.
Il y a aussi une histoire de checkpoints, je ne sais pas à quoi ça correspond.
duniter-gdev-subsquid-processor-1 | {"level":2,"time":1706260885014,"ns":"sqd:processor","msg":"819433 / 819433, rate: 0 blocks/sec, mapping: 6 blocks/sec, 17 items/sec, eta: 0s"}
duniter-gdev-subsquid-processor-1 | {"level":2,"time":1706260891005,"ns":"sqd:processor","msg":"819434 / 819434, rate: 0 blocks/sec, mapping: 6 blocks/sec, 18 items/sec, eta: 0s"}
duniter-gdev-subsquid-db-1 | 2024-01-26 09:21:31.569 UTC [27] LOG: checkpoint starting: time
duniter-gdev-subsquid-processor-1 | {"level":2,"time":1706260897076,"ns":"sqd:processor","msg":"819435 / 819435, rate: 0 blocks/sec, mapping: 6 blocks/sec, 17 items/sec, eta: 0s"}
duniter-gdev-subsquid-processor-1 | {"level":2,"time":1706260903021,"ns":"sqd:processor","msg":"819436 / 819436, rate: 0 blocks/sec, mapping: 6 blocks/sec, 18 items/sec, eta: 0s"}
duniter-gdev-subsquid-db-1 | 2024-01-26 09:21:48.863 UTC [27] LOG: checkpoint complete: wrote 175 buffers (1.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=17.245 s, sync=0.028 s, total=17.295 s; sync files=45, longest=0.010 s, average=0.001 s; distance=1117 kB, estimate=1117 kB
duniter-gdev-subsquid-processor-1 | {"level":2,"time":1706260909052,"ns":"sqd:processor","msg":"819437 / 819437, rate: 0 blocks/sec, mapping: 6 blocks/sec, 18 items/sec, eta: 0s"}
duniter-gdev-subsquid-processor-1 | {"level":2,"time":1706260915039,"ns":"sqd:processor","msg":"819438 / 819438, rate: 0 blocks/sec, mapping: 6 blocks/sec, 18 items/sec, eta: 0s"}