solana-postgres-rpc-server
solana-postgres-rpc-server copied to clipboard
GetAccountInfo can return incorrect reads?
I believe that getAccountInfo can return incorrect/invalid reads when accounts are written to on a fork that later doesn't get confirmed.
Suppose account XXX
is written to on slot 123
. This will create an entry in accounts
table, with slot=123 and slot=123 will have status processed. However, if slot 123
is skipped / on a fork, then when slot 124
is rooted with parent 121
the state for account XXX
in the accounts
table will remain until it is written to next. This means that getAccountInfo(commitment=processed) will now return a state from a fork that has been discarded.
Proposed solution: The postgres-rpc-server should ignore any processed commitments that are on orphaned slots.