Merge pull request #2484 from filecoin-project/feat/gas-estim
Add gas estimation
This commit is contained in:
commit
66c44d24ff
@ -156,6 +156,7 @@ jobs:
|
|||||||
- download-params
|
- download-params
|
||||||
- go/install-gotestsum:
|
- go/install-gotestsum:
|
||||||
gobin: $HOME/.local/bin
|
gobin: $HOME/.local/bin
|
||||||
|
version: 0.5.2
|
||||||
- run:
|
- run:
|
||||||
name: go test
|
name: go test
|
||||||
environment:
|
environment:
|
||||||
|
@ -101,6 +101,16 @@ type FullNode interface {
|
|||||||
// ChainExport returns a stream of bytes with CAR dump of chain data.
|
// ChainExport returns a stream of bytes with CAR dump of chain data.
|
||||||
ChainExport(context.Context, types.TipSetKey) (<-chan []byte, error)
|
ChainExport(context.Context, types.TipSetKey) (<-chan []byte, error)
|
||||||
|
|
||||||
|
// GasEstimateGasLimit estimates gas used by the message and returns it.
|
||||||
|
// It fails if message fails to execute.
|
||||||
|
GasEstimateGasLimit(context.Context, *types.Message, types.TipSetKey) (int64, error)
|
||||||
|
|
||||||
|
// GasEstimateGasPrice estimates what gas price should be used for a
|
||||||
|
// message to have high likelihood of inclusion in `nblocksincl` epochs.
|
||||||
|
|
||||||
|
GasEstimateGasPrice(_ context.Context, nblocksincl uint64,
|
||||||
|
sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error)
|
||||||
|
|
||||||
// MethodGroup: Sync
|
// MethodGroup: Sync
|
||||||
// The Sync method group contains methods for interacting with and
|
// The Sync method group contains methods for interacting with and
|
||||||
// observing the lotus sync service.
|
// observing the lotus sync service.
|
||||||
@ -143,8 +153,8 @@ type FullNode interface {
|
|||||||
MpoolGetNonce(context.Context, address.Address) (uint64, error)
|
MpoolGetNonce(context.Context, address.Address) (uint64, error)
|
||||||
MpoolSub(context.Context) (<-chan MpoolUpdate, error)
|
MpoolSub(context.Context) (<-chan MpoolUpdate, error)
|
||||||
|
|
||||||
// MpoolEstimateGasPrice estimates what gas price should be used for a
|
// MpoolEstimateGasPrice is depracated
|
||||||
// message to have high likelihood of inclusion in `nblocksincl` epochs.
|
// Deprecated: use GasEstimateGasPrice instead
|
||||||
MpoolEstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error)
|
MpoolEstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error)
|
||||||
|
|
||||||
// MethodGroup: Miner
|
// MethodGroup: Miner
|
||||||
|
@ -82,6 +82,9 @@ type FullNodeStruct struct {
|
|||||||
ChainGetPath func(context.Context, types.TipSetKey, types.TipSetKey) ([]*api.HeadChange, error) `perm:"read"`
|
ChainGetPath func(context.Context, types.TipSetKey, types.TipSetKey) ([]*api.HeadChange, error) `perm:"read"`
|
||||||
ChainExport func(context.Context, types.TipSetKey) (<-chan []byte, error) `perm:"read"`
|
ChainExport func(context.Context, types.TipSetKey) (<-chan []byte, error) `perm:"read"`
|
||||||
|
|
||||||
|
GasEstimateGasPrice func(context.Context, uint64, address.Address, int64, types.TipSetKey) (types.BigInt, error) `perm:"read"`
|
||||||
|
GasEstimateGasLimit func(context.Context, *types.Message, types.TipSetKey) (int64, error) `perm:"read"`
|
||||||
|
|
||||||
SyncState func(context.Context) (*api.SyncState, error) `perm:"read"`
|
SyncState func(context.Context) (*api.SyncState, error) `perm:"read"`
|
||||||
SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"`
|
SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"`
|
||||||
SyncIncomingBlocks func(ctx context.Context) (<-chan *types.BlockHeader, error) `perm:"read"`
|
SyncIncomingBlocks func(ctx context.Context) (<-chan *types.BlockHeader, error) `perm:"read"`
|
||||||
@ -93,7 +96,6 @@ type FullNodeStruct struct {
|
|||||||
MpoolPushMessage func(context.Context, *types.Message) (*types.SignedMessage, error) `perm:"sign"`
|
MpoolPushMessage func(context.Context, *types.Message) (*types.SignedMessage, error) `perm:"sign"`
|
||||||
MpoolGetNonce func(context.Context, address.Address) (uint64, error) `perm:"read"`
|
MpoolGetNonce func(context.Context, address.Address) (uint64, error) `perm:"read"`
|
||||||
MpoolSub func(context.Context) (<-chan api.MpoolUpdate, error) `perm:"read"`
|
MpoolSub func(context.Context) (<-chan api.MpoolUpdate, error) `perm:"read"`
|
||||||
MpoolEstimateGasPrice func(context.Context, uint64, address.Address, int64, types.TipSetKey) (types.BigInt, error) `perm:"read"`
|
|
||||||
|
|
||||||
MinerGetBaseInfo func(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error) `perm:"read"`
|
MinerGetBaseInfo func(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error) `perm:"read"`
|
||||||
MinerCreateBlock func(context.Context, *api.BlockTemplate) (*types.BlockMsg, error) `perm:"write"`
|
MinerCreateBlock func(context.Context, *api.BlockTemplate) (*types.BlockMsg, error) `perm:"write"`
|
||||||
@ -400,6 +402,16 @@ func (c *FullNodeStruct) ClientGenCar(ctx context.Context, ref api.FileRef, outp
|
|||||||
return c.Internal.ClientGenCar(ctx, ref, outpath)
|
return c.Internal.ClientGenCar(ctx, ref, outpath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *FullNodeStruct) GasEstimateGasPrice(ctx context.Context, nblocksincl uint64,
|
||||||
|
sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
||||||
|
return c.Internal.GasEstimateGasPrice(ctx, nblocksincl, sender, gaslimit, tsk)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FullNodeStruct) GasEstimateGasLimit(ctx context.Context, msg *types.Message,
|
||||||
|
tsk types.TipSetKey) (int64, error) {
|
||||||
|
return c.Internal.GasEstimateGasLimit(ctx, msg, tsk)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *FullNodeStruct) MpoolPending(ctx context.Context, tsk types.TipSetKey) ([]*types.SignedMessage, error) {
|
func (c *FullNodeStruct) MpoolPending(ctx context.Context, tsk types.TipSetKey) ([]*types.SignedMessage, error) {
|
||||||
return c.Internal.MpoolPending(ctx, tsk)
|
return c.Internal.MpoolPending(ctx, tsk)
|
||||||
}
|
}
|
||||||
@ -417,7 +429,7 @@ func (c *FullNodeStruct) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *FullNodeStruct) MpoolEstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, limit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
func (c *FullNodeStruct) MpoolEstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, limit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
||||||
return c.Internal.MpoolEstimateGasPrice(ctx, nblocksincl, sender, limit, tsk)
|
return c.Internal.GasEstimateGasPrice(ctx, nblocksincl, sender, limit, tsk)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FullNodeStruct) MinerGetBaseInfo(ctx context.Context, maddr address.Address, epoch abi.ChainEpoch, tsk types.TipSetKey) (*api.MiningBaseInfo, error) {
|
func (c *FullNodeStruct) MinerGetBaseInfo(ctx context.Context, maddr address.Address, epoch abi.ChainEpoch, tsk types.TipSetKey) (*api.MiningBaseInfo, error) {
|
||||||
|
@ -54,7 +54,7 @@ func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration) {
|
|||||||
CC := abi.SectorNumber(GenesisPreseals + 1)
|
CC := abi.SectorNumber(GenesisPreseals + 1)
|
||||||
Upgraded := CC + 1
|
Upgraded := CC + 1
|
||||||
|
|
||||||
pledgeSectors(t, ctx, miner, 1)
|
pledgeSectors(t, ctx, miner, 1, nil)
|
||||||
|
|
||||||
sl, err := miner.SectorsList(ctx)
|
sl, err := miner.SectorsList(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -3,6 +3,7 @@ package test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
|
|
||||||
@ -41,26 +42,36 @@ func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSect
|
|||||||
|
|
||||||
mine := true
|
mine := true
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
|
blockNotif := make(chan struct{}, 1)
|
||||||
go func() {
|
go func() {
|
||||||
defer close(done)
|
defer close(done)
|
||||||
for mine {
|
for mine {
|
||||||
build.Clock.Sleep(blocktime)
|
build.Clock.Sleep(blocktime)
|
||||||
if err := sn[0].MineOne(ctx, func(bool, error) {}); err != nil {
|
if err := sn[0].MineOne(ctx, func(bool, error) {
|
||||||
|
select {
|
||||||
|
case blockNotif <- struct{}{}:
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
|
}); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
pledgeSectors(t, ctx, miner, nSectors)
|
pledgeSectors(t, ctx, miner, nSectors, blockNotif)
|
||||||
|
|
||||||
mine = false
|
mine = false
|
||||||
<-done
|
<-done
|
||||||
}
|
}
|
||||||
|
|
||||||
func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n int) {
|
func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n int, blockNotif <-chan struct{}) {
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
err := miner.PledgeSector(ctx)
|
err := miner.PledgeSector(ctx)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
if i%3 == 0 && blockNotif != nil {
|
||||||
|
<-blockNotif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
@ -131,7 +142,7 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
pledgeSectors(t, ctx, miner, nSectors)
|
pledgeSectors(t, ctx, miner, nSectors, nil)
|
||||||
|
|
||||||
maddr, err := miner.ActorAddress(ctx)
|
maddr, err := miner.ActorAddress(ctx)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
@ -53,7 +53,7 @@ func (ve Version) EqMajorMinor(v2 Version) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// APIVersion is a semver version of the rpc api exposed
|
// APIVersion is a semver version of the rpc api exposed
|
||||||
var APIVersion Version = newVer(0, 8, 0)
|
var APIVersion Version = newVer(0, 8, 1)
|
||||||
|
|
||||||
//nolint:varcheck,deadcode
|
//nolint:varcheck,deadcode
|
||||||
const (
|
const (
|
||||||
|
@ -69,8 +69,6 @@ func (fm *FundMgr) EnsureAvailable(ctx context.Context, addr, wallet address.Add
|
|||||||
To: builtin.StorageMarketActorAddr,
|
To: builtin.StorageMarketActorAddr,
|
||||||
From: wallet,
|
From: wallet,
|
||||||
Value: toAdd,
|
Value: toAdd,
|
||||||
GasPrice: types.NewInt(0),
|
|
||||||
GasLimit: 100_000_000,
|
|
||||||
Method: builtin.MethodsMarket.AddBalance,
|
Method: builtin.MethodsMarket.AddBalance,
|
||||||
Params: params,
|
Params: params,
|
||||||
})
|
})
|
||||||
|
@ -872,17 +872,3 @@ func (mp *MessagePool) loadLocal() error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
const MinGasPrice = 0
|
|
||||||
|
|
||||||
func (mp *MessagePool) EstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
|
||||||
// TODO: something smarter obviously
|
|
||||||
switch nblocksincl {
|
|
||||||
case 0:
|
|
||||||
return types.NewInt(MinGasPrice + 2), nil
|
|
||||||
case 1:
|
|
||||||
return types.NewInt(MinGasPrice + 1), nil
|
|
||||||
default:
|
|
||||||
return types.NewInt(MinGasPrice), nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -4,7 +4,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/specs-actors/actors/abi"
|
"github.com/filecoin-project/specs-actors/actors/abi"
|
||||||
|
"github.com/filecoin-project/specs-actors/actors/crypto"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@ -84,6 +86,78 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
|
|||||||
return sm.CallRaw(ctx, msg, state, r, ts.Height())
|
return sm.CallRaw(ctx, msg, state, r, ts.Height())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, ts *types.TipSet) (*api.InvocResult, error) {
|
||||||
|
ctx, span := trace.StartSpan(ctx, "statemanager.CallWithGas")
|
||||||
|
defer span.End()
|
||||||
|
|
||||||
|
if ts == nil {
|
||||||
|
ts = sm.cs.GetHeaviestTipSet()
|
||||||
|
}
|
||||||
|
|
||||||
|
state := ts.ParentState()
|
||||||
|
|
||||||
|
r := store.NewChainRand(sm.cs, ts.Cids(), ts.Height())
|
||||||
|
|
||||||
|
if span.IsRecordingEvents() {
|
||||||
|
span.AddAttributes(
|
||||||
|
trace.Int64Attribute("gas_limit", msg.GasLimit),
|
||||||
|
trace.Int64Attribute("gas_price", int64(msg.GasPrice.Uint64())),
|
||||||
|
trace.StringAttribute("value", msg.Value.String()),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fromKey, err := sm.ResolveToKeyAddress(ctx, msg.From, ts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("could not resolve key: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var msgApply types.ChainMsg
|
||||||
|
|
||||||
|
switch fromKey.Protocol() {
|
||||||
|
case address.BLS:
|
||||||
|
msgApply = msg
|
||||||
|
case address.SECP256K1:
|
||||||
|
msgApply = &types.SignedMessage{
|
||||||
|
Message: *msg,
|
||||||
|
Signature: crypto.Signature{
|
||||||
|
Type: crypto.SigTypeSecp256k1,
|
||||||
|
Data: make([]byte, 65),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
vmi, err := vm.NewVM(state, ts.Height(), r, sm.cs.Blockstore(), sm.cs.VMSys())
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("failed to set up vm: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fromActor, err := vmi.StateTree().GetActor(msg.From)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("call raw get actor: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.Nonce = fromActor.Nonce
|
||||||
|
|
||||||
|
ret, err := vmi.ApplyMessage(ctx, msgApply)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("apply message failed: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var errs string
|
||||||
|
if ret.ActorErr != nil {
|
||||||
|
errs = ret.ActorErr.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
return &api.InvocResult{
|
||||||
|
Msg: msg,
|
||||||
|
MsgRct: &ret.MessageReceipt,
|
||||||
|
ExecutionTrace: ret.ExecutionTrace,
|
||||||
|
Error: errs,
|
||||||
|
Duration: ret.Duration,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
var errHaltExecution = fmt.Errorf("halt")
|
var errHaltExecution = fmt.Errorf("halt")
|
||||||
|
|
||||||
func (sm *StateManager) Replay(ctx context.Context, ts *types.TipSet, mcid cid.Cid) (*types.Message, *vm.ApplyRet, error) {
|
func (sm *StateManager) Replay(ctx context.Context, ts *types.TipSet, mcid cid.Cid) (*types.Message, *vm.ApplyRet, error) {
|
||||||
|
@ -179,7 +179,7 @@ func TestForkHeightTriggers(t *testing.T) {
|
|||||||
To: builtin.InitActorAddr,
|
To: builtin.InitActorAddr,
|
||||||
Method: builtin.MethodsInit.Exec,
|
Method: builtin.MethodsInit.Exec,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: types.TestGasLimit,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
sig, err := cg.Wallet().Sign(ctx, cg.Banker(), m.Cid().Bytes())
|
sig, err := cg.Wallet().Sign(ctx, cg.Banker(), m.Cid().Bytes())
|
||||||
@ -206,7 +206,7 @@ func TestForkHeightTriggers(t *testing.T) {
|
|||||||
Method: 2,
|
Method: 2,
|
||||||
Params: nil,
|
Params: nil,
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: types.TestGasLimit,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
nonce++
|
nonce++
|
||||||
|
@ -586,7 +586,7 @@ func (sm *StateManager) CirculatingSupply(ctx context.Context, ts *types.TipSet)
|
|||||||
|
|
||||||
unsafeVM := &vm.UnsafeVM{VM: vmi}
|
unsafeVM := &vm.UnsafeVM{VM: vmi}
|
||||||
rt := unsafeVM.MakeRuntime(ctx, &types.Message{
|
rt := unsafeVM.MakeRuntime(ctx, &types.Message{
|
||||||
GasLimit: 1_000_000_000,
|
GasLimit: 100e6,
|
||||||
From: builtin.SystemActorAddr,
|
From: builtin.SystemActorAddr,
|
||||||
}, builtin.SystemActorAddr, 0, 0, 0)
|
}, builtin.SystemActorAddr, 0, 0, 0)
|
||||||
|
|
||||||
|
@ -158,3 +158,5 @@ func (m *Message) ValidForBlockInclusion(minGas int64) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TestGasLimit = 100e6
|
||||||
|
@ -935,7 +935,7 @@ var slashConsensusFault = &cli.Command{
|
|||||||
From: def,
|
From: def,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasPrice: types.NewInt(1),
|
GasPrice: types.NewInt(1),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
Method: builtin.MethodsMiner.ReportConsensusFault,
|
Method: builtin.MethodsMiner.ReportConsensusFault,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,6 @@ var sendCmd = &cli.Command{
|
|||||||
From: fromAddr,
|
From: fromAddr,
|
||||||
To: toAddr,
|
To: toAddr,
|
||||||
Value: types.BigInt(val),
|
Value: types.BigInt(val),
|
||||||
GasLimit: 100_000_000,
|
|
||||||
GasPrice: gp,
|
GasPrice: gp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ func sendSmallFundsTxs(ctx context.Context, api api.FullNode, from address.Addre
|
|||||||
From: from,
|
From: from,
|
||||||
To: sendSet[rand.Intn(20)],
|
To: sendSet[rand.Intn(20)],
|
||||||
Value: types.NewInt(1),
|
Value: types.NewInt(1),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ func (h *handler) send(w http.ResponseWriter, r *http.Request) {
|
|||||||
To: to,
|
To: to,
|
||||||
|
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(400)
|
w.WriteHeader(400)
|
||||||
@ -355,7 +355,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) {
|
|||||||
To: owner,
|
To: owner,
|
||||||
|
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(400)
|
w.WriteHeader(400)
|
||||||
@ -391,7 +391,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) {
|
|||||||
Method: builtin.MethodsPower.CreateMiner,
|
Method: builtin.MethodsPower.CreateMiner,
|
||||||
Params: params,
|
Params: params,
|
||||||
|
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ var noncefix = &cli.Command{
|
|||||||
From: addr,
|
From: addr,
|
||||||
To: addr,
|
To: addr,
|
||||||
Value: types.NewInt(1),
|
Value: types.NewInt(1),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(1),
|
GasPrice: types.NewInt(1),
|
||||||
Nonce: i,
|
Nonce: i,
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ var verifRegAddVerifierCmd = &cli.Command{
|
|||||||
From: fromk,
|
From: fromk,
|
||||||
Method: builtin.MethodsVerifiedRegistry.AddVerifier,
|
Method: builtin.MethodsVerifiedRegistry.AddVerifier,
|
||||||
GasPrice: types.NewInt(1),
|
GasPrice: types.NewInt(1),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
Params: params,
|
Params: params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ var verifRegVerifyClientCmd = &cli.Command{
|
|||||||
From: fromk,
|
From: fromk,
|
||||||
Method: builtin.MethodsVerifiedRegistry.AddVerifiedClient,
|
Method: builtin.MethodsVerifiedRegistry.AddVerifiedClient,
|
||||||
GasPrice: types.NewInt(1),
|
GasPrice: types.NewInt(1),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
Params: params,
|
Params: params,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ func configureStorageMiner(ctx context.Context, api lapi.FullNode, addr address.
|
|||||||
Params: enc,
|
Params: enc,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasPrice: gasPrice,
|
GasPrice: gasPrice,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
smsg, err := api.MpoolPushMessage(ctx, msg)
|
smsg, err := api.MpoolPushMessage(ctx, msg)
|
||||||
@ -636,7 +636,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
|
|||||||
Method: builtin.MethodsPower.CreateMiner,
|
Method: builtin.MethodsPower.CreateMiner,
|
||||||
Params: params,
|
Params: params,
|
||||||
|
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: gasPrice,
|
GasPrice: gasPrice,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,13 +22,6 @@ var rewardsCmd = &cli.Command{
|
|||||||
var rewardsRedeemCmd = &cli.Command{
|
var rewardsRedeemCmd = &cli.Command{
|
||||||
Name: "redeem",
|
Name: "redeem",
|
||||||
Usage: "Redeem block rewards",
|
Usage: "Redeem block rewards",
|
||||||
Flags: []cli.Flag{
|
|
||||||
&cli.Int64Flag{
|
|
||||||
Name: "gas-limit",
|
|
||||||
Usage: "set gas limit",
|
|
||||||
Value: 100000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -66,14 +59,10 @@ var rewardsRedeemCmd = &cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
gasLimit := cctx.Int64("gas-limit")
|
|
||||||
|
|
||||||
smsg, err := api.MpoolPushMessage(ctx, &types.Message{
|
smsg, err := api.MpoolPushMessage(ctx, &types.Message{
|
||||||
To: maddr,
|
To: maddr,
|
||||||
From: mi.Owner,
|
From: mi.Owner,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasPrice: types.NewInt(1),
|
|
||||||
GasLimit: gasLimit,
|
|
||||||
Method: builtin.MethodsMiner.WithdrawBalance,
|
Method: builtin.MethodsMiner.WithdrawBalance,
|
||||||
Params: params,
|
Params: params,
|
||||||
})
|
})
|
||||||
|
@ -138,7 +138,7 @@ func (c *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address,
|
|||||||
From: addr,
|
From: addr,
|
||||||
Value: amount,
|
Value: amount,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 200_000_000,
|
GasLimit: 0,
|
||||||
Method: builtin.MethodsMarket.AddBalance,
|
Method: builtin.MethodsMarket.AddBalance,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -78,7 +78,7 @@ func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemark
|
|||||||
From: mi.Worker,
|
From: mi.Worker,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 600_000_000,
|
GasLimit: 0,
|
||||||
Method: builtin.MethodsMarket.PublishStorageDeals,
|
Method: builtin.MethodsMarket.PublishStorageDeals,
|
||||||
Params: params,
|
Params: params,
|
||||||
})
|
})
|
||||||
@ -175,7 +175,7 @@ func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address
|
|||||||
From: addr,
|
From: addr,
|
||||||
Value: amount,
|
Value: amount,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 200_000_000,
|
GasLimit: 0,
|
||||||
Method: builtin.MethodsMarket.AddBalance,
|
Method: builtin.MethodsMarket.AddBalance,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
package impl
|
package impl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/node/impl/client"
|
"github.com/filecoin-project/lotus/node/impl/client"
|
||||||
"github.com/filecoin-project/lotus/node/impl/common"
|
"github.com/filecoin-project/lotus/node/impl/common"
|
||||||
"github.com/filecoin-project/lotus/node/impl/full"
|
"github.com/filecoin-project/lotus/node/impl/full"
|
||||||
@ -18,6 +22,7 @@ type FullNodeAPI struct {
|
|||||||
full.ChainAPI
|
full.ChainAPI
|
||||||
client.API
|
client.API
|
||||||
full.MpoolAPI
|
full.MpoolAPI
|
||||||
|
full.GasAPI
|
||||||
market.MarketAPI
|
market.MarketAPI
|
||||||
paych.PaychAPI
|
paych.PaychAPI
|
||||||
full.StateAPI
|
full.StateAPI
|
||||||
@ -26,4 +31,10 @@ type FullNodeAPI struct {
|
|||||||
full.SyncAPI
|
full.SyncAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MpoolEstimateGasPrice estimates gas price
|
||||||
|
// Deprecated: used GasEstimateGasPrice instead
|
||||||
|
func (fa *FullNodeAPI) MpoolEstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, limit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
||||||
|
return fa.GasEstimateGasPrice(ctx, nblocksincl, sender, limit, tsk)
|
||||||
|
}
|
||||||
|
|
||||||
var _ api.FullNode = &FullNodeAPI{}
|
var _ api.FullNode = &FullNodeAPI{}
|
||||||
|
59
node/impl/full/gas.go
Normal file
59
node/impl/full/gas.go
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package full
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
|
"github.com/filecoin-project/lotus/build"
|
||||||
|
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||||
|
"github.com/filecoin-project/lotus/chain/store"
|
||||||
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
|
"github.com/filecoin-project/specs-actors/actors/runtime/exitcode"
|
||||||
|
"go.uber.org/fx"
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GasAPI struct {
|
||||||
|
fx.In
|
||||||
|
Stmgr *stmgr.StateManager
|
||||||
|
Cs *store.ChainStore
|
||||||
|
}
|
||||||
|
|
||||||
|
const MinGasPrice = 1
|
||||||
|
|
||||||
|
func (a *GasAPI) GasEstimateGasPrice(ctx context.Context, nblocksincl uint64,
|
||||||
|
sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
||||||
|
|
||||||
|
// TODO: something smarter obviously
|
||||||
|
switch nblocksincl {
|
||||||
|
case 0:
|
||||||
|
return types.NewInt(MinGasPrice + 2), nil
|
||||||
|
case 1:
|
||||||
|
return types.NewInt(MinGasPrice + 1), nil
|
||||||
|
default:
|
||||||
|
return types.NewInt(MinGasPrice), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *GasAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message,
|
||||||
|
tsk types.TipSetKey) (int64, error) {
|
||||||
|
|
||||||
|
msg := *msgIn
|
||||||
|
msg.GasLimit = build.BlockGasLimit
|
||||||
|
msg.GasPrice = types.NewInt(1)
|
||||||
|
|
||||||
|
ts, err := a.Cs.GetTipSetFromKey(tsk)
|
||||||
|
if err != nil {
|
||||||
|
return -1, xerrors.Errorf("could not get tipset: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := a.Stmgr.CallWithGas(ctx, &msg, ts)
|
||||||
|
if err != nil {
|
||||||
|
return -1, xerrors.Errorf("CallWithGas failed: %w", err)
|
||||||
|
}
|
||||||
|
if res.MsgRct.ExitCode != exitcode.Ok {
|
||||||
|
return -1, xerrors.Errorf("message execution failed: exit %s, reason: %s", res.MsgRct.ExitCode, res.Error)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.MsgRct.GasUsed, nil
|
||||||
|
}
|
@ -18,6 +18,7 @@ type MpoolAPI struct {
|
|||||||
fx.In
|
fx.In
|
||||||
|
|
||||||
WalletAPI
|
WalletAPI
|
||||||
|
GasAPI
|
||||||
|
|
||||||
Chain *store.ChainStore
|
Chain *store.ChainStore
|
||||||
|
|
||||||
@ -86,15 +87,27 @@ func (a *MpoolAPI) MpoolPush(ctx context.Context, smsg *types.SignedMessage) (ci
|
|||||||
return a.Mpool.Push(smsg)
|
return a.Mpool.Push(smsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GasMargin sets by how much should gas limit be increased over test execution
|
||||||
|
var GasMargin = 1.2
|
||||||
|
|
||||||
func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message) (*types.SignedMessage, error) {
|
func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message) (*types.SignedMessage, error) {
|
||||||
if msg.Nonce != 0 {
|
if msg.Nonce != 0 {
|
||||||
return nil, xerrors.Errorf("MpoolPushMessage expects message nonce to be 0, was %d", msg.Nonce)
|
return nil, xerrors.Errorf("MpoolPushMessage expects message nonce to be 0, was %d", msg.Nonce)
|
||||||
}
|
}
|
||||||
if msg.GasLimit == 0 {
|
if msg.GasLimit == 0 {
|
||||||
msg.GasLimit = 100_000_000 // TODO: gas limit estimation
|
gasLimit, err := a.GasEstimateGasLimit(ctx, msg, types.TipSetKey{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("estimating gas limit: %w", err)
|
||||||
}
|
}
|
||||||
if types.BigCmp(msg.GasPrice, types.NewInt(0)) == 0 {
|
msg.GasLimit = int64(float64(gasLimit) * GasMargin)
|
||||||
msg.GasPrice = types.NewInt(1) // TODO: gas price estimation
|
}
|
||||||
|
|
||||||
|
if msg.GasPrice == types.EmptyInt || types.BigCmp(msg.GasPrice, types.NewInt(0)) == 0 {
|
||||||
|
gasPrice, err := a.GasEstimateGasPrice(ctx, 2, msg.From, msg.GasLimit, types.TipSetKey{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("estimating gas price: %w", err)
|
||||||
|
}
|
||||||
|
msg.GasPrice = gasPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
return a.Mpool.PushWithNonce(ctx, msg.From, func(from address.Address, nonce uint64) (*types.SignedMessage, error) {
|
return a.Mpool.PushWithNonce(ctx, msg.From, func(from address.Address, nonce uint64) (*types.SignedMessage, error) {
|
||||||
@ -124,7 +137,3 @@ func (a *MpoolAPI) MpoolGetNonce(ctx context.Context, addr address.Address) (uin
|
|||||||
func (a *MpoolAPI) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error) {
|
func (a *MpoolAPI) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error) {
|
||||||
return a.Mpool.Updates(ctx)
|
return a.Mpool.Updates(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *MpoolAPI) MpoolEstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
|
||||||
return a.Mpool.EstimateGasPrice(ctx, nblocksincl, sender, gaslimit, tsk)
|
|
||||||
}
|
|
||||||
|
@ -77,7 +77,7 @@ func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Ad
|
|||||||
Method: builtin.MethodsInit.Exec,
|
Method: builtin.MethodsInit.Exec,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
GasPrice: gp,
|
GasPrice: gp,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
Value: val,
|
Value: val,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ func (a *MsigAPI) MsigPropose(ctx context.Context, msig address.Address, to addr
|
|||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
Method: builtin.MethodsMultisig.Propose,
|
Method: builtin.MethodsMultisig.Propose,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(1),
|
GasPrice: types.NewInt(1),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ func (a *MsigAPI) msigApproveOrCancel(ctx context.Context, operation api.MsigPro
|
|||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
Method: msigResponseMethod,
|
Method: msigResponseMethod,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(1),
|
GasPrice: types.NewInt(1),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,7 +974,7 @@ func (a *StateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr
|
|||||||
From: maddr,
|
From: maddr,
|
||||||
To: builtin.StorageMarketActorAddr,
|
To: builtin.StorageMarketActorAddr,
|
||||||
Method: builtin.MethodsMarket.VerifyDealsForActivation,
|
Method: builtin.MethodsMarket.VerifyDealsForActivation,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
Params: params,
|
Params: params,
|
||||||
}, ts)
|
}, ts)
|
||||||
|
@ -127,7 +127,7 @@ func (a *PaychAPI) PaychClose(ctx context.Context, addr address.Address) (cid.Ci
|
|||||||
Method: builtin.MethodsPaych.Settle,
|
Method: builtin.MethodsPaych.Settle,
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
|
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ func (a *PaychAPI) PaychVoucherSubmit(ctx context.Context, ch address.Address, s
|
|||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
Method: builtin.MethodsPaych.UpdateChannelState,
|
Method: builtin.MethodsPaych.UpdateChannelState,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, a
|
|||||||
Params: enc,
|
Params: enc,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = tnd.MpoolPushMessage(ctx, msg)
|
_, err = tnd.MpoolPushMessage(ctx, msg)
|
||||||
|
@ -37,7 +37,7 @@ func (pm *Manager) createPaych(ctx context.Context, from, to address.Address, am
|
|||||||
Value: amt,
|
Value: amt,
|
||||||
Method: builtin.MethodsInit.Exec,
|
Method: builtin.MethodsInit.Exec,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ func (pm *Manager) addFunds(ctx context.Context, ch address.Address, from addres
|
|||||||
From: from,
|
From: from,
|
||||||
Value: amt,
|
Value: amt,
|
||||||
Method: 0,
|
Method: 0,
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,4 +7,4 @@ export TRUST_PARAMS=1
|
|||||||
tag=${TAG:-debug}
|
tag=${TAG:-debug}
|
||||||
|
|
||||||
go run -tags=$tag ./cmd/lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
|
go run -tags=$tag ./cmd/lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
|
||||||
go run -tags=$tag ./cmd/lotus-miner init --actor=t01000 --genesis-miner --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json
|
go run -tags=$tag ./cmd/lotus-storage-miner init --actor=t01000 --genesis-miner --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json
|
||||||
|
@ -117,7 +117,7 @@ func (s SealingAPIAdapter) StateComputeDataCommitment(ctx context.Context, maddr
|
|||||||
From: maddr,
|
From: maddr,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasPrice: types.NewInt(0),
|
GasPrice: types.NewInt(0),
|
||||||
GasLimit: 100_000_000,
|
GasLimit: 0,
|
||||||
Method: builtin.MethodsMarket.ComputeDataCommitment,
|
Method: builtin.MethodsMarket.ComputeDataCommitment,
|
||||||
Params: ccparams,
|
Params: ccparams,
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, dlIdx uin
|
|||||||
Method: builtin.MethodsMiner.DeclareFaultsRecovered,
|
Method: builtin.MethodsMiner.DeclareFaultsRecovered,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
Value: types.NewInt(0),
|
Value: types.NewInt(0),
|
||||||
GasLimit: 100_000_000, // i dont know help
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(2),
|
GasPrice: types.NewInt(2),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ func (s *WindowPoStScheduler) checkNextFaults(ctx context.Context, dlIdx uint64,
|
|||||||
Method: builtin.MethodsMiner.DeclareFaults,
|
Method: builtin.MethodsMiner.DeclareFaults,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
Value: types.NewInt(0), // TODO: Is there a fee?
|
Value: types.NewInt(0), // TODO: Is there a fee?
|
||||||
GasLimit: 100_000_000, // i dont know help
|
GasLimit: 0,
|
||||||
GasPrice: types.NewInt(2),
|
GasPrice: types.NewInt(2),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user