Provide /custom/vstorage/flatdata endpoint for contract notification data #5968
Labels
enhancement
New feature or request
patterns
read-no-tx
topic: reading from the chain without a transaction
telemetry
vaults_triage
DO NOT USE
Zoe Contract
Contracts within Zoe
What is the Problem Being Solved?
Telemetry is currently emitted by sending an object to a notifier-package publisher/publication/updater that is coupled to a chainStorage node, with the result that what gets written into chain storage is capdata like
This is good for capdata-aware consumers, but cumbersome for more generic clients. get-flattened-publication.sh mitigates it somewhat, but that script itself becomes another dependency and still produces rather verbose output.
We wish instead for flattened (tabular) data to be available directly.
Description of the Design
Provide a new RPC endpoint at e.g.
/custom/vstorage/flatdata
which uses the same underlying store capdata and applies a straightforward translation similar to get-flattened-publication.sh, resulting in something like:Rejected/deferred possibility
Producers can be updated to emit a simpler representation of their telemetry, in addition to the reliable objects. It can still be JSON, but should be flat (in the sense that every member of the top-level object has a JSON-primitive value—no objects, arrays, bigints, non-finite numbers, undefined, etc.). For example, the above could be simplified to
Doing this would require
published.amm.pool0
and the corresponding simplified data is written atpublished.amm.pool0.flat
), and<label>BrandId
and<label>AllegedName
fields, and bigints represented as a string containing only decimal digits).Security Considerations
It is probably important that "alleged" or similar remain in the name of any field identifying a brand name, to avoid supporting unjustified trust on the part of a consumer. We may also need to consider the extent to which the Agoric board is privileged in identifying a brand.
Test Plan
No special considerations.
The text was updated successfully, but these errors were encountered: