Skip to content

Commit 369d5be

Browse files
committed
feat(exec): dump intermediate cache blocks from FVM exec in StateReplay
* Plumb through dump_cache from fvm4 to access intermediate blocks: - filecoin-project/filecoin-ffi#512 - filecoin-project/ref-fvm#2101 * Enable cache dumping in StateReplay with LOTUS_REPLAY_DUMP_CACHED_BLOCKS * Add optional "Blocks" field InvocResult * Handle ExecutionEvent::Log's and add "Logs" field to ExecutionTrace * Dump intermediate cache blocks to CAR in /tmp when they appear while using `lotus-shed msg --exec-trace`.
1 parent b3a6572 commit 369d5be

File tree

19 files changed

+507
-37
lines changed

19 files changed

+507
-37
lines changed

api/api_full.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,12 @@ type InvocResult struct {
12621262
ExecutionTrace types.ExecutionTrace
12631263
Error string
12641264
Duration time.Duration
1265+
CachedBlocks []Block `json:",omitempty"`
1266+
}
1267+
1268+
type Block struct {
1269+
Cid cid.Cid
1270+
Data []byte
12651271
}
12661272

12671273
type IpldObject struct {

build/openrpc/full.json

Lines changed: 123 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17487,16 +17487,49 @@
1748717487
"tt": 60000000000
1748817488
}
1748917489
],
17490-
"Subcalls": null
17490+
"Subcalls": null,
17491+
"Logs": [
17492+
"string value"
17493+
]
1749117494
}
17495+
],
17496+
"Logs": [
17497+
"string value"
1749217498
]
1749317499
},
1749417500
"Error": "string value",
17495-
"Duration": 60000000000
17501+
"Duration": 60000000000,
17502+
"CachedBlocks": [
17503+
{
17504+
"Cid": {
17505+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
17506+
},
17507+
"Data": "Ynl0ZSBhcnJheQ=="
17508+
}
17509+
]
1749617510
}
1749717511
],
1749817512
"additionalProperties": false,
1749917513
"properties": {
17514+
"CachedBlocks": {
17515+
"items": {
17516+
"additionalProperties": false,
17517+
"properties": {
17518+
"Cid": {
17519+
"title": "Content Identifier",
17520+
"type": "string"
17521+
},
17522+
"Data": {
17523+
"media": {
17524+
"binaryEncoding": "base64"
17525+
},
17526+
"type": "string"
17527+
}
17528+
},
17529+
"type": "object"
17530+
},
17531+
"type": "array"
17532+
},
1750017533
"Duration": {
1750117534
"title": "number",
1750217535
"type": "number"
@@ -17571,6 +17604,12 @@
1757117604
},
1757217605
"type": "object"
1757317606
},
17607+
"Logs": {
17608+
"items": {
17609+
"type": "string"
17610+
},
17611+
"type": "array"
17612+
},
1757417613
"Msg": {
1757517614
"additionalProperties": false,
1757617615
"properties": {
@@ -18182,12 +18221,26 @@
1818218221
"tt": 60000000000
1818318222
}
1818418223
],
18185-
"Subcalls": null
18224+
"Subcalls": null,
18225+
"Logs": [
18226+
"string value"
18227+
]
1818618228
}
18229+
],
18230+
"Logs": [
18231+
"string value"
1818718232
]
1818818233
},
1818918234
"Error": "string value",
18190-
"Duration": 60000000000
18235+
"Duration": 60000000000,
18236+
"CachedBlocks": [
18237+
{
18238+
"Cid": {
18239+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
18240+
},
18241+
"Data": "Ynl0ZSBhcnJheQ=="
18242+
}
18243+
]
1819118244
}
1819218245
]
1819318246
}
@@ -18202,6 +18255,25 @@
1820218255
"items": {
1820318256
"additionalProperties": false,
1820418257
"properties": {
18258+
"CachedBlocks": {
18259+
"items": {
18260+
"additionalProperties": false,
18261+
"properties": {
18262+
"Cid": {
18263+
"title": "Content Identifier",
18264+
"type": "string"
18265+
},
18266+
"Data": {
18267+
"media": {
18268+
"binaryEncoding": "base64"
18269+
},
18270+
"type": "string"
18271+
}
18272+
},
18273+
"type": "object"
18274+
},
18275+
"type": "array"
18276+
},
1820518277
"Duration": {
1820618278
"title": "number",
1820718279
"type": "number"
@@ -18276,6 +18348,12 @@
1827618348
},
1827718349
"type": "object"
1827818350
},
18351+
"Logs": {
18352+
"items": {
18353+
"type": "string"
18354+
},
18355+
"type": "array"
18356+
},
1827918357
"Msg": {
1828018358
"additionalProperties": false,
1828118359
"properties": {
@@ -23541,16 +23619,49 @@
2354123619
"tt": 60000000000
2354223620
}
2354323621
],
23544-
"Subcalls": null
23622+
"Subcalls": null,
23623+
"Logs": [
23624+
"string value"
23625+
]
2354523626
}
23627+
],
23628+
"Logs": [
23629+
"string value"
2354623630
]
2354723631
},
2354823632
"Error": "string value",
23549-
"Duration": 60000000000
23633+
"Duration": 60000000000,
23634+
"CachedBlocks": [
23635+
{
23636+
"Cid": {
23637+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
23638+
},
23639+
"Data": "Ynl0ZSBhcnJheQ=="
23640+
}
23641+
]
2355023642
}
2355123643
],
2355223644
"additionalProperties": false,
2355323645
"properties": {
23646+
"CachedBlocks": {
23647+
"items": {
23648+
"additionalProperties": false,
23649+
"properties": {
23650+
"Cid": {
23651+
"title": "Content Identifier",
23652+
"type": "string"
23653+
},
23654+
"Data": {
23655+
"media": {
23656+
"binaryEncoding": "base64"
23657+
},
23658+
"type": "string"
23659+
}
23660+
},
23661+
"type": "object"
23662+
},
23663+
"type": "array"
23664+
},
2355423665
"Duration": {
2355523666
"title": "number",
2355623667
"type": "number"
@@ -23625,6 +23736,12 @@
2362523736
},
2362623737
"type": "object"
2362723738
},
23739+
"Logs": {
23740+
"items": {
23741+
"type": "string"
23742+
},
23743+
"type": "array"
23744+
},
2362823745
"Msg": {
2362923746
"additionalProperties": false,
2363023747
"properties": {

build/openrpc/gateway.json

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8386,16 +8386,49 @@
83868386
"tt": 60000000000
83878387
}
83888388
],
8389-
"Subcalls": null
8389+
"Subcalls": null,
8390+
"Logs": [
8391+
"string value"
8392+
]
83908393
}
8394+
],
8395+
"Logs": [
8396+
"string value"
83918397
]
83928398
},
83938399
"Error": "string value",
8394-
"Duration": 60000000000
8400+
"Duration": 60000000000,
8401+
"CachedBlocks": [
8402+
{
8403+
"Cid": {
8404+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
8405+
},
8406+
"Data": "Ynl0ZSBhcnJheQ=="
8407+
}
8408+
]
83958409
}
83968410
],
83978411
"additionalProperties": false,
83988412
"properties": {
8413+
"CachedBlocks": {
8414+
"items": {
8415+
"additionalProperties": false,
8416+
"properties": {
8417+
"Cid": {
8418+
"title": "Content Identifier",
8419+
"type": "string"
8420+
},
8421+
"Data": {
8422+
"media": {
8423+
"binaryEncoding": "base64"
8424+
},
8425+
"type": "string"
8426+
}
8427+
},
8428+
"type": "object"
8429+
},
8430+
"type": "array"
8431+
},
83998432
"Duration": {
84008433
"title": "number",
84018434
"type": "number"
@@ -8470,6 +8503,12 @@
84708503
},
84718504
"type": "object"
84728505
},
8506+
"Logs": {
8507+
"items": {
8508+
"type": "string"
8509+
},
8510+
"type": "array"
8511+
},
84738512
"Msg": {
84748513
"additionalProperties": false,
84758514
"properties": {
@@ -10872,16 +10911,49 @@
1087210911
"tt": 60000000000
1087310912
}
1087410913
],
10875-
"Subcalls": null
10914+
"Subcalls": null,
10915+
"Logs": [
10916+
"string value"
10917+
]
1087610918
}
10919+
],
10920+
"Logs": [
10921+
"string value"
1087710922
]
1087810923
},
1087910924
"Error": "string value",
10880-
"Duration": 60000000000
10925+
"Duration": 60000000000,
10926+
"CachedBlocks": [
10927+
{
10928+
"Cid": {
10929+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
10930+
},
10931+
"Data": "Ynl0ZSBhcnJheQ=="
10932+
}
10933+
]
1088110934
}
1088210935
],
1088310936
"additionalProperties": false,
1088410937
"properties": {
10938+
"CachedBlocks": {
10939+
"items": {
10940+
"additionalProperties": false,
10941+
"properties": {
10942+
"Cid": {
10943+
"title": "Content Identifier",
10944+
"type": "string"
10945+
},
10946+
"Data": {
10947+
"media": {
10948+
"binaryEncoding": "base64"
10949+
},
10950+
"type": "string"
10951+
}
10952+
},
10953+
"type": "object"
10954+
},
10955+
"type": "array"
10956+
},
1088510957
"Duration": {
1088610958
"title": "number",
1088710959
"type": "number"
@@ -10956,6 +11028,12 @@
1095611028
},
1095711029
"type": "object"
1095811030
},
11031+
"Logs": {
11032+
"items": {
11033+
"type": "string"
11034+
},
11035+
"type": "array"
11036+
},
1095911037
"Msg": {
1096011038
"additionalProperties": false,
1096111039
"properties": {

0 commit comments

Comments
 (0)