Skip to content

Commit

Permalink
feat(exec): dump intermediate cache blocks from FVM exec in StateReplay
Browse files Browse the repository at this point in the history
* 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`.
  • Loading branch information
rvagg committed Jan 11, 2025
1 parent b3a6572 commit 369d5be
Show file tree
Hide file tree
Showing 19 changed files with 507 additions and 37 deletions.
6 changes: 6 additions & 0 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,12 @@ type InvocResult struct {
ExecutionTrace types.ExecutionTrace
Error string
Duration time.Duration
CachedBlocks []Block `json:",omitempty"`
}

type Block struct {
Cid cid.Cid
Data []byte
}

type IpldObject struct {
Expand Down
129 changes: 123 additions & 6 deletions build/openrpc/full.json
Original file line number Diff line number Diff line change
Expand Up @@ -17487,16 +17487,49 @@
"tt": 60000000000
}
],
"Subcalls": null
"Subcalls": null,
"Logs": [
"string value"
]
}
],
"Logs": [
"string value"
]
},
"Error": "string value",
"Duration": 60000000000
"Duration": 60000000000,
"CachedBlocks": [
{
"Cid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Data": "Ynl0ZSBhcnJheQ=="
}
]
}
],
"additionalProperties": false,
"properties": {
"CachedBlocks": {
"items": {
"additionalProperties": false,
"properties": {
"Cid": {
"title": "Content Identifier",
"type": "string"
},
"Data": {
"media": {
"binaryEncoding": "base64"
},
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"Duration": {
"title": "number",
"type": "number"
Expand Down Expand Up @@ -17571,6 +17604,12 @@
},
"type": "object"
},
"Logs": {
"items": {
"type": "string"
},
"type": "array"
},
"Msg": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -18182,12 +18221,26 @@
"tt": 60000000000
}
],
"Subcalls": null
"Subcalls": null,
"Logs": [
"string value"
]
}
],
"Logs": [
"string value"
]
},
"Error": "string value",
"Duration": 60000000000
"Duration": 60000000000,
"CachedBlocks": [
{
"Cid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Data": "Ynl0ZSBhcnJheQ=="
}
]
}
]
}
Expand All @@ -18202,6 +18255,25 @@
"items": {
"additionalProperties": false,
"properties": {
"CachedBlocks": {
"items": {
"additionalProperties": false,
"properties": {
"Cid": {
"title": "Content Identifier",
"type": "string"
},
"Data": {
"media": {
"binaryEncoding": "base64"
},
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"Duration": {
"title": "number",
"type": "number"
Expand Down Expand Up @@ -18276,6 +18348,12 @@
},
"type": "object"
},
"Logs": {
"items": {
"type": "string"
},
"type": "array"
},
"Msg": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -23541,16 +23619,49 @@
"tt": 60000000000
}
],
"Subcalls": null
"Subcalls": null,
"Logs": [
"string value"
]
}
],
"Logs": [
"string value"
]
},
"Error": "string value",
"Duration": 60000000000
"Duration": 60000000000,
"CachedBlocks": [
{
"Cid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Data": "Ynl0ZSBhcnJheQ=="
}
]
}
],
"additionalProperties": false,
"properties": {
"CachedBlocks": {
"items": {
"additionalProperties": false,
"properties": {
"Cid": {
"title": "Content Identifier",
"type": "string"
},
"Data": {
"media": {
"binaryEncoding": "base64"
},
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"Duration": {
"title": "number",
"type": "number"
Expand Down Expand Up @@ -23625,6 +23736,12 @@
},
"type": "object"
},
"Logs": {
"items": {
"type": "string"
},
"type": "array"
},
"Msg": {
"additionalProperties": false,
"properties": {
Expand Down
86 changes: 82 additions & 4 deletions build/openrpc/gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -8386,16 +8386,49 @@
"tt": 60000000000
}
],
"Subcalls": null
"Subcalls": null,
"Logs": [
"string value"
]
}
],
"Logs": [
"string value"
]
},
"Error": "string value",
"Duration": 60000000000
"Duration": 60000000000,
"CachedBlocks": [
{
"Cid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Data": "Ynl0ZSBhcnJheQ=="
}
]
}
],
"additionalProperties": false,
"properties": {
"CachedBlocks": {
"items": {
"additionalProperties": false,
"properties": {
"Cid": {
"title": "Content Identifier",
"type": "string"
},
"Data": {
"media": {
"binaryEncoding": "base64"
},
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"Duration": {
"title": "number",
"type": "number"
Expand Down Expand Up @@ -8470,6 +8503,12 @@
},
"type": "object"
},
"Logs": {
"items": {
"type": "string"
},
"type": "array"
},
"Msg": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -10872,16 +10911,49 @@
"tt": 60000000000
}
],
"Subcalls": null
"Subcalls": null,
"Logs": [
"string value"
]
}
],
"Logs": [
"string value"
]
},
"Error": "string value",
"Duration": 60000000000
"Duration": 60000000000,
"CachedBlocks": [
{
"Cid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Data": "Ynl0ZSBhcnJheQ=="
}
]
}
],
"additionalProperties": false,
"properties": {
"CachedBlocks": {
"items": {
"additionalProperties": false,
"properties": {
"Cid": {
"title": "Content Identifier",
"type": "string"
},
"Data": {
"media": {
"binaryEncoding": "base64"
},
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"Duration": {
"title": "number",
"type": "number"
Expand Down Expand Up @@ -10956,6 +11028,12 @@
},
"type": "object"
},
"Logs": {
"items": {
"type": "string"
},
"type": "array"
},
"Msg": {
"additionalProperties": false,
"properties": {
Expand Down
Loading

0 comments on commit 369d5be

Please sign in to comment.