solana-accountsdb-plugin-postgres icon indicating copy to clipboard operation
solana-accountsdb-plugin-postgres copied to clipboard

Removing forked writes

Open linuskendall opened this issue 2 years ago • 0 comments

This is related to: https://github.com/lijunwangs/solana-postgres-rpc-server/issues/3

When slots that were on forks end up being skipped, we're storing inconsistent state data in the accounts table.

Proposed solution:

Add a trigger that will delete entries from accounts table which are on status processed whenever a new slot is rooted. Something like:

delete from accounts where slot < new_rooted_slot and slot.status=processed'

For this to work it would require that previous entries exists in accounts_audit table.

linuskendall avatar Jun 22 '22 07:06 linuskendall