dev: impl serde traits on StarknetOsOutput
Closed this issue · 2 comments
EvolveArt commented
As part of the integration in https://github.com/karnotxyz/madara-orchestrator we'd need the output to be (de)serializable for easy storage/reading.
Happy to provide a PR if necessary!
odesenfans commented
I implemented this feature in #245. This produces the following JSON format:
{
"initial_root": "0x5594a2d89ad4eff183ea6a7f4d4bf247fb799f3db54bc6d94ea441e0c99a4ac",
"final_root": "0x12b31d0ff0c0f5aa076d2e7039d2e19329a8a4a4ada68f42f2e0b6b8af304fd",
"block_number": "0x7d1",
"block_hash": "0x0",
"starknet_os_config_hash": "0x5d4d0b87442f4c6c120e8d207e27c0e01796ad1e57c5323292ecaf655b53b05",
"use_kzg_da": "0x0",
"messages_to_l1": [],
"messages_to_l2": [],
"contracts": [
{
"addr": "0x1",
"nonce": "0x0",
"class_hash": null,
"storage_changes": {
"0x7c7": "0x42"
}
},
{
"addr": "0x1001",
"nonce": "0x0",
"class_hash": null,
"storage_changes": {
"0x27e66af6f5df3e043d32367d68ece7e13645cca1ca9f80dfdaff9013fddf0c5": "0xddec034b926f800",
"0x723973208639b7839ce298f7ffea61e3f9533872defd7abdb91023db4658812": "0x1f67eee3d0800"
}
}
],
"classes": {
}
}
One of the limitations I can think of is that currently we do not parse messages in a meaningful way, we keep them as vectors of felts. I might get to do that sooner than later, TBD.
odesenfans commented
@EvolveArt let me know if this works for you, without an answer I'll merge it by end of day. We can make subsequent modifications, of course.