Skip to content

Commit 69c0c47

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 13d5007 commit 69c0c47

File tree

18 files changed

+506
-36
lines changed

18 files changed

+506
-36
lines changed

api/api_full.go

+6
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,12 @@ type InvocResult struct {
12701270
ExecutionTrace types.ExecutionTrace
12711271
Error string
12721272
Duration time.Duration
1273+
CachedBlocks []Block `json:",omitempty"`
1274+
}
1275+
1276+
type Block struct {
1277+
Cid cid.Cid
1278+
Data []byte
12731279
}
12741280

12751281
type IpldObject struct {

build/openrpc/full.json

+123-6
Original file line numberDiff line numberDiff line change
@@ -17658,16 +17658,49 @@
1765817658
"tt": 60000000000
1765917659
}
1766017660
],
17661-
"Subcalls": null
17661+
"Subcalls": null,
17662+
"Logs": [
17663+
"string value"
17664+
]
1766217665
}
17666+
],
17667+
"Logs": [
17668+
"string value"
1766317669
]
1766417670
},
1766517671
"Error": "string value",
17666-
"Duration": 60000000000
17672+
"Duration": 60000000000,
17673+
"CachedBlocks": [
17674+
{
17675+
"Cid": {
17676+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
17677+
},
17678+
"Data": "Ynl0ZSBhcnJheQ=="
17679+
}
17680+
]
1766717681
}
1766817682
],
1766917683
"additionalProperties": false,
1767017684
"properties": {
17685+
"CachedBlocks": {
17686+
"items": {
17687+
"additionalProperties": false,
17688+
"properties": {
17689+
"Cid": {
17690+
"title": "Content Identifier",
17691+
"type": "string"
17692+
},
17693+
"Data": {
17694+
"media": {
17695+
"binaryEncoding": "base64"
17696+
},
17697+
"type": "string"
17698+
}
17699+
},
17700+
"type": "object"
17701+
},
17702+
"type": "array"
17703+
},
1767117704
"Duration": {
1767217705
"title": "number",
1767317706
"type": "number"
@@ -17742,6 +17775,12 @@
1774217775
},
1774317776
"type": "object"
1774417777
},
17778+
"Logs": {
17779+
"items": {
17780+
"type": "string"
17781+
},
17782+
"type": "array"
17783+
},
1774517784
"Msg": {
1774617785
"additionalProperties": false,
1774717786
"properties": {
@@ -18353,12 +18392,26 @@
1835318392
"tt": 60000000000
1835418393
}
1835518394
],
18356-
"Subcalls": null
18395+
"Subcalls": null,
18396+
"Logs": [
18397+
"string value"
18398+
]
1835718399
}
18400+
],
18401+
"Logs": [
18402+
"string value"
1835818403
]
1835918404
},
1836018405
"Error": "string value",
18361-
"Duration": 60000000000
18406+
"Duration": 60000000000,
18407+
"CachedBlocks": [
18408+
{
18409+
"Cid": {
18410+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
18411+
},
18412+
"Data": "Ynl0ZSBhcnJheQ=="
18413+
}
18414+
]
1836218415
}
1836318416
]
1836418417
}
@@ -18373,6 +18426,25 @@
1837318426
"items": {
1837418427
"additionalProperties": false,
1837518428
"properties": {
18429+
"CachedBlocks": {
18430+
"items": {
18431+
"additionalProperties": false,
18432+
"properties": {
18433+
"Cid": {
18434+
"title": "Content Identifier",
18435+
"type": "string"
18436+
},
18437+
"Data": {
18438+
"media": {
18439+
"binaryEncoding": "base64"
18440+
},
18441+
"type": "string"
18442+
}
18443+
},
18444+
"type": "object"
18445+
},
18446+
"type": "array"
18447+
},
1837618448
"Duration": {
1837718449
"title": "number",
1837818450
"type": "number"
@@ -18447,6 +18519,12 @@
1844718519
},
1844818520
"type": "object"
1844918521
},
18522+
"Logs": {
18523+
"items": {
18524+
"type": "string"
18525+
},
18526+
"type": "array"
18527+
},
1845018528
"Msg": {
1845118529
"additionalProperties": false,
1845218530
"properties": {
@@ -23704,16 +23782,49 @@
2370423782
"tt": 60000000000
2370523783
}
2370623784
],
23707-
"Subcalls": null
23785+
"Subcalls": null,
23786+
"Logs": [
23787+
"string value"
23788+
]
2370823789
}
23790+
],
23791+
"Logs": [
23792+
"string value"
2370923793
]
2371023794
},
2371123795
"Error": "string value",
23712-
"Duration": 60000000000
23796+
"Duration": 60000000000,
23797+
"CachedBlocks": [
23798+
{
23799+
"Cid": {
23800+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
23801+
},
23802+
"Data": "Ynl0ZSBhcnJheQ=="
23803+
}
23804+
]
2371323805
}
2371423806
],
2371523807
"additionalProperties": false,
2371623808
"properties": {
23809+
"CachedBlocks": {
23810+
"items": {
23811+
"additionalProperties": false,
23812+
"properties": {
23813+
"Cid": {
23814+
"title": "Content Identifier",
23815+
"type": "string"
23816+
},
23817+
"Data": {
23818+
"media": {
23819+
"binaryEncoding": "base64"
23820+
},
23821+
"type": "string"
23822+
}
23823+
},
23824+
"type": "object"
23825+
},
23826+
"type": "array"
23827+
},
2371723828
"Duration": {
2371823829
"title": "number",
2371923830
"type": "number"
@@ -23788,6 +23899,12 @@
2378823899
},
2378923900
"type": "object"
2379023901
},
23902+
"Logs": {
23903+
"items": {
23904+
"type": "string"
23905+
},
23906+
"type": "array"
23907+
},
2379123908
"Msg": {
2379223909
"additionalProperties": false,
2379323910
"properties": {

build/openrpc/gateway.json

+82-4
Original file line numberDiff line numberDiff line change
@@ -8483,16 +8483,49 @@
84838483
"tt": 60000000000
84848484
}
84858485
],
8486-
"Subcalls": null
8486+
"Subcalls": null,
8487+
"Logs": [
8488+
"string value"
8489+
]
84878490
}
8491+
],
8492+
"Logs": [
8493+
"string value"
84888494
]
84898495
},
84908496
"Error": "string value",
8491-
"Duration": 60000000000
8497+
"Duration": 60000000000,
8498+
"CachedBlocks": [
8499+
{
8500+
"Cid": {
8501+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
8502+
},
8503+
"Data": "Ynl0ZSBhcnJheQ=="
8504+
}
8505+
]
84928506
}
84938507
],
84948508
"additionalProperties": false,
84958509
"properties": {
8510+
"CachedBlocks": {
8511+
"items": {
8512+
"additionalProperties": false,
8513+
"properties": {
8514+
"Cid": {
8515+
"title": "Content Identifier",
8516+
"type": "string"
8517+
},
8518+
"Data": {
8519+
"media": {
8520+
"binaryEncoding": "base64"
8521+
},
8522+
"type": "string"
8523+
}
8524+
},
8525+
"type": "object"
8526+
},
8527+
"type": "array"
8528+
},
84968529
"Duration": {
84978530
"title": "number",
84988531
"type": "number"
@@ -8567,6 +8600,12 @@
85678600
},
85688601
"type": "object"
85698602
},
8603+
"Logs": {
8604+
"items": {
8605+
"type": "string"
8606+
},
8607+
"type": "array"
8608+
},
85708609
"Msg": {
85718610
"additionalProperties": false,
85728611
"properties": {
@@ -11197,16 +11236,49 @@
1119711236
"tt": 60000000000
1119811237
}
1119911238
],
11200-
"Subcalls": null
11239+
"Subcalls": null,
11240+
"Logs": [
11241+
"string value"
11242+
]
1120111243
}
11244+
],
11245+
"Logs": [
11246+
"string value"
1120211247
]
1120311248
},
1120411249
"Error": "string value",
11205-
"Duration": 60000000000
11250+
"Duration": 60000000000,
11251+
"CachedBlocks": [
11252+
{
11253+
"Cid": {
11254+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
11255+
},
11256+
"Data": "Ynl0ZSBhcnJheQ=="
11257+
}
11258+
]
1120611259
}
1120711260
],
1120811261
"additionalProperties": false,
1120911262
"properties": {
11263+
"CachedBlocks": {
11264+
"items": {
11265+
"additionalProperties": false,
11266+
"properties": {
11267+
"Cid": {
11268+
"title": "Content Identifier",
11269+
"type": "string"
11270+
},
11271+
"Data": {
11272+
"media": {
11273+
"binaryEncoding": "base64"
11274+
},
11275+
"type": "string"
11276+
}
11277+
},
11278+
"type": "object"
11279+
},
11280+
"type": "array"
11281+
},
1121011282
"Duration": {
1121111283
"title": "number",
1121211284
"type": "number"
@@ -11281,6 +11353,12 @@
1128111353
},
1128211354
"type": "object"
1128311355
},
11356+
"Logs": {
11357+
"items": {
11358+
"type": "string"
11359+
},
11360+
"type": "array"
11361+
},
1128411362
"Msg": {
1128511363
"additionalProperties": false,
1128611364
"properties": {

0 commit comments

Comments
 (0)