change gas limit to be a normal int64

This commit is contained in:
whyrusleeping 2020-03-18 13:45:37 -07:00
parent b2d4d37539
commit ddf1beac6c
36 changed files with 148 additions and 100 deletions

View File

@ -416,7 +416,7 @@ func getRandomMessages(cg *ChainGen) ([]*types.SignedMessage, error) {
Method: 0,
GasLimit: types.NewInt(10000),
GasLimit: 10000,
GasPrice: types.NewInt(0),
}

View File

@ -36,7 +36,7 @@ func doExecValue(ctx context.Context, vm *vm.VM, to, from address.Address, value
From: from,
Method: method,
Params: params,
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
GasPrice: types.NewInt(0),
Value: value,
Nonce: act.Nonce,

View File

@ -70,7 +70,7 @@ func (fm *FundMgr) EnsureAvailable(ctx context.Context, addr, wallet address.Add
From: wallet,
Value: toAdd,
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
Method: builtin.MethodsMarket.AddBalance,
Params: params,
})

View File

@ -26,8 +26,8 @@ func (sm *StateManager) CallRaw(ctx context.Context, msg *types.Message, bstate
return nil, xerrors.Errorf("failed to set up vm: %w", err)
}
if msg.GasLimit == types.EmptyInt {
msg.GasLimit = types.NewInt(10000000000)
if msg.GasLimit == 0 {
msg.GasLimit = 10000000000
}
if msg.GasPrice == types.EmptyInt {
msg.GasPrice = types.NewInt(0)
@ -38,7 +38,7 @@ func (sm *StateManager) CallRaw(ctx context.Context, msg *types.Message, bstate
if span.IsRecordingEvents() {
span.AddAttributes(
trace.Int64Attribute("gas_limit", int64(msg.GasLimit.Uint64())),
trace.Int64Attribute("gas_limit", msg.GasLimit),
trace.Int64Attribute("gas_price", int64(msg.GasPrice.Uint64())),
trace.StringAttribute("value", msg.Value.String()),
)

View File

@ -181,7 +181,7 @@ func TestForkHeightTriggers(t *testing.T) {
To: builtin.InitActorAddr,
Method: builtin.MethodsInit.Exec,
Params: enc,
GasLimit: types.NewInt(10000),
GasLimit: 10000,
GasPrice: types.NewInt(0),
}
sig, err := cg.Wallet().Sign(ctx, cg.Banker(), m.Cid().Bytes())
@ -208,7 +208,7 @@ func TestForkHeightTriggers(t *testing.T) {
Method: 2,
Params: nil,
Nonce: nonce,
GasLimit: types.NewInt(10000),
GasLimit: 10000,
GasPrice: types.NewInt(0),
}
nonce++

View File

@ -228,7 +228,7 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, pstate cid.Cid, bms []B
Nonce: sysAct.Nonce,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1 << 30),
GasLimit: 1 << 30,
Method: builtin.MethodsReward.AwardBlockReward,
Params: params,
}
@ -260,7 +260,7 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, pstate cid.Cid, bms []B
Nonce: ca.Nonce,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1 << 30), // Make super sure this is never too little
GasLimit: 1 << 30, // Make super sure this is never too little
Method: builtin.MethodsCron.EpochTick,
Params: nil,
}

View File

