Skip to content

Commit

Permalink
Merge pull request #270 from filecoin-project/steb/log-backtrace
Browse files Browse the repository at this point in the history
feat: propagate backtraces as errors
  • Loading branch information
Stebalien authored Apr 22, 2022
2 parents 32cde27 + 1aaf422 commit 791b682
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 213 deletions.
3 changes: 3 additions & 0 deletions fvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func (f *FVM) ApplyMessage(msgBytes []byte, chainLen uint) (*ApplyRet, error) {
MinerPenalty: reformBigInt(resp.PenaltyHi, resp.PenaltyLo),
MinerTip: reformBigInt(resp.MinerTipHi, resp.MinerTipLo),
ExecTraceBytes: copyBytes(resp.ExecTracePtr, resp.ExecTraceLen),
FailureInfo: string(copyBytes(resp.FailureInfoPtr, resp.FailureInfoLen)),
}, nil
}

Expand All @@ -150,6 +151,7 @@ func (f *FVM) ApplyImplicitMessage(msgBytes []byte) (*ApplyRet, error) {
GasUsed: int64(resp.GasUsed),
MinerPenalty: reformBigInt(resp.PenaltyHi, resp.PenaltyLo),
MinerTip: reformBigInt(resp.MinerTipHi, resp.MinerTipLo),
FailureInfo: string(copyBytes(resp.FailureInfoPtr, resp.FailureInfoLen)),
}, nil
}

Expand All @@ -175,6 +177,7 @@ type ApplyRet struct {
MinerPenalty abi.TokenAmount
MinerTip abi.TokenAmount
ExecTraceBytes []byte
FailureInfo string
}

// NOTE: We only support 64bit platforms
Expand Down
134 changes: 74 additions & 60 deletions generated/cgo_helpers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 791b682

Please sign in to comment.