hermes icon indicating copy to clipboard operation
hermes copied to clipboard

IBC index and PostgreSQL backend [meta issue]

Open romac opened this issue 3 years ago • 0 comments

🚧 WIP in the anca/ibcnode branch.

Matrix

Status Tendermint indexer IBC Node Runtime Hermes supervisor/ chain handle Comments
kv   Cosmos - no cache temp mem cache Cache cannot be disabled
🚧 psql   CosmosPsql - IBC db, psql only temp mem cache Partially supported in anca/ibcnode
🚧 psql (g)RPC proxy, no extra storage Cosmos - no cache In-memory cache
🔮 kv or psql   CosmosPsql or Cosmos - IBC cache in memory (configurable) No or in-memory cache Not supported but should look at the overall feature matrix and figure out what makes sense
🔮 kv or psql (g)RPC proxy, IBC db psql Cosmos - no cache  

✅ Released - 🚧 WIP - 🔮 Future work

TODO

  • [ ] on start:
    • [ ] on first event at H scans everything for H-1 and populates the snapshot at H-1:
      • [x] app state (mainly the timestamp)
      • [x] clients
        • [x] state
        • [x] consensus states
      • [ ] headers
      • [x] connections
      • [x] channels
      • [x] pending send packets
      • [ ] pending acknowledgements
    • [x] saves snapshot
  • [ ] during normal operation
    • [ ] maintains based on events
      • [x] app state
      • [x] clients
        • [x] state
        • [x] consensus states
      • [ ] headers
      • [x] connections
      • [x] channels
      • [x] pending send packets
        • [x] add on SendPacket event
        • [x] remove on Acknowledgement event
      • [ ] pending acknowledgements
  • [ ] queries moved to psql
    • [x] app state
    • [x] clients
      • [x] state
      • [x] consensus
    • [ ] headers
    • [x] connections
    • [x] client connections
    • [x] connection
    • [ ] connection channels
    • [x] channels
    • [x] channel
    • [ ] packet commitments
    • [ ] packet acknowledgments
    • [x] packet data
      • [x] via query tx (tendermint)
      • [x] via query IBC snapshots

Future work

  • [ ] client updates and header related: It would be good if we were able to store readily available data that can reduce the number of RPCs light client performs when building headers for client updates
    • [ ] NewBlock raw event from tendermint-rs includes the block “Meta” data from chain. We drop it in the monitor before we create the NewBlock IbcEvent to be sent to the supervisor. We should include this in the event so it is accessible to the chain to store the block header.
    • [ ] Could query and store validator set if there new IBC events were seen at previous height (H-1) since it is very likely a client update at H will be required
    • [ ] Ensure the current light client APIs can be used, adapt if not. Romain suggested we can populate the memory store with the stored data we have available

For Admin Use

  • [x] Not duplicate issue
  • [x] Appropriate labels applied
  • [ ] Appropriate milestone (priority) applied
  • [x] Appropriate contributors tagged
  • [x] Contributor assigned/self-assigned

romac avatar Aug 05 '22 07:08 romac