Expose some Swingset state through cosmos RPC #9313
Labels
cosmic-swingset
package: cosmic-swingset
enhancement
New feature or request
swing-store
SwingSet
package: SwingSet
What is the Problem Being Solved?
We may want to expose some swingset state to cosmos RPC queries, such as:
Regardless of the way swingset stores this information, we would commit to supporting these queries with specific cosmos proto messages.
Description of the Design
These queries would have to be processed without affecting consensus, and probably without being affected by in progress execution. A possible safe approach there may be to open a separate swing-store connection which starts a read only transaction, but swing-store is not currently architectured to handle a "read-only" mode.
Then there is the question of integration with golang cosmos. Currently there are 3 categories of messages sent over the golang-js bridge:
While it might be easier to funnel everything over the same connection for now, once we have split brains (#5287), we might be able to manage separate connections for this. A secondary process could be used to service all RPC queries.
Security Considerations
Make sure queries cannot affect consensus operations
Scaling Considerations
If a separate process opens its own connection and to service read queries, how should it handle transactions. Multiple DB reads without a transaction risk reading inconsistent data if a commit happens in the middle of 2 reads. Swing-store should manage the transaction, but creating a separate swing-store instance per query might be too much overhead (a swing-store instance requires its own DB connection).
Test Plan
Likely multi-layered:
Upgrade Considerations
None particular besides requiring new chain software.
The text was updated successfully, but these errors were encountered: