From 81a65fe1bc49ef6d9892545c8cf8313814283329 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sat, 1 Aug 2020 16:23:13 +0200 Subject: [PATCH] Swich gas-price to 0 in many places Signed-off-by: Jakub Sztandera --- cli/chain.go | 12 +++++------ cmd/lotus-shed/nonce-fix.go | 10 ++++----- cmd/lotus-shed/verifreg.go | 10 ++++----- cmd/lotus-storage-miner/actor.go | 1 - node/impl/full/multisig.go | 30 ++++++++++++--------------- storage/adapter_storage_miner.go | 12 +++++------ storage/wdpost_run.go | 35 ++++++++++++++------------------ 7 files changed, 46 insertions(+), 64 deletions(-) diff --git a/cli/chain.go b/cli/chain.go index e0bce29de..1bb34e673 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -932,13 +932,11 @@ var slashConsensusFault = &cli.Command{ } msg := &types.Message{ - To: maddr, - From: def, - Value: types.NewInt(0), - GasPrice: types.NewInt(1), - GasLimit: 0, - Method: builtin.MethodsMiner.ReportConsensusFault, - Params: enc, + To: maddr, + From: def, + Value: types.NewInt(0), + Method: builtin.MethodsMiner.ReportConsensusFault, + Params: enc, } smsg, err := api.MpoolPushMessage(ctx, msg) diff --git a/cmd/lotus-shed/nonce-fix.go b/cmd/lotus-shed/nonce-fix.go index 1cd713852..4824a7bce 100644 --- a/cmd/lotus-shed/nonce-fix.go +++ b/cmd/lotus-shed/nonce-fix.go @@ -86,12 +86,10 @@ var noncefix = &cli.Command{ for i := start; i < end; i++ { msg := &types.Message{ - From: addr, - To: addr, - Value: types.NewInt(1), - GasLimit: 0, - GasPrice: types.NewInt(1), - Nonce: i, + From: addr, + To: addr, + Value: types.NewInt(1), + Nonce: i, } smsg, err := api.WalletSignMessage(ctx, addr, msg) if err != nil { diff --git a/cmd/lotus-shed/verifreg.go b/cmd/lotus-shed/verifreg.go index ba7c3004d..b8a944165 100644 --- a/cmd/lotus-shed/verifreg.go +++ b/cmd/lotus-shed/verifreg.go @@ -69,12 +69,10 @@ var verifRegAddVerifierCmd = &cli.Command{ ctx := lcli.ReqContext(cctx) msg := &types.Message{ - To: builtin.VerifiedRegistryActorAddr, - From: fromk, - Method: builtin.MethodsVerifiedRegistry.AddVerifier, - GasPrice: types.NewInt(1), - GasLimit: 0, - Params: params, + To: builtin.VerifiedRegistryActorAddr, + From: fromk, + Method: builtin.MethodsVerifiedRegistry.AddVerifier, + Params: params, } smsg, err := api.MpoolPushMessage(ctx, msg) diff --git a/cmd/lotus-storage-miner/actor.go b/cmd/lotus-storage-miner/actor.go index 7874cb19d..dcc2106b5 100644 --- a/cmd/lotus-storage-miner/actor.go +++ b/cmd/lotus-storage-miner/actor.go @@ -78,7 +78,6 @@ var actorSetAddrsCmd = &cli.Command{ To: maddr, From: minfo.Worker, Value: types.NewInt(0), - GasPrice: types.NewInt(1), GasLimit: gasLimit, Method: 18, Params: params, diff --git a/node/impl/full/multisig.go b/node/impl/full/multisig.go index 6e0025a83..0ec8b68c8 100644 --- a/node/impl/full/multisig.go +++ b/node/impl/full/multisig.go @@ -28,6 +28,7 @@ type MsigAPI struct { MpoolAPI MpoolAPI } +// TODO: remove gp (gasPrice) from arguemnts func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) { lenAddrs := uint64(len(addrs)) @@ -45,7 +46,7 @@ func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Ad } if gp == types.EmptyInt { - gp = types.NewInt(1) + gp = types.NewInt(0) } // Set up constructor parameters for multisig @@ -77,9 +78,8 @@ func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Ad From: src, Method: builtin.MethodsInit.Exec, Params: enc, - GasPrice: gp, - GasLimit: 0, Value: val, + GasPrice: gp, } // send the message out to the network @@ -120,13 +120,11 @@ func (a *MsigAPI) MsigPropose(ctx context.Context, msig address.Address, to addr } msg := &types.Message{ - To: msig, - From: src, - Value: types.NewInt(0), - Method: builtin.MethodsMultisig.Propose, - Params: enc, - GasLimit: 0, - GasPrice: types.NewInt(1), + To: msig, + From: src, + Value: types.NewInt(0), + Method: builtin.MethodsMultisig.Propose, + Params: enc, } smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg) @@ -236,13 +234,11 @@ func (a *MsigAPI) msigApproveOrCancel(ctx context.Context, operation api.MsigPro } msg := &types.Message{ - To: msig, - From: src, - Value: types.NewInt(0), - Method: msigResponseMethod, - Params: enc, - GasLimit: 0, - GasPrice: types.NewInt(1), + To: msig, + From: src, + Value: types.NewInt(0), + Method: msigResponseMethod, + Params: enc, } smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg) diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go index 9bb1ad14b..5d7c494c8 100644 --- a/storage/adapter_storage_miner.go +++ b/storage/adapter_storage_miner.go @@ -122,13 +122,11 @@ func (s SealingAPIAdapter) StateComputeDataCommitment(ctx context.Context, maddr } ccmt := &types.Message{ - To: builtin.StorageMarketActorAddr, - From: maddr, - Value: types.NewInt(0), - GasPrice: types.NewInt(0), - GasLimit: 0, - Method: builtin.MethodsMarket.ComputeDataCommitment, - Params: ccparams, + To: builtin.StorageMarketActorAddr, + From: maddr, + Value: types.NewInt(0), + Method: builtin.MethodsMarket.ComputeDataCommitment, + Params: ccparams, } r, err := s.delegate.StateCall(ctx, ccmt, tsk) if err != nil { diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index d21102df7..06febce64 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -171,13 +171,11 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, dlIdx uin } msg := &types.Message{ - To: s.actor, - From: s.worker, - Method: builtin.MethodsMiner.DeclareFaultsRecovered, - Params: enc, - Value: types.NewInt(0), - GasLimit: 0, - GasPrice: types.NewInt(2), + To: s.actor, + From: s.worker, + Method: builtin.MethodsMiner.DeclareFaultsRecovered, + Params: enc, + Value: types.NewInt(0), } sm, err := s.api.MpoolPushMessage(ctx, msg) @@ -255,13 +253,11 @@ func (s *WindowPoStScheduler) checkNextFaults(ctx context.Context, dlIdx uint64, } msg := &types.Message{ - To: s.actor, - From: s.worker, - Method: builtin.MethodsMiner.DeclareFaults, - Params: enc, - Value: types.NewInt(0), // TODO: Is there a fee? - GasLimit: 0, - GasPrice: types.NewInt(2), + To: s.actor, + From: s.worker, + Method: builtin.MethodsMiner.DeclareFaults, + Params: enc, + Value: types.NewInt(0), // TODO: Is there a fee? } sm, err := s.api.MpoolPushMessage(ctx, msg) @@ -457,12 +453,11 @@ func (s *WindowPoStScheduler) submitPost(ctx context.Context, proof *miner.Submi } msg := &types.Message{ - To: s.actor, - From: s.worker, - Method: builtin.MethodsMiner.SubmitWindowedPoSt, - Params: enc, - Value: types.NewInt(1000), // currently hard-coded late fee in actor, returned if not late - GasPrice: types.NewInt(3), + To: s.actor, + From: s.worker, + Method: builtin.MethodsMiner.SubmitWindowedPoSt, + Params: enc, + Value: types.NewInt(1000), // currently hard-coded late fee in actor, returned if not late } // TODO: consider maybe caring about the output