Skip to content

Commit 1fbd28e

Browse files
committed
feat: big 'ol refactor & improvement of lotus-shed msg
1 parent 84eb777 commit 1fbd28e

File tree

17 files changed

+871
-443
lines changed

17 files changed

+871
-443
lines changed

api/docgen/docgen.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ func init() {
181181
addExample(map[string]types.Actor{
182182
"t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor),
183183
})
184+
addExample(types.IpldOpGet)
185+
addExample(&types.TraceIpld{
186+
Op: types.IpldOpGet,
187+
Cid: c,
188+
Size: 123,
189+
})
184190
addExample(&types.ExecutionTrace{
185191
Msg: ExampleValue("init", reflect.TypeOf(types.MessageTrace{}), nil).(types.MessageTrace),
186192
MsgRct: ExampleValue("init", reflect.TypeOf(types.ReturnTrace{}), nil).(types.ReturnTrace),

api/mocks/mock_full.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v0api/proxy_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v0api/v0mocks/mock_full.go

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/openrpc/full.json

Lines changed: 133 additions & 89 deletions
Large diffs are not rendered by default.

build/openrpc/gateway.json

Lines changed: 92 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -8257,102 +8257,29 @@
82578257
},
82588258
{
82598259
"name": "Filecoin.StateCall",
8260-
"description": "```go\nfunc (s *GatewayStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) {\n\tif s.Internal.StateCall == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.StateCall(p0, p1, p2)\n}\n```",
8260+
"description": "```go\nfunc (s *GatewayStruct) StateCall(p0 context.Context, p1 jsonrpc.RawParams) (*InvocResult, error) {\n\tif s.Internal.StateCall == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.StateCall(p0, p1)\n}\n```",
82618261
"summary": "There are not yet any comments for this method.",
82628262
"paramStructure": "by-position",
82638263
"params": [
82648264
{
82658265
"name": "p1",
8266-
"description": "*types.Message",
8266+
"description": "jsonrpc.RawParams",
82678267
"summary": "",
82688268
"schema": {
82698269
"examples": [
8270-
{
8271-
"Version": 42,
8272-
"To": "f01234",
8273-
"From": "f01234",
8274-
"Nonce": 42,
8275-
"Value": "0",
8276-
"GasLimit": 9,
8277-
"GasFeeCap": "0",
8278-
"GasPremium": "0",
8279-
"Method": 1,
8280-
"Params": "Ynl0ZSBhcnJheQ==",
8281-
"CID": {
8282-
"/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s"
8283-
}
8284-
}
8270+
"Bw=="
82858271
],
8286-
"additionalProperties": false,
8287-
"properties": {
8288-
"From": {
8289-
"additionalProperties": false,
8290-
"type": "object"
8291-
},
8292-
"GasFeeCap": {
8293-
"additionalProperties": false,
8294-
"type": "object"
8295-
},
8296-
"GasLimit": {
8297-
"title": "number",
8298-
"type": "number"
8299-
},
8300-
"GasPremium": {
8301-
"additionalProperties": false,
8302-
"type": "object"
8303-
},
8304-
"Method": {
8305-
"title": "number",
8306-
"type": "number"
8307-
},
8308-
"Nonce": {
8309-
"title": "number",
8310-
"type": "number"
8311-
},
8312-
"Params": {
8313-
"media": {
8314-
"binaryEncoding": "base64"
8315-
},
8316-
"type": "string"
8317-
},
8318-
"To": {
8319-
"additionalProperties": false,
8320-
"type": "object"
8321-
},
8322-
"Value": {
8323-
"additionalProperties": false,
8324-
"type": "object"
8325-
},
8326-
"Version": {
8272+
"items": [
8273+
{
83278274
"title": "number",
8328-
"type": "number"
8275+
"description": "Number is a number",
8276+
"type": [
8277+
"number"
8278+
]
83298279
}
8330-
},
8331-
"type": [
8332-
"object"
8333-
]
8334-
},
8335-
"required": true,
8336-
"deprecated": false
8337-
},
8338-
{
8339-
"name": "p2",
8340-
"description": "types.TipSetKey",
8341-
"summary": "",
8342-
"schema": {
8343-
"examples": [
8344-
[
8345-
{
8346-
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
8347-
},
8348-
{
8349-
"/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve"
8350-
}
8351-
]
83528280
],
8353-
"additionalProperties": false,
83548281
"type": [
8355-
"object"
8282+
"array"
83568283
]
83578284
},
83588285
"required": true,
@@ -8486,16 +8413,34 @@
84868413
"Subcalls": null,
84878414
"Logs": [
84888415
"string value"
8416+
],
8417+
"IpldOps": [
8418+
{
8419+
"Op": "Get",
8420+
"Cid": {
8421+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
8422+
},
8423+
"Size": 42
8424+
}
84898425
]
84908426
}
84918427
],
84928428
"Logs": [
84938429
"string value"
8430+
],
8431+
"IpldOps": [
8432+
{
8433+
"Op": "Get",
8434+
"Cid": {
8435+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
8436+
},
8437+
"Size": 42
8438+
}
84948439
]
84958440
},
84968441
"Error": "string value",
84978442
"Duration": 60000000000,
8498-
"CachedBlocks": [
8443+
"Blocks": [
84998444
{
85008445
"Cid": {
85018446
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
@@ -8507,7 +8452,7 @@
85078452
],
85088453
"additionalProperties": false,
85098454
"properties": {
8510-
"CachedBlocks": {
8455+
"Blocks": {
85118456
"items": {
85128457
"additionalProperties": false,
85138458
"properties": {
@@ -8600,6 +8545,27 @@
86008545
},
86018546
"type": "object"
86028547
},
8548+
"IpldOps": {
8549+
"items": {
8550+
"additionalProperties": false,
8551+
"properties": {
8552+
"Cid": {
8553+
"title": "Content Identifier",
8554+
"type": "string"
8555+
},
8556+
"Op": {
8557+
"title": "number",
8558+
"type": "number"
8559+
},
8560+
"Size": {
8561+
"title": "number",
8562+
"type": "number"
8563+
}
8564+
},
8565+
"type": "object"
8566+
},
8567+
"type": "array"
8568+
},
86038569
"Logs": {
86048570
"items": {
86058571
"type": "string"
@@ -11239,16 +11205,34 @@
1123911205
"Subcalls": null,
1124011206
"Logs": [
1124111207
"string value"
11208+
],
11209+
"IpldOps": [
11210+
{
11211+
"Op": "Get",
11212+
"Cid": {
11213+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
11214+
},
11215+
"Size": 42
11216+
}
1124211217
]
1124311218
}
1124411219
],
1124511220
"Logs": [
1124611221
"string value"
11222+
],
11223+
"IpldOps": [
11224+
{
11225+
"Op": "Get",
11226+
"Cid": {
11227+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
11228+
},
11229+
"Size": 42
11230+
}
1124711231
]
1124811232
},
1124911233
"Error": "string value",
1125011234
"Duration": 60000000000,
11251-
"CachedBlocks": [
11235+
"Blocks": [
1125211236
{
1125311237
"Cid": {
1125411238
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
@@ -11260,7 +11244,7 @@
1126011244
],
1126111245
"additionalProperties": false,
1126211246
"properties": {
11263-
"CachedBlocks": {
11247+
"Blocks": {
1126411248
"items": {
1126511249
"additionalProperties": false,
1126611250
"properties": {
@@ -11353,6 +11337,27 @@
1135311337
},
1135411338
"type": "object"
1135511339
},
11340+
"IpldOps": {
11341+
"items": {
11342+
"additionalProperties": false,
11343+
"properties": {
11344+
"Cid": {
11345+
"title": "Content Identifier",
11346+
"type": "string"
11347+
},
11348+
"Op": {
11349+
"title": "number",
11350+
"type": "number"
11351+
},
11352+
"Size": {
11353+
"title": "number",
11354+
"type": "number"
11355+
}
11356+
},
11357+
"type": "object"
11358+
},
11359+
"type": "array"
11360+
},
1135611361
"Logs": {
1135711362
"items": {
1135811363
"type": "string"

chain/stmgr/call.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ func (sm *StateManager) callInternal(
322322
}
323323

324324
if flushAllBlocks {
325+
if _, err := vmi.Flush(ctx); err != nil {
326+
return nil, xerrors.Errorf("flushing vm: %w", err)
327+
}
325328
acc, ok := vmopt.Bstore.(*blockstore.Accumulator)
326329
if !ok {
327330
return nil, xerrors.Errorf("expected accumulator blockstore, got %T", vmopt.Bstore)

0 commit comments

Comments
 (0)