From cf910a8d1a25d46267412b3e5f7a569ef16b592d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 12 Feb 2024 18:04:46 -0800 Subject: [PATCH] fix: eth: use correct types for trace_block action/results - The top-level type is call/create. - The action/result is specific to the operation. --- build/openrpc/full.json | 154 +------- build/openrpc/full.json.gz | Bin 34723 -> 34654 bytes build/openrpc/gateway.json | 154 +------- build/openrpc/gateway.json.gz | Bin 11942 -> 11862 bytes chain/actors/builtin/evm/actor.go.template | 13 + chain/actors/builtin/evm/evm.go | 12 + chain/types/ethtypes/eth_types.go | 46 ++- documentation/en/api-v1-unstable-methods.md | 36 +- node/impl/full/eth.go | 7 +- node/impl/full/eth_trace.go | 385 +++++++++++++------- 10 files changed, 342 insertions(+), 465 deletions(-) diff --git a/build/openrpc/full.json b/build/openrpc/full.json index 587212849f1..d0601deb795 100644 --- a/build/openrpc/full.json +++ b/build/openrpc/full.json @@ -8386,24 +8386,14 @@ "examples": [ [ { - "action": { - "callType": "string value", - "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "gas": "0x5", - "input": "0x07", - "value": "0x0" - }, - "result": { - "gasUsed": "0x5", - "output": "0x07" - }, + "type": "string value", + "error": "string value", "subtraces": 123, "traceAddress": [ 123 ], - "type": "string value", - "error": "string value", + "action": {}, + "result": {}, "blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", "blockNumber": 9, "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", @@ -8416,48 +8406,7 @@ "additionalProperties": false, "properties": { "action": { - "additionalProperties": false, - "properties": { - "callType": { - "type": "string" - }, - "from": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "gas": { - "title": "number", - "type": "number" - }, - "input": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - }, - "to": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "value": { - "additionalProperties": false, - "type": "object" - } - }, + "additionalProperties": true, "type": "object" }, "blockHash": { @@ -8478,21 +8427,7 @@ "type": "string" }, "result": { - "additionalProperties": false, - "properties": { - "gasUsed": { - "title": "number", - "type": "number" - }, - "output": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - } - }, + "additionalProperties": true, "type": "object" }, "subtraces": { @@ -8601,24 +8536,14 @@ "stateDiff": "string value", "trace": [ { - "action": { - "callType": "string value", - "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "gas": "0x5", - "input": "0x07", - "value": "0x0" - }, - "result": { - "gasUsed": "0x5", - "output": "0x07" - }, + "type": "string value", + "error": "string value", "subtraces": 123, "traceAddress": [ 123 ], - "type": "string value", - "error": "string value" + "action": {}, + "result": {} } ], "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", @@ -8646,69 +8571,14 @@ "additionalProperties": false, "properties": { "action": { - "additionalProperties": false, - "properties": { - "callType": { - "type": "string" - }, - "from": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "gas": { - "title": "number", - "type": "number" - }, - "input": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - }, - "to": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "value": { - "additionalProperties": false, - "type": "object" - } - }, + "additionalProperties": true, "type": "object" }, "error": { "type": "string" }, "result": { - "additionalProperties": false, - "properties": { - "gasUsed": { - "title": "number", - "type": "number" - }, - "output": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - } - }, + "additionalProperties": true, "type": "object" }, "subtraces": { diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index a716b92330ca5fd46db0f448d18223892d01e12a..09793ae3323bbc5d6740bb52e230c346936074de 100644 GIT binary patch delta 11608 zcmV-eEvM3>j{@F~0-5s|oKNY!62=)XYI~y!ZF*;V6lG&&)%=CzoIG z@oJ;-->&QwL8{raXfcU7`Sl|MYZ@hk)^lD_NiCH^jOd!|dNvM!*6X2U8#Gz?jV2W^_i0V12Kjy3IF#vrZ@bpM90Z@nQsa}Pm;vNEG z-6AINg@zjw8Uh3zFJ1rXf{ofExzTzugAO@@vL=3>whlcX=1a{8ELB!DLQizgGj~`p z4mmo;lSvW&$n~UMy`Jxem%2@0hFs6;H>KNgJTuyRPIo>D=?uVRml?3sXja1XcGu6c{&K9pJE%CU z6#bzAY(#rq=Lz|E^%;y_`lHoOYlNHS$xjF(0`2(O1Ifa`jiba@}mm+%VkfI zG^BqrFog_E5CRSix;sgknPI~Nl+h`JgPmc&cS(B(k$~ydr?|@Q>(@ z+FoA_Qzns=JBlA5(+eqnc^0A>p3n4y&vKi(cd*^>>G-mP-hUH+@IM!ao%e{Lx-MzcM3;sPJ!`q4T_ulMg=*{Rgza6`G z*YIwK^?o%xYRCCrr>JU{*eW&d7FG59nK+-)6WX+=Xzoq=`C@*-XY?I^_GZY%a*2&G zf#LlLaj1*QRDMK;_I6TEs>Eq`Nt=)4k2Y6Z_LIfF!T_AQ{esmVA9>sQ=tx5IsL*Rp zG@JVQySTloUl0J39R(_Xqh0I|gO$<>reY!+C1QD2X;^kg6=&j7dNh`mOTd(bG>uD9Hj58N5Ee&&13_;_8iF1~A{cBBvZoAodx+lemz2 zz$rj?$eDB0VO9u>Wh|DlSZ0l}jKu}!xS;%G@w%eHHH8N|6$gobv-&L(D9Zr^-AWZi zm`9$AVcwrAy&2Kloo@UZ2|X+JZDan1G9j%miNCdXP(u5ro)5fO&N8yI_nI z=9thBz$+5L2~L3rZxHbC)B`@gMn3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2Knn&K(!_vF5DZgD$w{Xg$CJZPs9KozK-EaN^kokKP+Y@1H8(!g z+&o4jm_)pP4#383Dd&k)2VZ$WIaLvTAPA=#{+m{Ffv+mKrtJ6{s*lYr_JyRde$ZBr zJJiwQ*sZyrV1_zEEy57(!p_@U?RnXzw(fDcz}c#eOII4oe-zBIp5gM2LE9Pq({D&G z>{z(Jy;l?Ducpb#y_k3{mx(Iut_A8Cr9aSeRi++)n|>#;yak3=tsY&oy+O=ld&5}pc(7BVPq3}J`3brL_&J!4Qj#56jBFNHNeEGEwS6dm9>gzOKJjp6oudDs=ee{As}`Wf#$^^s+Z=?}+P$kLc&SOHVW|4T!Sj=U&hl>q6D0MQQ&^xi;jO(^#T@fff(Czbf8WZLWd~b(M*!t4-C1-7HzUQhFI4 zi*|3_lJ|EIM-o60Pi14$rQIhMi5nj=isXAlWH8E9cu3x8qftKPRBhZz_ zIHTB&)i}rDsw;=T>{a9I#$@SK+~o#bnqTEJe#IB=$NUvnoS*E~w&$T1?Cdl~NQoge&=~FInx^0* z-n89Fm(1K|f*cCd}>Kk-&%2nJ><_nV zHF&#olDKa57C-WYn|}ezd9abGO^y&Ak0(v6q3LB%FN0djAp2&sJ@=ois{c&E^!Imm z8$+wjMWFR!s|!@>4gqR-+Bgde6+Ecppxl^MhQuOw<{D-eE(49oeF+9)O&B`f4~*J*BB2jQ>Xgp!nO#d(qeN<#u(tE$|ngSZ`9Yq)sZuD($5niNF9lf+VwNZ&sH~EdK v_^X!4S2oDFECKFRk+s8;`eZoG)AQBajql&TegFRf00960z!$i$-uVUq8n>~k diff --git a/build/openrpc/gateway.json b/build/openrpc/gateway.json index 6baa34443c7..269566dd94a 100644 --- a/build/openrpc/gateway.json +++ b/build/openrpc/gateway.json @@ -4439,24 +4439,14 @@ "examples": [ [ { - "action": { - "callType": "string value", - "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "gas": "0x5", - "input": "0x07", - "value": "0x0" - }, - "result": { - "gasUsed": "0x5", - "output": "0x07" - }, + "type": "string value", + "error": "string value", "subtraces": 123, "traceAddress": [ 123 ], - "type": "string value", - "error": "string value", + "action": {}, + "result": {}, "blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", "blockNumber": 9, "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", @@ -4469,48 +4459,7 @@ "additionalProperties": false, "properties": { "action": { - "additionalProperties": false, - "properties": { - "callType": { - "type": "string" - }, - "from": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "gas": { - "title": "number", - "type": "number" - }, - "input": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - }, - "to": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "value": { - "additionalProperties": false, - "type": "object" - } - }, + "additionalProperties": true, "type": "object" }, "blockHash": { @@ -4531,21 +4480,7 @@ "type": "string" }, "result": { - "additionalProperties": false, - "properties": { - "gasUsed": { - "title": "number", - "type": "number" - }, - "output": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - } - }, + "additionalProperties": true, "type": "object" }, "subtraces": { @@ -4654,24 +4589,14 @@ "stateDiff": "string value", "trace": [ { - "action": { - "callType": "string value", - "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "gas": "0x5", - "input": "0x07", - "value": "0x0" - }, - "result": { - "gasUsed": "0x5", - "output": "0x07" - }, + "type": "string value", + "error": "string value", "subtraces": 123, "traceAddress": [ 123 ], - "type": "string value", - "error": "string value" + "action": {}, + "result": {} } ], "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", @@ -4699,69 +4624,14 @@ "additionalProperties": false, "properties": { "action": { - "additionalProperties": false, - "properties": { - "callType": { - "type": "string" - }, - "from": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "gas": { - "title": "number", - "type": "number" - }, - "input": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - }, - "to": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 20, - "minItems": 20, - "type": "array" - }, - "value": { - "additionalProperties": false, - "type": "object" - } - }, + "additionalProperties": true, "type": "object" }, "error": { "type": "string" }, "result": { - "additionalProperties": false, - "properties": { - "gasUsed": { - "title": "number", - "type": "number" - }, - "output": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "type": "array" - } - }, + "additionalProperties": true, "type": "object" }, "subtraces": { diff --git a/build/openrpc/gateway.json.gz b/build/openrpc/gateway.json.gz index be508c8fe76dba3592fbfd9cab208940b5792c54..bc012704306a49b7ceaa35f33cc4559eaca6a432 100644 GIT binary patch delta 3409 zcmV-X4X*O0UDjN%EERwG#LeR=>^#6Bu)sX(bbBO>%7Sq$^Vd$dmqc}^_Mv4GRLehJ zZ>0I*+9KpRu-6eXg?mCScuw>ksRGSx&*d(7Zpay)bZ9Tbhk`@B1o5Rdg2PRrSiThM zt~*q;slks4?n=c!raxJc%-*i6{q_#a(^d(0y@68)EC`R~d~$y(k&sp3szp6XR{i?D zQtlT67EuIBrX;Bv6hl$c70UOhi3zV8*B~l$NFyu}(+4sWN*naqxz*_B5Jw;(4XCuM zkV@puaO$#%00Rt9(Qug8X^3c{;(tSW6xsFlC^`?5JGz|gh^l%{w2|u;x!eaTiX5Vg zQq1X6Q`KIX%Cmn&S*Xb2X_U4U6TmCfd-mJqnIE5B=%mz(W+xA?Gz9nQzVX2?y{ zol?h*8LfXTn8CCcjIrhD0X)!hYOB z*S?)XiwLE>D9ZK}5=O~{YN;4mwp3pFG)eNL_e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Z!(H)9D=nWi_S{&rZori%#S7DOt z^3LYanuRdqJB%2bWpQcc5Ec54gkMvXOwcg=bpwI@hwCg@Wf>(Dpzq=#o?2!|wfE3| zZ((}-*F`wbcDqfSx0tM#LaysWeuSV#lII9G?GcYJ>54u{grH;Kj~M^C;{7ej?T#Zt zAr^oAC!qgeY#!~kUBi?$O|{6z`~WhqJK>`l-rh)Gf=d@;Gf zP)=J{J_(HYgKojgdq#vhRP}MGF1zCWn2O4qkCdyJtwh+A;%ul z27&ajvF#w+v&ce`g%O!5vi&%#rWP976hqVwysdQLrICsGfF!9{iIJzg9&!W934woe znd`4tk{I!76K9npMGX>HO6WJCYNa~y!751eCf=GxLXSS@gzBMJvk8$mU%w9)7?xb-i$buE0<<;O4}q;4%;Oqpa_4bJcpPb z9;nEZsPk%}%q)hDKw2su1?ffDclc}X*ZBlVt!)^|DORC~U?E1t3 zXrd}1NoRE@GwCksUnYNzMMNTLSgTnXEmJ#`>vt$K9MHbxtrf~ebiB;)jT(vAyjd$Z zZ391_%^UtERb1mIw~!{Y9yZSUm6Y2sO3Hl+GCuVsUZ0`7S5k*GCES#4WZJuK^Oy;R z@2hA4a`te=h)Py)yf4}S)&}r%8o(8ZEnxOm_uevNR|~;cWEU#$S5-p(gaS;m)z#!; u(!ESD=7r$b@3M7|lTj+KM_jq`acVW;?3*OYw6k#{-3thL{~G2>lL7!;gtOWJ diff --git a/chain/actors/builtin/evm/actor.go.template b/chain/actors/builtin/evm/actor.go.template index 62da0686796..2090c7bc926 100644 --- a/chain/actors/builtin/evm/actor.go.template +++ b/chain/actors/builtin/evm/actor.go.template @@ -10,6 +10,8 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" + + "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/manifest" builtin{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin" @@ -17,6 +19,17 @@ import ( var Methods = builtin{{.latestVersion}}.MethodsEVM +const ( + ErrReverted exitcode.ExitCode = iota + 33 + ErrInvalidInstruction + ErrUndefinedInstruction + ErrStackUnderflow + ErrStackOverflow + ErrIllegalMemoryAccess + ErrBadJumpdest + ErrSelfdestructFailed +) + func Load(store adt.Store, act *types.Actor) (State, error) { if name, av, ok := actors.GetActorMetaByCode(act.Code); ok { if name != manifest.EvmKey { diff --git a/chain/actors/builtin/evm/evm.go b/chain/actors/builtin/evm/evm.go index 98f860cac4a..e81e7cb4c9e 100644 --- a/chain/actors/builtin/evm/evm.go +++ b/chain/actors/builtin/evm/evm.go @@ -7,6 +7,7 @@ import ( actorstypes "github.com/filecoin-project/go-state-types/actors" builtin12 "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/cbor" + "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/manifest" "github.com/filecoin-project/lotus/chain/actors" @@ -16,6 +17,17 @@ import ( var Methods = builtin12.MethodsEVM +const ( + ErrReverted exitcode.ExitCode = iota + 33 + ErrInvalidInstruction + ErrUndefinedInstruction + ErrStackUnderflow + ErrStackOverflow + ErrIllegalMemoryAccess + ErrBadJumpdest + ErrSelfdestructFailed +) + func Load(store adt.Store, act *types.Actor) (State, error) { if name, av, ok := actors.GetActorMetaByCode(act.Code); ok { if name != manifest.EvmKey { diff --git a/chain/types/ethtypes/eth_types.go b/chain/types/ethtypes/eth_types.go index a7341aac40f..acc0d5c9454 100644 --- a/chain/types/ethtypes/eth_types.go +++ b/chain/types/ethtypes/eth_types.go @@ -987,17 +987,12 @@ func (e *EthBlockNumberOrHash) UnmarshalJSON(b []byte) error { } type EthTrace struct { - Action EthTraceAction `json:"action"` - Result EthTraceResult `json:"result"` - Subtraces int `json:"subtraces"` - TraceAddress []int `json:"traceAddress"` - Type string `json:"type"` - Error string `json:"error,omitempty"` -} - -func (t *EthTrace) SetCallType(callType string) { - t.Action.CallType = callType - t.Type = callType + Type string `json:"type"` + Error string `json:"error,omitempty"` + Subtraces int `json:"subtraces"` + TraceAddress []int `json:"traceAddress"` + Action any `json:"action"` + Result any `json:"result"` } type EthTraceBlock struct { @@ -1016,16 +1011,29 @@ type EthTraceReplayBlockTransaction struct { VmTrace *string `json:"vmTrace"` } -type EthTraceAction struct { - CallType string `json:"callType"` - From EthAddress `json:"from"` - To *EthAddress `json:"to"` - Gas EthUint64 `json:"gas"` - Input EthBytes `json:"input"` - Value EthBigInt `json:"value"` +type EthCallTraceAction struct { + CallType string `json:"callType"` + From EthAddress `json:"from"` + To EthAddress `json:"to"` + Gas EthUint64 `json:"gas"` + Value EthBigInt `json:"value"` + Input EthBytes `json:"input"` } -type EthTraceResult struct { +type EthCallTraceResult struct { GasUsed EthUint64 `json:"gasUsed"` Output EthBytes `json:"output"` } + +type EthCreateTraceAction struct { + From EthAddress `json:"from"` + Gas EthUint64 `json:"gas"` + Value EthBigInt `json:"value"` + Init EthBytes `json:"init"` +} + +type EthCreateTraceResult struct { + Address *EthAddress `json:"address,omitempty"` + GasUsed EthUint64 `json:"gasUsed"` + Code EthBytes `json:"code"` +} diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 6c128010c3e..d58a10c8b59 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -3094,24 +3094,14 @@ Response: ```json [ { - "action": { - "callType": "string value", - "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "gas": "0x5", - "input": "0x07", - "value": "0x0" - }, - "result": { - "gasUsed": "0x5", - "output": "0x07" - }, + "type": "string value", + "error": "string value", "subtraces": 123, "traceAddress": [ 123 ], - "type": "string value", - "error": "string value", + "action": {}, + "result": {}, "blockHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", "blockNumber": 9, "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", @@ -3144,24 +3134,14 @@ Response: "stateDiff": "string value", "trace": [ { - "action": { - "callType": "string value", - "from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "to": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031", - "gas": "0x5", - "input": "0x07", - "value": "0x0" - }, - "result": { - "gasUsed": "0x5", - "output": "0x07" - }, + "type": "string value", + "error": "string value", "subtraces": 123, "traceAddress": [ 123 ], - "type": "string value", - "error": "string value" + "action": {}, + "result": {} } ], "transactionHash": "0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e", diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index 92f3fe81336..5c3ab316562 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -948,7 +948,12 @@ func (a *EthModule) EthTraceReplayBlockTransactions(ctx context.Context, blkNum var output []byte if len(env.traces) > 0 { - output = env.traces[0].Result.Output + switch r := env.traces[0].Result.(type) { + case *ethtypes.EthCallTraceResult: + output = r.Output + case *ethtypes.EthCreateTraceResult: + output = r.Code + } } allTraces = append(allTraces, ðtypes.EthTraceReplayBlockTransaction{ diff --git a/node/impl/full/eth_trace.go b/node/impl/full/eth_trace.go index 352d7427866..e4e5d794d0e 100644 --- a/node/impl/full/eth_trace.go +++ b/node/impl/full/eth_trace.go @@ -2,18 +2,22 @@ package full import ( "bytes" + "fmt" "github.com/multiformats/go-multicodec" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/builtin/v12/eam" - "github.com/filecoin-project/go-state-types/builtin/v12/evm" + eam12 "github.com/filecoin-project/go-state-types/builtin/v12/eam" + evm12 "github.com/filecoin-project/go-state-types/builtin/v12/evm" + init12 "github.com/filecoin-project/go-state-types/builtin/v12/init" "github.com/filecoin-project/go-state-types/exitcode" builtinactors "github.com/filecoin-project/lotus/chain/actors/builtin" + "github.com/filecoin-project/lotus/chain/actors/builtin/evm" "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" @@ -55,6 +59,24 @@ func decodeParams[P any, T interface { return params, nil } +func decodeReturn[R any, T interface { + *R + cbg.CBORUnmarshaler +}](ret *types.ReturnTrace) (T, error) { + var retval T = new(R) + switch ret.ReturnCodec { + case uint64(multicodec.DagCbor), uint64(multicodec.Cbor): + default: + return nil, xerrors.Errorf("Method returned an unexpected codec %d", ret.ReturnCodec) + } + + if err := retval.UnmarshalCBOR(bytes.NewReader(ret.Return)); err != nil { + return nil, xerrors.Errorf("failed to decode return value: %w", err) + } + + return retval, nil +} + func find[T any](values []T, cb func(t *T) *T) *T { for i := range values { if o := cb(&values[i]); o != nil { @@ -89,6 +111,57 @@ func traceToAddress(act *types.ActorTrace) ethtypes.EthAddress { return ethtypes.EthAddressFromActorID(act.Id) } +// traceIsEVMOrEAM returns true if the trace is a call to an EVM or EAM actor. +func traceIsEVMOrEAM(et *types.ExecutionTrace) bool { + if et.InvokedActor == nil { + return false + } + return builtinactors.IsEvmActor(et.InvokedActor.State.Code) || + et.InvokedActor.Id != abi.ActorID(builtin.EthereumAddressManagerActorID) +} + +func traceErrMsg(et *types.ExecutionTrace) string { + code := et.MsgRct.ExitCode + + if code.IsSuccess() { + return "" + } + + // EVM tools often expect this literal string. + if code == exitcode.SysErrOutOfGas { + return "out of gas" + } + + // indicate when we have a "system" error. + if code < exitcode.FirstActorErrorCode { + return fmt.Sprintf("vm error: %s", code) + } + + // handle special exit codes from the EVM/EAM. + if traceIsEVMOrEAM(et) { + switch code { + case evm.ErrReverted: + return "Reverted" // capitalized for compatibility + case evm.ErrInvalidInstruction: + return "invalid instruction" + case evm.ErrUndefinedInstruction: + return "undefined instruction" + case evm.ErrStackUnderflow: + return "stack underflow" + case evm.ErrStackOverflow: + return "stack overflow" + case evm.ErrIllegalMemoryAccess: + return "illegal memory access" + case evm.ErrBadJumpdest: + return "invalid jump destination" + case evm.ErrSelfdestructFailed: + return "self destruct failed" + } + } + // everything else... + return fmt.Sprintf("actor error: %s", code.Error()) +} + // buildTraces recursively builds the traces for a given ExecutionTrace by walking the subcalls func buildTraces(env *environment, addr []int, et *types.ExecutionTrace) error { trace, recurseInto, err := buildTrace(env, addr, et) @@ -126,31 +199,6 @@ func buildTraces(env *environment, addr []int, et *types.ExecutionTrace) error { return nil } -func decodeCreate(msg *types.MessageTrace) (callType string, initcode []byte, err error) { - switch msg.Method { - case builtin.MethodsEAM.Create: - params, err := decodeParams[eam.CreateParams](msg) - if err != nil { - return "", nil, err - } - return "create", params.Initcode, nil - case builtin.MethodsEAM.Create2: - params, err := decodeParams[eam.Create2Params](msg) - if err != nil { - return "", nil, err - } - return "create2", params.Initcode, nil - case builtin.MethodsEAM.CreateExternal: - input, err := decodePayload(msg.Params, msg.ParamsCodec) - if err != nil { - return "", nil, err - } - return "create", input, nil - default: - return "", nil, xerrors.Errorf("unexpected CREATE method %d", msg.Method) - } -} - // buildTrace processes the passed execution trace and updates the environment, if necessary. // // On success, it returns a trace to add (or nil to skip) and the trace recurse into (or nil to skip). @@ -187,43 +235,13 @@ func buildTrace(env *environment, addr []int, et *types.ExecutionTrace) (*ethtyp return nil, nil, nil } - // Step 1: Decode as a native call - to := traceToAddress(et.InvokedActor) - var errMsg string - if et.MsgRct.ExitCode.IsError() { - errMsg = et.MsgRct.ExitCode.Error() - } - trace := ðtypes.EthTrace{ - Action: ethtypes.EthTraceAction{ - From: env.caller, - To: &to, - Gas: ethtypes.EthUint64(et.Msg.GasLimit), - Value: ethtypes.EthBigInt(et.Msg.Value), - Input: encodeFilecoinParamsAsABI(et.Msg.Method, et.Msg.ParamsCodec, et.Msg.Params), - }, - Result: ethtypes.EthTraceResult{ - GasUsed: ethtypes.EthUint64(et.SumGas().TotalGas), - Output: encodeFilecoinReturnAsABI(et.MsgRct.ExitCode, et.MsgRct.ReturnCodec, et.MsgRct.Return), - }, - TraceAddress: addr, - Error: errMsg, - } - - // Set the assumed call mode. We'll override this if the call ends up looking like a create, - // delegatecall, etc. - if et.Msg.ReadOnly { - trace.SetCallType("staticcall") - } else { - trace.SetCallType("call") - } - // Step 2: Decode as a contract invocation // // Normal EVM calls. We don't care if the caller/receiver are actually EVM actors, we only // care if the call _looks_ like an EVM call. If we fail to decode it as an EVM call, we // fallback on interpreting it as a native call. if et.Msg.Method == builtin.MethodsEVM.InvokeContract { - return traceInvokeEVM(env, et, trace) + return traceEVMCall(env, addr, et) } // Step 3: Decode as a contract deployment @@ -233,12 +251,12 @@ func buildTrace(env *environment, addr []int, et *types.ExecutionTrace) (*ethtyp case builtin.InitActorAddr: switch et.Msg.Method { case builtin.MethodsInit.Exec, builtin.MethodsInit.Exec4: - return traceNativeCreate(env, et, trace) + return traceNativeCreate(env, addr, et) } case builtin.EthereumAddressManagerActorAddr: switch et.Msg.Method { case builtin.MethodsEAM.Create, builtin.MethodsEAM.Create2, builtin.MethodsEAM.CreateExternal: - return traceEthCreate(env, et, trace) + return traceEthCreate(env, addr, et) } } @@ -252,29 +270,65 @@ func buildTrace(env *environment, addr []int, et *types.ExecutionTrace) (*ethtyp // respect to the EAM), we only care about the ones relevant DELEGATECALL and can _ignore_ // all the others. if env.isEVM && et.Msg.Method > 0 && et.Msg.Method < 1024 { - return traceEVMPrivate(env, et, trace, to) + return traceEVMPrivate(env, addr, et) } - return trace, et, nil + return traceNativeCall(env, addr, et), et, nil } -func traceInvokeEVM(env *environment, et *types.ExecutionTrace, trace *ethtypes.EthTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { +// Build an EthTrace for a "call" with the given input & output. +func traceCall(env *environment, addr []int, et *types.ExecutionTrace, input, output ethtypes.EthBytes) *ethtypes.EthTrace { + to := traceToAddress(et.InvokedActor) + callType := "call" + if et.Msg.ReadOnly { + callType = "staticcall" + } + return ðtypes.EthTrace{ + Type: "call", + Action: ðtypes.EthCallTraceAction{ + CallType: callType, + From: env.caller, + To: to, + Gas: ethtypes.EthUint64(et.Msg.GasLimit), + Value: ethtypes.EthBigInt(et.Msg.Value), + Input: input, + }, + Result: ðtypes.EthCallTraceResult{ + GasUsed: ethtypes.EthUint64(et.SumGas().TotalGas), + Output: output, + }, + TraceAddress: addr, + Error: traceErrMsg(et), + } +} + +// Build an EthTrace for a "call", parsing the inputs & outputs as a "native" FVM call. +func traceNativeCall(env *environment, addr []int, et *types.ExecutionTrace) *ethtypes.EthTrace { + return traceCall(env, addr, et, + encodeFilecoinParamsAsABI(et.Msg.Method, et.Msg.ParamsCodec, et.Msg.Params), + encodeFilecoinReturnAsABI(et.MsgRct.ExitCode, et.MsgRct.ReturnCodec, et.MsgRct.Return), + ) +} + +// Build an EthTrace for a "call", parsing the inputs & outputs as an EVM call (falling back on +// treating it as a native call). +func traceEVMCall(env *environment, addr []int, et *types.ExecutionTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { input, err := decodePayload(et.Msg.Params, et.Msg.ParamsCodec) if err != nil { log.Debugf("failed to decode contract invocation payload: %w", err) - return trace, et, nil + return traceNativeCall(env, addr, et), et, nil } output, err := decodePayload(et.MsgRct.Return, et.MsgRct.ReturnCodec) if err != nil { log.Debugf("failed to decode contract invocation return: %w", err) - return trace, et, nil + return traceNativeCall(env, addr, et), et, nil } - trace.Action.Input = input - trace.Result.Output = output - return trace, et, nil + return traceCall(env, addr, et, input, output), et, nil } -func traceNativeCreate(env *environment, et *types.ExecutionTrace, trace *ethtypes.EthTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { +// Build an EthTrace for a native "create" operation. This should only be called with an +// ExecutionTrace is an Exec or Exec4 method invocation on the Init actor. +func traceNativeCreate(env *environment, addr []int, et *types.ExecutionTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { if et.Msg.ReadOnly { // "create" isn't valid in a staticcall, so we just skip this trace // (couldn't have created an actor anyways). @@ -316,39 +370,90 @@ func traceNativeCreate(env *environment, et *types.ExecutionTrace, trace *ethtyp return nil, nil, xerrors.Errorf("direct call to Exec4 successfully called a constructor!") } - // Contract creation has no "to". - trace.Action.To = nil - // If we get here, this isn't a native EVM create. Those always go through - // the EAM. So we have no "real" initcode and must use the sentinel value - // for "invalid" initcode. - trace.Action.Input = []byte{0xFE} - trace.SetCallType("create") - // Handle the output. - if et.MsgRct.ExitCode.IsError() { - // If the sub-call fails, record the reason. It's possible for the - // call to the init actor to fail, but for the construction to - // succeed, so we need to check the exit code here. - if subTrace.MsgRct.ExitCode.IsError() { - trace.Result.Output = encodeFilecoinReturnAsABI( - subTrace.MsgRct.ExitCode, - subTrace.MsgRct.ReturnCodec, - subTrace.MsgRct.Return, - ) - } else { - // Otherwise, output nothing. - trace.Result.Output = nil - } - } else { + var output ethtypes.EthBytes + var createdAddr *ethtypes.EthAddress + if et.MsgRct.ExitCode.IsSuccess() { // We're supposed to put the "installed bytecode" here. But this // isn't an EVM actor, so we just put some invalid bytecode (this is // the answer you'd get if you called EXTCODECOPY on a native // non-account actor, anyways). - trace.Result.Output = []byte{0xFE} + output = []byte{0xFE} + + // Extract the address of the created actor from the return value. + initReturn, err := decodeReturn[init12.ExecReturn](&et.MsgRct) + if err != nil { + return nil, nil, xerrors.Errorf("failed to decode init params after a successful Init.Exec call: %w", err) + } + actorId, err := address.IDFromAddress(initReturn.IDAddress) + if err != nil { + return nil, nil, xerrors.Errorf("failed to extract created actor ID from address: %w", err) + } + ethAddr := ethtypes.EthAddressFromActorID(abi.ActorID(actorId)) + createdAddr = ðAddr + } + + return ðtypes.EthTrace{ + Type: "create", + Action: ðtypes.EthCreateTraceAction{ + From: env.caller, + Gas: ethtypes.EthUint64(et.Msg.GasLimit), + Value: ethtypes.EthBigInt(et.Msg.Value), + // If we get here, this isn't a native EVM create. Those always go through + // the EAM. So we have no "real" initcode and must use the sentinel value + // for "invalid" initcode. + Init: []byte{0xFE}, + }, + Result: ðtypes.EthCreateTraceResult{ + GasUsed: ethtypes.EthUint64(et.SumGas().TotalGas), + Address: createdAddr, + Code: output, + }, + TraceAddress: addr, + Error: traceErrMsg(et), + }, subTrace, nil +} + +// Assert that these are all identical so we can simplify the below code and decode once. +var _ *eam12.Return = (*eam12.Return)((*eam12.CreateReturn)(nil)) +var _ *eam12.Return = (*eam12.Return)((*eam12.Create2Return)(nil)) +var _ *eam12.Return = (*eam12.Return)((*eam12.CreateExternalReturn)(nil)) + +// Decode the parameters and return value of an EVM smart contract creation through the EAM. This +// should only be called with an ExecutionTrace for a Create, Create2, or CreateExternal method +// invocation on the EAM. +func decodeCreateViaEAM(et *types.ExecutionTrace) (initcode []byte, addr *ethtypes.EthAddress, err error) { + switch et.Msg.Method { + case builtin.MethodsEAM.Create: + params, err := decodeParams[eam12.CreateParams](&et.Msg) + if err != nil { + return nil, nil, err + } + initcode = params.Initcode + case builtin.MethodsEAM.Create2: + params, err := decodeParams[eam12.Create2Params](&et.Msg) + if err != nil { + return nil, nil, err + } + initcode = params.Initcode + case builtin.MethodsEAM.CreateExternal: + input, err := decodePayload(et.Msg.Params, et.Msg.ParamsCodec) + if err != nil { + return nil, nil, err + } + initcode = input + default: + return nil, nil, xerrors.Errorf("unexpected CREATE method %d", et.Msg.Method) + } + ret, err := decodeReturn[eam12.CreateReturn](&et.MsgRct) + if err != nil { + return nil, (*ethtypes.EthAddress)(&ret.EthAddress), err } - return trace, subTrace, nil + return initcode, (*ethtypes.EthAddress)(&ret.EthAddress), nil } -func traceEthCreate(env *environment, et *types.ExecutionTrace, trace *ethtypes.EthTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { +// Build an EthTrace for an EVM "create" operation. This should only be called with an +// ExecutionTrace for a Create, Create2, or CreateExternal method invocation on the EAM. +func traceEthCreate(env *environment, addr []int, et *types.ExecutionTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { // Same as the Init actor case above, see the comment there. if et.Msg.ReadOnly { return nil, nil, nil @@ -378,48 +483,48 @@ func traceEthCreate(env *environment, et *types.ExecutionTrace, trace *ethtypes. return nil, nil, nil } - // Contract creation has no "to". - trace.Action.To = nil - // Decode inputs & determine create type. - method, initcode, err := decodeCreate(&et.Msg) + initcode, createdAddr, err := decodeCreateViaEAM(et) if err != nil { - return nil, nil, xerrors.Errorf("EAM called with invalid params, but it still tried to construct the contract: %w", err) + return nil, nil, xerrors.Errorf("EAM called with invalid params or returned an invalid result, but it still tried to construct the contract: %w", err) } - trace.Action.Input = initcode - trace.SetCallType(method) + var output ethtypes.EthBytes // Handle the output. - if et.MsgRct.ExitCode.IsError() { - if subTrace.MsgRct.ExitCode.IsError() { - // If we managed to call the constructor, parse/return its - // revert message. - output, err := decodePayload(subTrace.MsgRct.Return, subTrace.MsgRct.ReturnCodec) - if err != nil { - log.Debugf("EVM actor returned indecipherable create error: %w", err) - output = encodeFilecoinReturnAsABI( - subTrace.MsgRct.ExitCode, - subTrace.MsgRct.ReturnCodec, - subTrace.MsgRct.Return, - ) - } - trace.Result.Output = output - } else { - // Otherwise, if we failed before that, we have no revert - // message. - trace.Result.Output = nil - } - } else { + switch et.MsgRct.ExitCode { + case 0: // success // We're _supposed_ to include the contracts bytecode here, but we // can't do that reliably (e.g., if some part of the trace reverts). // So we don't try and include a sentinel "impossible bytecode" // value (the value specified by EIP-3541). - trace.Result.Output = []byte{0xFE} + output = []byte{0xFE} + case 33: // Reverted, parse the revert message. + // If we managed to call the constructor, parse/return its revert message. If we + // fail, we just return no output. + output, _ = decodePayload(subTrace.MsgRct.Return, subTrace.MsgRct.ReturnCodec) } - return trace, subTrace, nil + + return ðtypes.EthTrace{ + Type: "create", + Action: ðtypes.EthCreateTraceAction{ + From: env.caller, + Gas: ethtypes.EthUint64(et.Msg.GasLimit), + Value: ethtypes.EthBigInt(et.Msg.Value), + Init: initcode, + }, + Result: ðtypes.EthCreateTraceResult{ + GasUsed: ethtypes.EthUint64(et.SumGas().TotalGas), + Address: createdAddr, + Code: output, + }, + TraceAddress: addr, + Error: traceErrMsg(et), + }, subTrace, nil } -func traceEVMPrivate(env *environment, et *types.ExecutionTrace, trace *ethtypes.EthTrace, to ethtypes.EthAddress) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { +// Build an EthTrace for a "private" method invocation from the EVM. This should only be called with +// an ExecutionTrace from an EVM instance and on a method between 1 and 1023 inclusive. +func traceEVMPrivate(env *environment, addr []int, et *types.ExecutionTrace) (*ethtypes.EthTrace, *types.ExecutionTrace, error) { // The EVM actor implements DELEGATECALL by: // // 1. Asking the callee for its bytecode by calling it on the GetBytecode method. @@ -440,6 +545,7 @@ func traceEVMPrivate(env *environment, et *types.ExecutionTrace, trace *ethtypes // DELEGATECALL any non-EVM actor, but there's no need to encode that fact // here in case we decide to loosen this up in the future. if et.MsgRct.ExitCode.IsSuccess() { + to := traceToAddress(et.InvokedActor) env.lastByteCode = &to } else { env.lastByteCode = nil @@ -460,25 +566,38 @@ func traceEVMPrivate(env *environment, et *types.ExecutionTrace, trace *ethtypes if env.lastByteCode == nil { return nil, nil, xerrors.Errorf("unknown bytecode for delegate call") } - if env.caller != to { + + if to := traceToAddress(et.InvokedActor); env.caller != to { return nil, nil, xerrors.Errorf("delegate-call not from & to self: %s != %s", env.caller, to) } - trace.SetCallType("delegatecall") - trace.Action.To = env.lastByteCode - - dp, err := decodeParams[evm.DelegateCallParams](&et.Msg) + dp, err := decodeParams[evm12.DelegateCallParams](&et.Msg) if err != nil { return nil, nil, xerrors.Errorf("failed to decode delegate-call params: %w", err) } - trace.Action.Input = dp.Input - trace.Result.Output, err = decodePayload(et.MsgRct.Return, et.MsgRct.ReturnCodec) + output, err := decodePayload(et.MsgRct.Return, et.MsgRct.ReturnCodec) if err != nil { return nil, nil, xerrors.Errorf("failed to decode delegate-call return: %w", err) } - return trace, et, nil + return ðtypes.EthTrace{ + Type: "call", + Action: ðtypes.EthCallTraceAction{ + CallType: "delegatecall", + From: env.caller, + To: *env.lastByteCode, + Gas: ethtypes.EthUint64(et.Msg.GasLimit), + Value: ethtypes.EthBigInt(et.Msg.Value), + Input: dp.Input, + }, + Result: ðtypes.EthCallTraceResult{ + GasUsed: ethtypes.EthUint64(et.SumGas().TotalGas), + Output: output, + }, + TraceAddress: addr, + Error: traceErrMsg(et), + }, et, nil } // We drop all other "private" calls from FEVM. We _forbid_ explicit calls between 0 and // 1024 (exclusive), so any calls in this range must be implementation details.