@ -77,8 +77,8 @@ func (cs *ChainStore) call(ctx context.Context, msg *types.Message, ts *types.Ti
return nil, xerrors.Errorf("failed to set up vm: %w", err)
}
if msg.GasLimit == types.EmptyInt {
msg.GasLimit = types.NewInt(10000000000)
if msg.GasLimit == 0 {
msg.GasLimit = 10000000000
}
if msg.GasPrice == types.EmptyInt {
msg.GasPrice = types.NewInt(0)

View File

@ -656,9 +656,15 @@ func (t *Message) MarshalCBOR(w io.Writer) error {
return err
}
// t.GasLimit (big.Int) (struct)
if err := t.GasLimit.MarshalCBOR(w); err != nil {
return err
// t.GasLimit (int64) (int64)
if t.GasLimit >= 0 {
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.GasLimit))); err != nil {
return err
}
} else {
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajNegativeInt, uint64(-t.GasLimit)-1)); err != nil {
return err
}
}
// t.Method (abi.MethodNum) (uint64)
@ -746,14 +752,30 @@ func (t *Message) UnmarshalCBOR(r io.Reader) error {
}
}
// t.GasLimit (big.Int) (struct)
// t.GasLimit (int64) (int64)
{
if err := t.GasLimit.UnmarshalCBOR(br); err != nil {
maj, extra, err := cbg.CborReadHeader(br)
var extraI int64
if err != nil {
return err
}
switch maj {
case cbg.MajUnsignedInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 positive overflow")
}
case cbg.MajNegativeInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 negative oveflow")
}
extraI = -1 - extraI
default:
return fmt.Errorf("wrong type for int64 field: %d", maj)
}
t.GasLimit = int64(extraI)
}
// t.Method (abi.MethodNum) (uint64)
@ -1043,9 +1065,15 @@ func (t *MessageReceipt) MarshalCBOR(w io.Writer) error {
return err
}
// t.GasUsed (big.Int) (struct)
if err := t.GasUsed.MarshalCBOR(w); err != nil {
return err
// t.GasUsed (int64) (int64)
if t.GasUsed >= 0 {
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajUnsignedInt, uint64(t.GasUsed))); err != nil {
return err
}
} else {
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajNegativeInt, uint64(-t.GasUsed)-1)); err != nil {
return err
}
}
return nil
}
@ -1107,14 +1135,30 @@ func (t *MessageReceipt) UnmarshalCBOR(r io.Reader) error {
if _, err := io.ReadFull(br, t.Return); err != nil {
return err
}
// t.GasUsed (big.Int) (struct)
// t.GasUsed (int64) (int64)
{
if err := t.GasUsed.UnmarshalCBOR(br); err != nil {
maj, extra, err := cbg.CborReadHeader(br)
var extraI int64
if err != nil {
return err
}
switch maj {
case cbg.MajUnsignedInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 positive overflow")
}
case cbg.MajNegativeInt:
extraI = int64(extra)
if extraI < 0 {
return fmt.Errorf("int64 negative oveflow")
}
extraI = -1 - extraI
default:
return fmt.Errorf("wrong type for int64 field: %d", maj)
}
t.GasUsed = int64(extraI)
}
return nil
}

View File

