Open luc-blaeser opened 1 week ago
Comparing from 247aa056afe9d5499f9f79d78d6d38117b8478ae to 53bcc7514dd2f85154196f2c79aa1d89c7cec3c3: In terms of gas, 3 tests regressed and the mean change is +0.0%. In terms of size, 5 tests regressed and the mean change is +0.4%.
Very cool!
I wonder if leb encodings would compress stuff quite a bit...
Motoko Data Inspection
Note: This is still a prototype, not yet ready for merging.
Generic data inspection of Motoko canisters by authorized users.
Your Motoko Program is a Database!
This is only a small first step towards the bigger vision of providing data tooling to Motoko, similar to a database management system. This would support data inspection, data queries, maybe even data modification, data backup/restore, complex data migration, and/or administrative functionality.
Frontend Prototype
A simple frontend is available to test the data inspection, see https://github.com/luc-blaeser/data-inspector (limited access).
Backend Design
The Motoko runtime system is extended to stream the heap state to the frontend canister for displaying the data to authorized users.
Currently, the following design aspects apply to the data inspection in the Motoko runtime system:
Binary format (EBNF)
The object payload is organized as follows:
Object
, the object size is prepended because the hash blob cannot directly be located in the stream.object_id
are potentially synthetic identifiers of an objects. The ids are skewed, to distinguish them from scalars. Currently, theobject_id
are heap pointers but this would change with incremental inspection.usize
is 64-bit little endian.Implementation
Future: Incremental Inspection
Incremental inspection can be realized in the future for scalability to larger heaps:
Possible implementation: