Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

ReservedTicker table and query is unsound #43

Open
erikd opened this issue Aug 8, 2020 · 0 comments
Open

ReservedTicker table and query is unsound #43

erikd opened this issue Aug 8, 2020 · 0 comments

Comments

@erikd
Copy link
Member

erikd commented Aug 8, 2020

The current table only contains the ticker name and the pool_hash and the current query is:

queryReservedTicker :: MonadIO m => Text -> ReaderT SqlBackend m (Maybe ReservedTicker)
queryReservedTicker reservedTickerName = do
  res <- select . from $ \(reservedTicker :: SqlExpr (Entity ReservedTicker)) -> do
            where_ (reservedTicker ^. ReservedTickerName ==. val reservedTickerName)
            limit 1
            pure $ reservedTicker
  pure $ fmap entityVal (listToMaybe res)

The database does not store pool deregistations (so it is not possible to check for a deregistered pool) and the query does not take into account the possibility that the pool has been deregistered.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant