Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2.1: Update FVM for Selenium (r02) #9260

Merged
merged 6 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified build/actors/v8.tar.zst
Binary file not shown.
234 changes: 117 additions & 117 deletions build/builtin_actors_gen.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/openrpc_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//stm: #unit
// stm: #unit
package build

import (
Expand Down
1 change: 1 addition & 0 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const GenesisFile = ""
// VERY experimental! Should not be merged into master / any release branch yet!
var NetworkBundle = "devnet-wasm"
var BundleOverrides map[actors.Version]string
var ActorDebugging = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably want this to be true so that peoplr can get logs and backtraces.


const GenesisNetworkVersion = network.Version16

Expand Down
1 change: 1 addition & 0 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const GenesisNetworkVersion = network.Version15

var NetworkBundle = "butterflynet"
var BundleOverrides map[actors.Version]string
var ActorDebugging = false

const BootstrappersFile = "butterflynet.pi"
const GenesisFile = "butterflynet.car"
Expand Down
1 change: 1 addition & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const GenesisNetworkVersion = network.Version0

var NetworkBundle = "calibrationnet"
var BundleOverrides map[actors.Version]string
var ActorDebugging = false

const BootstrappersFile = "calibnet.pi"
const GenesisFile = "calibnet.car"
Expand Down
1 change: 1 addition & 0 deletions build/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

var NetworkBundle = "caterpillarnet"
var BundleOverrides map[actors.Version]string
var ActorDebugging = false

const BootstrappersFile = "interopnet.pi"
const GenesisFile = "interopnet.car"
Expand Down
3 changes: 3 additions & 0 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var NetworkBundle = "mainnet"
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical.
var BundleOverrides map[actors.Version]string

// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical.
const ActorDebugging = false

const GenesisNetworkVersion = network.Version0

const BootstrappersFile = "mainnet.pi"
Expand Down
2 changes: 1 addition & 1 deletion build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//
// Its purpose is to unlock various degrees of flexibility and parametrization
// when writing Testground plans for Lotus.
//
package build

import (
Expand Down Expand Up @@ -116,6 +115,7 @@ var (
GenesisNetworkVersion = network.Version0
NetworkBundle = "devnet"
BundleOverrides map[actors.Version]string
ActorDebugging = true

NewestNetworkVersion = network.Version15
ActorUpgradeNetworkVersion = network.Version15
Expand Down
1 change: 1 addition & 0 deletions build/params_wallaby.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

var NetworkBundle = "wallaby"
var BundleOverrides map[actors.Version]string
var ActorDebugging = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably call out that this is changing from true to false.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth indicating in the handoff to Wallaby that we're enabling this feature now so that node operators expect the extra output in logs?


const BootstrappersFile = "wallabynet.pi"
const GenesisFile = "wallabynet.car"
Expand Down
223 changes: 219 additions & 4 deletions chain/vm/cbor_gen.go

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

29 changes: 25 additions & 4 deletions chain/vm/fvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,21 @@ type FvmExtern struct {
base cid.Cid
}

type FvmGasCharge struct {
Name string
TotalGas int64
ComputeGas int64
StorageGas int64
}

// This may eventually become identical to ExecutionTrace, but we can make incremental progress towards that
type FvmExecutionTrace struct {
Msg *types.Message
MsgRct *types.MessageReceipt
Error string
Msg *types.Message
MsgRct *types.MessageReceipt
Error string
GasCharges []FvmGasCharge `cborgen:"maxlen=1000000000"`

Subcalls []FvmExecutionTrace
Subcalls []FvmExecutionTrace `cborgen:"maxlen=1000000000"`
}

func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace {
Expand All @@ -69,6 +77,18 @@ func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace {
Subcalls: nil, // Should be nil when there are no subcalls for backwards compatibility
}

if len(t.GasCharges) > 0 {
ret.GasCharges = make([]*types.GasTrace, len(t.GasCharges))
for i, v := range t.GasCharges {
ret.GasCharges[i] = &types.GasTrace{
Name: v.Name,
TotalGas: v.TotalGas,
ComputeGas: v.ComputeGas,
StorageGas: v.StorageGas,
}
}
}

if len(t.Subcalls) > 0 {
ret.Subcalls = make([]types.ExecutionTrace, len(t.Subcalls))

Expand Down Expand Up @@ -284,6 +304,7 @@ func defaultFVMOpts(ctx context.Context, opts *VMOpts) (*ffi.FVMOpts, error) {
NetworkVersion: opts.NetworkVersion,
StateBase: opts.StateBase,
Tracing: opts.Tracing || EnableDetailedTracing,
Debug: build.ActorDebugging,
}, nil

}
Expand Down
2 changes: 1 addition & 1 deletion extern/filecoin-ffi
1 change: 1 addition & 0 deletions gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func main() {

err = gen.WriteTupleEncodersToFile("./chain/vm/cbor_gen.go", "vm",
vm.FvmExecutionTrace{},
vm.FvmGasCharge{},
)
if err != nil {
fmt.Println(err)
Expand Down
Loading