@ -21,7 +21,7 @@ type Message struct {
Value BigInt
GasPrice BigInt
GasLimit BigInt
GasLimit int64
Method abi.MethodNum
Params []byte
@ -87,7 +87,7 @@ func (m *Message) Cid() cid.Cid {
func (m *Message) RequiredFunds() BigInt {
return BigAdd(
m.Value,
BigMul(m.GasPrice, m.GasLimit),
BigMul(m.GasPrice, NewInt(uint64(m.GasLimit))),
)
}

View File

@ -9,9 +9,9 @@ import (
type MessageReceipt struct {
ExitCode exitcode.ExitCode
Return []byte
GasUsed BigInt
GasUsed int64
}
func (mr *MessageReceipt) Equals(o *MessageReceipt) bool {
return mr.ExitCode == o.ExitCode && bytes.Equal(mr.Return, o.Return) && BigCmp(mr.GasUsed, o.GasUsed) == 0
return mr.ExitCode == o.ExitCode && bytes.Equal(mr.Return, o.Return) && mr.GasUsed == o.GasUsed
}

View File

@ -27,7 +27,7 @@ func MkMessage(from, to address.Address, nonce uint64, w *wallet.Wallet) *types.
From: from,
Value: types.NewInt(1),
Nonce: nonce,
GasLimit: types.NewInt(1),
GasLimit: 1,
GasPrice: types.NewInt(0),
}

View File

@ -27,7 +27,7 @@ func BenchmarkSerializeMessage(b *testing.B) {
Nonce: 197,
Method: 1231254,
Params: []byte("some bytes, idk. probably at least ten of them"),
GasLimit: NewInt(126723),
GasLimit: 126723,
GasPrice: NewInt(1776234),
}

View File

@ -19,7 +19,7 @@ func TestSignedMessageJsonRoundtrip(t *testing.T) {
Method: 1235126,
Value: types.NewInt(123123),
GasPrice: types.NewInt(1234),
GasLimit: types.NewInt(9992969384),
GasLimit: 9992969384,
Nonce: 123123,
},
}

View File

@ -4,6 +4,7 @@ import (
"context"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin"
"github.com/filecoin-project/specs-actors/actors/crypto"
"github.com/filecoin-project/specs-actors/actors/runtime/exitcode"
@ -53,7 +54,7 @@ func (a *Applier) ApplyMessage(eCtx *vtypes.ExecutionContext, state vstate.VMWra
mr := vtypes.MessageReceipt{
ExitCode: exitcode.ExitCode(ret.ExitCode),
ReturnValue: ret.Return,
GasUsed: ret.GasUsed,
GasUsed: big.NewInt(ret.GasUsed),
}
return mr, nil
@ -91,7 +92,7 @@ func (a *Applier) ApplyTipSetMessages(state vstate.VMWrapper, blocks []vtypes.Bl
ExitCode: exitcode.ExitCode(ret.ExitCode),
ReturnValue: ret.Return,
GasUsed: ret.GasUsed,
GasUsed: big.NewInt(ret.GasUsed),
})
return nil
})
@ -130,7 +131,7 @@ func toLotusMsg(msg *vtypes.Message) *types.Message {
Value: types.BigInt{Int: msg.Value.Int},
GasPrice: types.BigInt{Int: msg.GasPrice.Int},
GasLimit: types.NewInt(uint64(msg.GasLimit)),
GasLimit: msg.GasLimit,
Params: msg.Params,
}

View File

