-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoE state export #50
Comments
Is this the same as #95 ? |
One thought I had was to provide a way to "decode" the state of a contract if we know it is using storage-plus. We can look at the key to see if it is Item or Map. We can try to parse the keys out and leave the values as json.RawMessage. This could end up like: [
{
"type": "item",
"name": "config",
"value": { "some": "value" }
},
{
"type": "map",
"name": "votes",
"schema": ["string", "u64"],
"values": [
{
"key": ["cosmos1ckjhefiuhweughewoughuewghekw", 3]
"value": {"yes": 34}
},
{
"key": ["cosmos1fuewhfiuepofkafjewoighfe", 5]
"value": {"no": 45}
}
]
}
] I'm sure the rust team could help with some tooling like this. And then it would let us introspect all contract state. One issue is how to store the data for IndexedMaps and SnapshotMaps (although I think Snapshots will be fine to export directly, we would want to rebuild indexes somehow to avoid them being invalid) |
@maurolacy curious as to your thoughts on the feasibility of this |
I think that's possible. Our Also, would this require admin status / checks? I don't think so, as the contract info is public already. Perhaps for preventing denial of service / abuse? |
I think having an When we dump state, we There should be some flag for which contracts have that behavior. It could be a subset (or all) of the contracts created in bootstrap.go |
SDK support an export for |
All modules cosmos-sdk support the state export/ import process where the persistent state data is converted into a json format and used in the (next) genesis file (for a new network) to setup the module again.
Note:
What else do we need to export?
Contract state is persisted by
wasm
but not easy to read/maintainThe text was updated successfully, but these errors were encountered: