Skip to content

Commit 1fc79fc

Browse files
committed
feat: fvm: update the FVM/FFI to v4.1
This: 1. Adds nv22 support. 2. Updates the message tracing format.
1 parent 95fb198 commit 1fc79fc

File tree

12 files changed

+345
-74
lines changed

12 files changed

+345
-74
lines changed

CHANGELOG.md

+46
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,52 @@
44

55
## Improvements
66

7+
### Tracing API
8+
9+
Replace the `CodeCid` field in the message trace (added in 1.23.4) with an `InvokedActor` field.
10+
11+
**Before:**
12+
13+
```javascript
14+
{
15+
"Msg": {
16+
"From": ...,
17+
"To": ...,
18+
...
19+
"CodeCid": ... // The actor's code CID.
20+
}
21+
"MsgRct": ...,
22+
"GasCharges": [],
23+
"Subcalls": [],
24+
}
25+
```
26+
27+
**After:**
28+
29+
```javascript
30+
{
31+
"Msg": {
32+
"From": ...,
33+
"To": ...
34+
}
35+
"InvokedActor": { // The invoked actor (ommitted if the actor wasn't invoked).
36+
"Id": 1234, // The ID of the actor.
37+
"State": { // The actor's state object (may change between network versions).
38+
"Code": ..., // The actor's code CID.
39+
"Head": ..., // The actor's state-root (when invoked).
40+
"CallSeqNum": ..., // The actor's nonce.
41+
"Balance": ..., // The actor's balance (when invoked).
42+
"Address": ..., // Delegated address (FEVM only).
43+
}
44+
}
45+
"MsgRct": ...,
46+
"GasCharges": [],
47+
"Subcalls": [],
48+
}
49+
```
50+
51+
This means the trace now contains an accurate "snapshot" of the actor at the time of the call, information that may not be present in the final state-tree (e.g., due to reverts). This will hopefully improve the performance and accuracy of indexing services.
52+
753
# v1.25.2 / 2024-01-11
854

955
This is an optional but **highly recommended feature release** of Lotus, as it includes fixes for synchronizations issues that users have experienced. The feature release also introduces `Lotus-Provider` in its alpha testing phase, as well as the ability to call external PC2-binaries during the sealing process.

api/docgen/docgen.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ func init() {
154154
addExample(map[verifreg.ClaimId]verifreg.Claim{})
155155
addExample(map[string]int{"name": 42})
156156
addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()})
157+
addExample(abi.ActorID(1000))
158+
addExample(map[string]types.Actor{
159+
"t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor),
160+
})
157161
addExample(&types.ExecutionTrace{
158162
Msg: ExampleValue("init", reflect.TypeOf(types.MessageTrace{}), nil).(types.MessageTrace),
159163
MsgRct: ExampleValue("init", reflect.TypeOf(types.ReturnTrace{}), nil).(types.ReturnTrace),
160164
})
161-
addExample(map[string]types.Actor{
162-
"t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor),
163-
})
164165
addExample(map[string]api.MarketDeal{
165166
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal),
166167
})
@@ -209,7 +210,6 @@ func init() {
209210
si := uint64(12)
210211
addExample(&si)
211212
addExample(retrievalmarket.DealID(5))
212-
addExample(abi.ActorID(1000))
213213
addExample(map[string]cid.Cid{})
214214
addExample(map[string][]api.SealedRef{
215215
"98000": {

build/openrpc/full.json.gz

111 Bytes
Binary file not shown.

build/openrpc/gateway.json.gz

61 Bytes
Binary file not shown.

chain/types/cbor_gen.go

+104-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/types/execresult.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"encoding/json"
55
"time"
66

7-
"github.com/ipfs/go-cid"
8-
97
"github.com/filecoin-project/go-address"
108
"github.com/filecoin-project/go-state-types/abi"
119
"github.com/filecoin-project/go-state-types/exitcode"
@@ -28,7 +26,11 @@ type MessageTrace struct {
2826
ParamsCodec uint64
2927
GasLimit uint64
3028
ReadOnly bool
31-
CodeCid cid.Cid
29+
}
30+
31+
type ActorTrace struct {
32+
Id abi.ActorID
33+
State Actor
3234
}
3335

3436
type ReturnTrace struct {
@@ -38,10 +40,11 @@ type ReturnTrace struct {
3840
}
3941

4042
type ExecutionTrace struct {
41-
Msg MessageTrace
42-
MsgRct ReturnTrace
43-
GasCharges []*GasTrace `cborgen:"maxlen=1000000000"`
44-
Subcalls []ExecutionTrace `cborgen:"maxlen=1000000000"`
43+
Msg MessageTrace
44+
MsgRct ReturnTrace
45+
InvokedActor *ActorTrace `json:",omitempty"`
46+
GasCharges []*GasTrace `cborgen:"maxlen=1000000000"`
47+
Subcalls []ExecutionTrace `cborgen:"maxlen=1000000000"`
4548
}
4649

4750
func (et ExecutionTrace) SumGas() GasTrace {

0 commit comments

Comments
 (0)