@ -34,8 +34,8 @@ type Runtime struct {
height abi.ChainEpoch
cst cbor.IpldStore
gasAvailable types.BigInt
gasUsed types.BigInt
gasAvailable int64
gasUsed int64
sys runtime.Syscalls
@ -325,7 +325,7 @@ func (rt *Runtime) internalSend(to address.Address, method abi.MethodNum, value
mr := types.MessageReceipt{
ExitCode: exitcode.ExitCode(aerrors.RetCode(errSend)),
Return: ret,
GasUsed: types.EmptyInt,
GasUsed: 0,
}
er := ExecutionResult{
@ -421,10 +421,9 @@ func (rt *Runtime) stateCommit(oldh, newh cid.Cid) aerrors.ActorError {
return nil
}
func (rt *Runtime) ChargeGas(amount uint64) {
toUse := types.NewInt(amount)
rt.gasUsed = types.BigAdd(rt.gasUsed, toUse)
if rt.gasUsed.GreaterThan(rt.gasAvailable) {
rt.Abortf(exitcode.SysErrOutOfGas, "not enough gas: used=%s, available=%s", rt.gasUsed, rt.gasAvailable)
func (rt *Runtime) ChargeGas(toUse int64) {
rt.gasUsed = rt.gasUsed + toUse
if rt.gasUsed > rt.gasAvailable {
rt.Abortf(exitcode.SysErrOutOfGas, "not enough gas: used=%d, available=%d", rt.gasUsed, rt.gasAvailable)
}
}

View File

@ -91,7 +91,7 @@ func ResolveToKeyAddr(state types.StateTree, cst cbor.IpldStore, addr address.Ad
var _ cbor.IpldBlockstore = (*gasChargingBlocks)(nil)
type gasChargingBlocks struct {
chargeGas func(uint64)
chargeGas func(int64)
under cbor.IpldBlockstore
}
@ -101,13 +101,13 @@ func (bs *gasChargingBlocks) Get(c cid.Cid) (block.Block, error) {
if err != nil {
return nil, aerrors.Escalate(err, "failed to get block from blockstore")
}
bs.chargeGas(uint64(len(blk.RawData())) * gasGetPerByte)
bs.chargeGas(int64(len(blk.RawData())) * gasGetPerByte)
return blk, nil
}
func (bs *gasChargingBlocks) Put(blk block.Block) error {
bs.chargeGas(gasPutObj + uint64(len(blk.RawData()))*gasPutPerByte)
bs.chargeGas(gasPutObj + int64(len(blk.RawData()))*gasPutPerByte)
if err := bs.under.Put(blk); err != nil {
return aerrors.Escalate(err, "failed to write data to disk")
@ -115,7 +115,7 @@ func (bs *gasChargingBlocks) Put(blk block.Block) error {
return nil
}
func (vm *VM) makeRuntime(ctx context.Context, msg *types.Message, origin address.Address, originNonce uint64, usedGas types.BigInt, icc int64) *Runtime {
func (vm *VM) makeRuntime(ctx context.Context, msg *types.Message, origin address.Address, originNonce uint64, usedGas int64, icc int64) *Runtime {
rt := &Runtime{
ctx: ctx,
vm: vm,
@ -184,7 +184,7 @@ type ApplyRet struct {
}
func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
gasCharge uint64) ([]byte, aerrors.ActorError, *Runtime) {
gasCharge int64) ([]byte, aerrors.ActorError, *Runtime) {
st := vm.cstate
@ -206,12 +206,12 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
}
}
gasUsed := types.NewInt(gasCharge)
gasUsed := gasCharge
origin := msg.From
on := msg.Nonce
var icc int64 = 0
if parent != nil {
gasUsed = types.BigAdd(parent.gasUsed, gasUsed)
gasUsed = parent.gasUsed + gasUsed
origin = parent.origin
on = parent.originNonce
icc = parent.internalCallCounter + 1
@ -240,8 +240,11 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
}
func checkMessage(msg *types.Message) error {
if msg.GasLimit == types.EmptyInt {
return xerrors.Errorf("message gas no gas limit set")
if msg.GasLimit == 0 {
return xerrors.Errorf("message has no gas limit set")
}
if msg.GasLimit < 0 {
return xerrors.Errorf("message has negative gas limit")
}
if msg.GasPrice == types.EmptyInt {
@ -274,8 +277,8 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
if err != nil {
return nil, xerrors.Errorf("could not serialize message: %w", err)
}
msgGasCost := uint64(len(serMsg)) * gasPerMessageByte
if msgGasCost > msg.GasLimit.Uint64() {
msgGasCost := int64(len(serMsg)) * gasPerMessageByte
if msgGasCost > msg.GasLimit {
return &ApplyRet{
MessageReceipt: types.MessageReceipt{
ExitCode: exitcode.SysErrOutOfGas,
@ -312,7 +315,7 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
}, nil
}
gascost := types.BigMul(msg.GasLimit, msg.GasPrice)
gascost := types.BigMul(types.NewInt(uint64(msg.GasLimit)), msg.GasPrice)
totalCost := types.BigAdd(gascost, msg.Value)
if fromActor.Balance.LessThan(totalCost) {
return &ApplyRet{
@ -340,7 +343,7 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
}
var errcode uint8
var gasUsed types.BigInt
var gasUsed int64
if errcode = aerrors.RetCode(actorErr); errcode != 0 {
gasUsed = msg.GasLimit
@ -351,7 +354,7 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
} else {
gasUsed = rt.gasUsed
// refund unused gas
refund := types.BigMul(types.BigSub(msg.GasLimit, gasUsed), msg.GasPrice)
refund := types.BigMul(types.NewInt(uint64(msg.GasLimit-gasUsed)), msg.GasPrice)
if err := Transfer(gasHolder, fromActor, refund); err != nil {
return nil, xerrors.Errorf("failed to refund gas")
}
@ -362,7 +365,7 @@ func (vm *VM) ApplyMessage(ctx context.Context, msg *types.Message) (*ApplyRet,
return nil, xerrors.Errorf("getting burnt funds actor failed: %w", err)
}
gasReward := types.BigMul(msg.GasPrice, gasUsed)
gasReward := types.BigMul(msg.GasPrice, types.NewInt(uint64(gasUsed)))
if err := Transfer(gasHolder, rwAct, gasReward); err != nil {
return nil, xerrors.Errorf("failed to give miner gas reward: %w", err)
}

View File

@ -796,7 +796,7 @@ var slashConsensusFault = &cli.Command{
From: def,
Value: types.NewInt(0),
GasPrice: types.NewInt(1),
GasLimit: types.NewInt(10000000),
GasLimit: 10000000,
Method: builtin.MethodsPower.ReportConsensusFault,
Params: params,
}

View File

@ -123,7 +123,7 @@ var msigCreateCmd = &cli.Command{
Method: builtin.MethodsInit.Exec,
Params: enc,
GasPrice: types.NewInt(1),
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
Value: types.BigInt(filval),
}
@ -353,7 +353,7 @@ var msigProposeCmd = &cli.Command{
Value: types.NewInt(0),
Method: builtin.MethodsMultisig.Propose,
Params: enc,
GasLimit: types.NewInt(100000),
GasLimit: 100000,
GasPrice: types.NewInt(1),
}
@ -439,7 +439,7 @@ var msigApproveCmd = &cli.Command{
Value: types.NewInt(0),
Method: builtin.MethodsMultisig.Approve,
Params: enc,
GasLimit: types.NewInt(100000),
GasLimit: 100000,
GasPrice: types.NewInt(1),
}

View File

@ -62,7 +62,7 @@ var sendCmd = &cli.Command{
From: fromAddr,
To: toAddr,
Value: types.BigInt(val),
GasLimit: types.NewInt(1000),
GasLimit: 1000,
GasPrice: types.NewInt(0),
}

View File

@ -349,7 +349,7 @@ var stateReplaySetCmd = &cli.Command{
fmt.Println("Replay receipt:")
fmt.Printf("Exit code: %d\n", res.MsgRct.ExitCode)
fmt.Printf("Return: %x\n", res.MsgRct.Return)
fmt.Printf("Gas Used: %s\n", res.MsgRct.GasUsed)
fmt.Printf("Gas Used: %d\n", res.MsgRct.GasUsed)
if res.MsgRct.ExitCode != 0 {
fmt.Printf("Error message: %q\n", res.Error)
}
@ -849,7 +849,7 @@ var stateWaitMsgCmd = &cli.Command{
fmt.Printf("message was executed in tipset: %s", mw.TipSet.Cids())
fmt.Printf("Exit Code: %d", mw.Receipt.ExitCode)
fmt.Printf("Gas Used: %s", mw.Receipt.GasUsed)
fmt.Printf("Gas Used: %d", mw.Receipt.GasUsed)
fmt.Printf("Return: %x", mw.Receipt.Return)
return nil
},
@ -928,7 +928,7 @@ var stateCallCmd = &cli.Command{
From: froma,
To: toa,
Value: types.BigInt(value),
GasLimit: types.NewInt(10000000000),
GasLimit: 10000000000,
GasPrice: types.NewInt(0),
Method: abi.MethodNum(method),
Params: params,

View File

@ -3,11 +3,12 @@ package main
import (
"context"
"fmt"
"github.com/filecoin-project/specs-actors/actors/crypto"
"math/rand"
"os"
"time"
"github.com/filecoin-project/specs-actors/actors/crypto"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
@ -76,7 +77,7 @@ func sendSmallFundsTxs(ctx context.Context, api api.FullNode, from address.Addre
From: from,
To: sendSet[rand.Intn(20)],
Value: types.NewInt(1),
GasLimit: types.NewInt(100000),
GasLimit: 100000,
GasPrice: types.NewInt(0),
}

View File

@ -662,7 +662,7 @@ create temp table msgs (like messages excluding constraints) on commit drop;
m.Nonce,
m.Value.String(),
m.GasPrice.String(),
m.GasLimit.String(),
m.GasLimit,
m.Method,
m.Params,
); err != nil {
@ -706,7 +706,7 @@ create temp table recs (like receipts excluding constraints) on commit drop;
c.state.String(),
c.idx,
m.ExitCode,
m.GasUsed.String(),
m.GasUsed,
m.Return,
); err != nil {
return err

View File

@ -279,7 +279,7 @@ type Message struct {
Value sbig
GasPrice sbig
GasLimit sbig
GasLimit int64
Method abi.MethodNum
Params []byte
@ -324,7 +324,7 @@ func (h *handler) messages(filter string, args ...interface{}) (out []types.Mess
Nonce: r.Nonce,
Value: types.BigInt(r.Value),
GasPrice: types.BigInt(r.GasPrice),
GasLimit: types.BigInt(r.GasLimit),
GasLimit: r.GasLimit,
Method: r.Method,
Params: r.Params,
}

View File

@ -190,7 +190,7 @@ func (h *handler) send(w http.ResponseWriter, r *http.Request) {
To: to,
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000),
GasLimit: 1000,
})
if err != nil {
w.WriteHeader(400)
@ -256,7 +256,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) {
To: owner,
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000),
GasLimit: 1000,
})
if err != nil {
w.WriteHeader(400)
@ -285,7 +285,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) {
Method: builtin.MethodsPower.CreateMiner,
Params: params,
GasLimit: types.NewInt(10000000),
GasLimit: 10000000,
GasPrice: types.NewInt(0),
}

View File

@ -89,7 +89,7 @@ var noncefix = &cli.Command{
From: addr,
To: addr,
Value: types.NewInt(1),
GasLimit: types.NewInt(1000),
GasLimit: 1000,
GasPrice: types.NewInt(1),
Nonce: i,
}

View File

@ -500,7 +500,7 @@ func configureStorageMiner(ctx context.Context, api lapi.FullNode, addr address.
Params: enc,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(100000000),
GasLimit: 100000000,
}
smsg, err := api.MpoolPushMessage(ctx, msg)
@ -571,7 +571,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
Method: builtin.MethodsPower.CreateMiner,
Params: params,
GasLimit: types.NewInt(10000000),
GasLimit: 10000000,
GasPrice: types.NewInt(0),
}

View File

@ -100,7 +100,7 @@ var rewardsRedeemCmd = &cli.Command{
Nonce: workerNonce,
Value: types.NewInt(0),
GasPrice: types.NewInt(1),
GasLimit: types.NewInt(100000),
GasLimit: 100000,
Method: builtin.MethodsReward.WithdrawReward,
Params: params,
})

View File

@ -127,7 +127,7 @@ func (n *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address,
From: addr,
Value: amount,
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
Method: builtin.MethodsMarket.AddBalance,
})
if err != nil {

View File

@ -73,7 +73,7 @@ func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemark
From: worker,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
Method: builtin.MethodsMarket.PublishStorageDeals,
Params: params,
})
@ -161,7 +161,7 @@ func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address
From: addr,
Value: amount,
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
Method: builtin.MethodsMarket.AddBalance,
})
if err != nil {

View File

@ -43,7 +43,7 @@ func TestMessageFiltering(t *testing.T) {
To: a1,
Nonce: 3,
Value: types.NewInt(500),
GasLimit: types.NewInt(50),
GasLimit: 50,
GasPrice: types.NewInt(1),
},
types.Message{
@ -51,7 +51,7 @@ func TestMessageFiltering(t *testing.T) {
To: a1,
Nonce: 4,
Value: types.NewInt(500),
GasLimit: types.NewInt(50),
GasLimit: 50,
GasPrice: types.NewInt(1),
},
types.Message{
@ -59,7 +59,7 @@ func TestMessageFiltering(t *testing.T) {
To: a1,
Nonce: 1,
Value: types.NewInt(800),
GasLimit: types.NewInt(100),
GasLimit: 100,
GasPrice: types.NewInt(1),
},
types.Message{
@ -67,7 +67,7 @@ func TestMessageFiltering(t *testing.T) {
To: a1,
Nonce: 0,
Value: types.NewInt(800),
GasLimit: types.NewInt(100),
GasLimit: 100,
GasPrice: types.NewInt(1),
},
types.Message{
@ -75,7 +75,7 @@ func TestMessageFiltering(t *testing.T) {
To: a1,
Nonce: 2,
Value: types.NewInt(150),
GasLimit: types.NewInt(100),
GasLimit: (100),
GasPrice: types.NewInt(1),
},
}

View File

@ -125,7 +125,7 @@ func (a *PaychAPI) PaychClose(ctx context.Context, addr address.Address) (cid.Ci
Method: builtin.MethodsPaych.Settle,
Nonce: nonce,
GasLimit: types.NewInt(500),
GasLimit: 500,
GasPrice: types.NewInt(0),
}
@ -240,7 +240,7 @@ func (a *PaychAPI) PaychVoucherSubmit(ctx context.Context, ch address.Address, s
Nonce: nonce,
Method: builtin.MethodsPaych.UpdateChannelState,
Params: enc,
GasLimit: types.NewInt(100000),
GasLimit: 100000,
GasPrice: types.NewInt(0),
}

View File

@ -97,7 +97,7 @@ func testStorageNode(ctx context.Context, t *testing.T, waddr address.Address, a
Params: enc,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
}
_, err = tnd.MpoolPushMessage(ctx, msg)

View File

@ -37,7 +37,7 @@ func (pm *Manager) createPaych(ctx context.Context, from, to address.Address, am
Value: amt,
Method: builtin.MethodsInit.Exec,
Params: enc,
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
GasPrice: types.NewInt(0),
}
@ -84,7 +84,7 @@ func (pm *Manager) addFunds(ctx context.Context, ch address.Address, from addres
From: from,
Value: amt,
Method: 0,
GasLimit: types.NewInt(1000000),
GasLimit: 1000000,
GasPrice: types.NewInt(0),
}

View File

@ -67,7 +67,7 @@ func (s *FPoStScheduler) declareFaults(ctx context.Context, fc uint64, params *m
Method: builtin.MethodsMiner.DeclareTemporaryFaults,
Params: enc,
Value: types.NewInt(0),
GasLimit: types.NewInt(10000000), // i dont know help
GasLimit: 10000000, // i dont know help
GasPrice: types.NewInt(1),
}
@ -258,8 +258,8 @@ func (s *FPoStScheduler) submitPost(ctx context.Context, proof *abi.OnChainPoStV
From: s.worker,
Method: builtin.MethodsMiner.SubmitWindowedPoSt,
Params: enc,
Value: types.NewInt(1000), // currently hard-coded late fee in actor, returned if not late
GasLimit: types.NewInt(10000000), // i dont know help
Value: types.NewInt(1000), // currently hard-coded late fee in actor, returned if not late
GasLimit: 10000000, // i dont know help
GasPrice: types.NewInt(1),
}

View File

@ -90,7 +90,7 @@ func checkSeal(ctx context.Context, maddr address.Address, si SectorInfo, api se
From: maddr,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(9999999999),
GasLimit: 9999999999,
Method: builtin.MethodsMarket.ComputeDataCommitment,
Params: ccparams,
}

View File

@ -121,7 +121,7 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf
Method: builtin.MethodsMiner.PreCommitSector,
Params: enc,
Value: types.NewInt(0), // TODO: need to ensure sufficient collateral
GasLimit: types.NewInt(1000000 /* i dont know help */),
GasLimit: 1000000, /* i dont know help */
GasPrice: types.NewInt(1),
}
@ -212,7 +212,7 @@ func (m *Sealing) handleCommitting(ctx statemachine.Context, sector SectorInfo)
Method: builtin.MethodsMiner.ProveCommitSector,
Params: enc,
Value: types.NewInt(0), // TODO: need to ensure sufficient collateral
GasLimit: types.NewInt(1000000 /* i dont know help */),
GasLimit: 1000000, /* i dont know help */
GasPrice: types.NewInt(1),
}
@ -278,7 +278,7 @@ func (m *Sealing) handleFaulty(ctx statemachine.Context, sector SectorInfo) erro
Method: builtin.MethodsMiner.DeclareTemporaryFaults,
Params: enc,
Value: types.NewInt(0), // TODO: need to ensure sufficient collateral
GasLimit: types.NewInt(1000000 /* i dont know help */),
GasLimit: 1000000, /* i dont know help */
GasPrice: types.NewInt(1),
}