From f7244dd8890e8aa64eaf6c1311df06bdac022f35 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 19 Sep 2024 20:30:42 +1000 Subject: [PATCH] chore(miner): tweaks to pledge api from feedback --- CHANGELOG.md | 2 +- api/api_full.go | 3 +- build/openrpc/full.json | 2 +- .../actors/builtin/verifreg/actor.go.template | 65 ++--- chain/actors/builtin/verifreg/verifreg.go | 64 ++--- documentation/en/api-v1-unstable-methods.md | 3 +- itests/sector_miner_collateral_test.go | 2 +- storage/pipeline/mocks/mock_commit_batcher.go | 240 ------------------ 8 files changed, 48 insertions(+), 333 deletions(-) delete mode 100644 storage/pipeline/mocks/mock_commit_batcher.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c12de7ae37..e72fbb37cd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ * Add `EthSendRawTransactionUntrusted` RPC method to be used for the gateway when accepting `EthSendRawTransaction` and `eth_sendRawTransaction`. Applies a tighter limit on the number of messages in the queue from a single sender and applies additional restrictions on nonce increments. ([filecoin-project/lotus#12431](https://github.com/filecoin-project/lotus/pull/12431)) * [Checkpoint TipSets finalized by F3](https://github.com/filecoin-project/lotus/pull/12460): Once a decision is made by F3, the TipSet is check-pointed in `ChainStore`. As part of this change, any missing TipSets are asynchronously synced as required by the `ChainStore` checkpointing mechanism. * Add an environment variable, `F3_INITIAL_POWERTABLE_CID` to allow specifying the initial power table used by F3 ([filecoin-project/lotus#12502](https://github.com/filecoin-project/lotus/pull/12502)). This may be used to help a lotus node re-sync the F3 chain when syncing from a snapshot after the F3 upgrade epoch. The precise CID to use here won't be known until the F3 is officially "live". -* Added `StateMinerInitialPledgeForSector` RPC method and deprecated existing `StateMinerInitialPledgeCollateral` method. Since ProveCommitSectors3 and ProveReplicaUpdates3, sector onboarding no longer includes an explicit notion of "deals", and precommit messages no longer contain deal information. This makes the existing `StateMinerInitialPledgeCollateral` unable to properly calculate pledge requirements with only the precommit. `StateMinerInitialPledgeForSector` is a new simplified calculator that simply takes duration, sector size, and verified size and estimates pledge based on current network conditions. ([filecoin-project/lotus#12384](https://github.com/filecoin-project/lotus/pull/12384) +* Added `StateMinerInitialPledgeForSector` RPC method and deprecated existing `StateMinerInitialPledgeCollateral` method. Since ProveCommitSectors3 and ProveReplicaUpdates3, sector onboarding no longer includes an explicit notion of "deals", and precommit messages no longer contain deal information. This makes the existing `StateMinerInitialPledgeCollateral` unable to properly calculate pledge requirements with only the precommit. `StateMinerInitialPledgeForSector` is a new simplified calculator that simply takes duration, sector size, and verified size and estimates pledge based on current network conditions. Please note that the `StateMinerInitialPledgeCollateral` method will be removed entirely in the next non-patch release. ([filecoin-project/lotus#12384](https://github.com/filecoin-project/lotus/pull/12384) ## Improvements diff --git a/api/api_full.go b/api/api_full.go index 476fc262807..9c2b4d345c7 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -420,7 +420,8 @@ type FullNode interface { StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read // StateMinerInitialPledgeForSector returns the initial pledge collateral for a given sector // duration, size, and combined size of any verified pieces within the sector. This calculation - // depends on current network conditions at the given tipset. + // depends on current network conditions (total power, total pledge and current rewards) at the + // given tipset. StateMinerInitialPledgeForSector(ctx context.Context, sectorDuration abi.ChainEpoch, sectorSize abi.SectorSize, verifiedSize uint64, tsk types.TipSetKey) (types.BigInt, error) //perm:read // StateMinerAvailableBalance returns the portion of a miner's balance that can be withdrawn or spent StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read diff --git a/build/openrpc/full.json b/build/openrpc/full.json index cf0bbb69e62..237dab24093 100644 --- a/build/openrpc/full.json +++ b/build/openrpc/full.json @@ -21225,7 +21225,7 @@ { "name": "Filecoin.StateMinerInitialPledgeForSector", "description": "```go\nfunc (s *FullNodeStruct) StateMinerInitialPledgeForSector(p0 context.Context, p1 abi.ChainEpoch, p2 abi.SectorSize, p3 uint64, p4 types.TipSetKey) (types.BigInt, error) {\n\tif s.Internal.StateMinerInitialPledgeForSector == nil {\n\t\treturn *new(types.BigInt), ErrNotSupported\n\t}\n\treturn s.Internal.StateMinerInitialPledgeForSector(p0, p1, p2, p3, p4)\n}\n```", - "summary": "StateMinerInitialPledgeForSector returns the initial pledge collateral for a given sector\nduration, size, and combined size of any verified pieces within the sector. This calculation\ndepends on current network conditions at the given tipset.\n", + "summary": "StateMinerInitialPledgeForSector returns the initial pledge collateral for a given sector\nduration, size, and combined size of any verified pieces within the sector. This calculation\ndepends on current network conditions (total power, total pledge and current rewards) at the\ngiven tipset.\n", "paramStructure": "by-position", "params": [ { diff --git a/chain/actors/builtin/verifreg/actor.go.template b/chain/actors/builtin/verifreg/actor.go.template index bbda9be1240..75c99f2aaef 100644 --- a/chain/actors/builtin/verifreg/actor.go.template +++ b/chain/actors/builtin/verifreg/actor.go.template @@ -21,15 +21,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" - verifregtypes13 "github.com/filecoin-project/go-state-types/builtin/v14/verifreg" -) - -const ( - NoAllocationID = verifregtypes.NoAllocationID - MaximumVerifiedAllocationExpiration = verifregtypes.MaximumVerifiedAllocationExpiration - MinimumVerifiedAllocationTerm = verifregtypes.MinimumVerifiedAllocationTerm - MaximumVerifiedAllocationTerm = verifregtypes.MaximumVerifiedAllocationTerm - MinimumVerifiedAllocationSize = verifregtypes13.MinimumVerifiedAllocationSize + verifregtypes12 "github.com/filecoin-project/go-state-types/builtin/v12/verifreg" ) var ( @@ -37,41 +29,6 @@ var ( Methods = builtin{{.latestVersion}}.MethodsVerifiedRegistry ) -type ( - RemoveDataCapProposal = verifregtypes.RemoveDataCapProposal - RemoveDataCapRequest = verifregtypes.RemoveDataCapRequest - AddVerifierParams = verifregtypes.AddVerifierParams - AddVerifiedClientParams = verifregtypes.AddVerifiedClientParams - UseBytesParams = verifregtypes.UseBytesParams - RestoreBytesParams = verifregtypes.RestoreBytesParams - RemoveDataCapParams = verifregtypes.RemoveDataCapParams - RemoveDataCapReturn = verifregtypes.RemoveDataCapReturn - RemoveExpiredAllocationsParams = verifregtypes.RemoveExpiredAllocationsParams - RemoveExpiredAllocationsReturn = verifregtypes.RemoveExpiredAllocationsReturn - BatchReturn = verifregtypes.BatchReturn - AllocationId = verifregtypes.AllocationId - ClaimId = verifregtypes.ClaimId - ClaimAllocationsParams = verifregtypes.ClaimAllocationsParams - SectorAllocationClaims = verifregtypes13.SectorAllocationClaims - AllocationClaim = verifregtypes13.AllocationClaim - ClaimAllocationsReturn = verifregtypes.ClaimAllocationsReturn - GetClaimsParams = verifregtypes.GetClaimsParams - GetClaimsReturn = verifregtypes.GetClaimsReturn - Claim = verifregtypes.Claim - Allocation = verifregtypes.Allocation - UniversalReceiverParams = verifregtypes.UniversalReceiverParams - ReceiverType = verifregtypes.ReceiverType - AllocationsResponse = verifregtypes.AllocationsResponse - ExtendClaimTermsParams = verifregtypes.ExtendClaimTermsParams - ClaimTerm = verifregtypes.ClaimTerm - ExtendClaimTermsReturn = verifregtypes.ExtendClaimTermsReturn - RemoveExpiredClaimsParams = verifregtypes.RemoveExpiredClaimsParams - RemoveExpiredClaimsReturn = verifregtypes.RemoveExpiredClaimsReturn - AllocationRequest = verifregtypes.AllocationRequest - ClaimExtensionRequest = verifregtypes.ClaimExtensionRequest - AllocationRequests = verifregtypes.AllocationRequests -) - func Load(store adt.Store, act *types.Actor) (State, error) { if name, av, ok := actors.GetActorMetaByCode(act.Code); ok { if name != manifest.VerifregKey { @@ -139,3 +96,23 @@ func AllCodes() []cid.Cid { {{- end}} } } + +type ( + Allocation = verifregtypes.Allocation + AllocationId = verifregtypes.AllocationId + Claim = verifregtypes.Claim + ClaimId = verifregtypes.ClaimId + AllocationRequest = verifregtypes12.AllocationRequest + AllocationRequests = verifregtypes12.AllocationRequests + RemoveExpiredAllocationsParams = verifregtypes12.RemoveExpiredAllocationsParams + AddVerifierParams = verifregtypes12.AddVerifierParams + AddVerifiedClientParams = verifregtypes12.AddVerifiedClientParams +) + +const ( + NoAllocationID = verifregtypes.NoAllocationID + MinimumVerifiedAllocationTerm = verifregtypes12.MinimumVerifiedAllocationTerm + MaximumVerifiedAllocationTerm = verifregtypes12.MaximumVerifiedAllocationTerm + MaximumVerifiedAllocationExpiration = verifregtypes12.MaximumVerifiedAllocationExpiration +) + diff --git a/chain/actors/builtin/verifreg/verifreg.go b/chain/actors/builtin/verifreg/verifreg.go index 36c9aad137e..02d8aa116fd 100644 --- a/chain/actors/builtin/verifreg/verifreg.go +++ b/chain/actors/builtin/verifreg/verifreg.go @@ -8,7 +8,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" builtin15 "github.com/filecoin-project/go-state-types/builtin" - verifregtypes13 "github.com/filecoin-project/go-state-types/builtin/v14/verifreg" + verifregtypes12 "github.com/filecoin-project/go-state-types/builtin/v12/verifreg" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" "github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/manifest" @@ -25,54 +25,11 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -const ( - NoAllocationID = verifregtypes.NoAllocationID - MaximumVerifiedAllocationExpiration = verifregtypes.MaximumVerifiedAllocationExpiration - MinimumVerifiedAllocationTerm = verifregtypes.MinimumVerifiedAllocationTerm - MaximumVerifiedAllocationTerm = verifregtypes.MaximumVerifiedAllocationTerm - MinimumVerifiedAllocationSize = verifregtypes13.MinimumVerifiedAllocationSize -) - var ( Address = builtin15.VerifiedRegistryActorAddr Methods = builtin15.MethodsVerifiedRegistry ) -type ( - RemoveDataCapProposal = verifregtypes.RemoveDataCapProposal - RemoveDataCapRequest = verifregtypes.RemoveDataCapRequest - AddVerifierParams = verifregtypes.AddVerifierParams - AddVerifiedClientParams = verifregtypes.AddVerifiedClientParams - UseBytesParams = verifregtypes.UseBytesParams - RestoreBytesParams = verifregtypes.RestoreBytesParams - RemoveDataCapParams = verifregtypes.RemoveDataCapParams - RemoveDataCapReturn = verifregtypes.RemoveDataCapReturn - RemoveExpiredAllocationsParams = verifregtypes.RemoveExpiredAllocationsParams - RemoveExpiredAllocationsReturn = verifregtypes.RemoveExpiredAllocationsReturn - BatchReturn = verifregtypes.BatchReturn - AllocationId = verifregtypes.AllocationId - ClaimId = verifregtypes.ClaimId - ClaimAllocationsParams = verifregtypes.ClaimAllocationsParams - SectorAllocationClaims = verifregtypes13.SectorAllocationClaims - AllocationClaim = verifregtypes13.AllocationClaim - ClaimAllocationsReturn = verifregtypes.ClaimAllocationsReturn - GetClaimsParams = verifregtypes.GetClaimsParams - GetClaimsReturn = verifregtypes.GetClaimsReturn - Claim = verifregtypes.Claim - Allocation = verifregtypes.Allocation - UniversalReceiverParams = verifregtypes.UniversalReceiverParams - ReceiverType = verifregtypes.ReceiverType - AllocationsResponse = verifregtypes.AllocationsResponse - ExtendClaimTermsParams = verifregtypes.ExtendClaimTermsParams - ClaimTerm = verifregtypes.ClaimTerm - ExtendClaimTermsReturn = verifregtypes.ExtendClaimTermsReturn - RemoveExpiredClaimsParams = verifregtypes.RemoveExpiredClaimsParams - RemoveExpiredClaimsReturn = verifregtypes.RemoveExpiredClaimsReturn - AllocationRequest = verifregtypes.AllocationRequest - ClaimExtensionRequest = verifregtypes.ClaimExtensionRequest - AllocationRequests = verifregtypes.AllocationRequests -) - func Load(store adt.Store, act *types.Actor) (State, error) { if name, av, ok := actors.GetActorMetaByCode(act.Code); ok { if name != manifest.VerifregKey { @@ -230,3 +187,22 @@ func AllCodes() []cid.Cid { (&state15{}).Code(), } } + +type ( + Allocation = verifregtypes.Allocation + AllocationId = verifregtypes.AllocationId + Claim = verifregtypes.Claim + ClaimId = verifregtypes.ClaimId + AllocationRequest = verifregtypes12.AllocationRequest + AllocationRequests = verifregtypes12.AllocationRequests + RemoveExpiredAllocationsParams = verifregtypes12.RemoveExpiredAllocationsParams + AddVerifierParams = verifregtypes12.AddVerifierParams + AddVerifiedClientParams = verifregtypes12.AddVerifiedClientParams +) + +const ( + NoAllocationID = verifregtypes.NoAllocationID + MinimumVerifiedAllocationTerm = verifregtypes12.MinimumVerifiedAllocationTerm + MaximumVerifiedAllocationTerm = verifregtypes12.MaximumVerifiedAllocationTerm + MaximumVerifiedAllocationExpiration = verifregtypes12.MaximumVerifiedAllocationExpiration +) diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 58252417fc1..389443ce857 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -7211,7 +7211,8 @@ Response: `"0"` ### StateMinerInitialPledgeForSector StateMinerInitialPledgeForSector returns the initial pledge collateral for a given sector duration, size, and combined size of any verified pieces within the sector. This calculation -depends on current network conditions at the given tipset. +depends on current network conditions (total power, total pledge and current rewards) at the +given tipset. Perms: read diff --git a/itests/sector_miner_collateral_test.go b/itests/sector_miner_collateral_test.go index 7bb84c2ce11..a4df47dbd1c 100644 --- a/itests/sector_miner_collateral_test.go +++ b/itests/sector_miner_collateral_test.go @@ -444,7 +444,7 @@ func TestPledgeCalculations(t *testing.T) { require.NoError(t, err) require.Equal(t, exitcode.Ok, r.Receipt.ExitCode) - tsk := r.TipSet // we're going to perform all pledge calculations at this tipset so we have consistent power outputs + tsk := r.TipSet // we're going to perform all pledge calculations at this tipset so we have consistent power, pledge, reward outputs verifyPledge := func(sectorNumber abi.SectorNumber, verifiedSize uint64) big.Int { // Compare deprecated pledge calculation that uses PreCommit with Deal information with the diff --git a/storage/pipeline/mocks/mock_commit_batcher.go b/storage/pipeline/mocks/mock_commit_batcher.go deleted file mode 100644 index 7615c0f31f2..00000000000 --- a/storage/pipeline/mocks/mock_commit_batcher.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/filecoin-project/lotus/storage/pipeline (interfaces: CommitBatcherApi) - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - - address "github.com/filecoin-project/go-address" - abi "github.com/filecoin-project/go-state-types/abi" - big "github.com/filecoin-project/go-state-types/big" - miner "github.com/filecoin-project/go-state-types/builtin/v9/miner" - verifreg "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" - network "github.com/filecoin-project/go-state-types/network" - - api "github.com/filecoin-project/lotus/api" - types "github.com/filecoin-project/lotus/chain/types" -) - -// MockCommitBatcherApi is a mock of CommitBatcherApi interface. -type MockCommitBatcherApi struct { - ctrl *gomock.Controller - recorder *MockCommitBatcherApiMockRecorder -} - -// MockCommitBatcherApiMockRecorder is the mock recorder for MockCommitBatcherApi. -type MockCommitBatcherApiMockRecorder struct { - mock *MockCommitBatcherApi -} - -// NewMockCommitBatcherApi creates a new mock instance. -func NewMockCommitBatcherApi(ctrl *gomock.Controller) *MockCommitBatcherApi { - mock := &MockCommitBatcherApi{ctrl: ctrl} - mock.recorder = &MockCommitBatcherApiMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockCommitBatcherApi) EXPECT() *MockCommitBatcherApiMockRecorder { - return m.recorder -} - -// ChainHead mocks base method. -func (m *MockCommitBatcherApi) ChainHead(arg0 context.Context) (*types.TipSet, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ChainHead", arg0) - ret0, _ := ret[0].(*types.TipSet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ChainHead indicates an expected call of ChainHead. -func (mr *MockCommitBatcherApiMockRecorder) ChainHead(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockCommitBatcherApi)(nil).ChainHead), arg0) -} - -// GasEstimateMessageGas mocks base method. -func (m *MockCommitBatcherApi) GasEstimateMessageGas(arg0 context.Context, arg1 *types.Message, arg2 *api.MessageSendSpec, arg3 types.TipSetKey) (*types.Message, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GasEstimateMessageGas", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*types.Message) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GasEstimateMessageGas indicates an expected call of GasEstimateMessageGas. -func (mr *MockCommitBatcherApiMockRecorder) GasEstimateMessageGas(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasEstimateMessageGas", reflect.TypeOf((*MockCommitBatcherApi)(nil).GasEstimateMessageGas), arg0, arg1, arg2, arg3) -} - -// MpoolPushMessage mocks base method. -func (m *MockCommitBatcherApi) MpoolPushMessage(arg0 context.Context, arg1 *types.Message, arg2 *api.MessageSendSpec) (*types.SignedMessage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MpoolPushMessage", arg0, arg1, arg2) - ret0, _ := ret[0].(*types.SignedMessage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// MpoolPushMessage indicates an expected call of MpoolPushMessage. -func (mr *MockCommitBatcherApiMockRecorder) MpoolPushMessage(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MpoolPushMessage", reflect.TypeOf((*MockCommitBatcherApi)(nil).MpoolPushMessage), arg0, arg1, arg2) -} - -// StateAccountKey mocks base method. -func (m *MockCommitBatcherApi) StateAccountKey(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateAccountKey", arg0, arg1, arg2) - ret0, _ := ret[0].(address.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateAccountKey indicates an expected call of StateAccountKey. -func (mr *MockCommitBatcherApiMockRecorder) StateAccountKey(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAccountKey", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateAccountKey), arg0, arg1, arg2) -} - -// StateGetAllocation mocks base method. -func (m *MockCommitBatcherApi) StateGetAllocation(arg0 context.Context, arg1 address.Address, arg2 verifreg.AllocationId, arg3 types.TipSetKey) (*verifreg.Allocation, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateGetAllocation", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*verifreg.Allocation) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateGetAllocation indicates an expected call of StateGetAllocation. -func (mr *MockCommitBatcherApiMockRecorder) StateGetAllocation(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetAllocation", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateGetAllocation), arg0, arg1, arg2, arg3) -} - -// StateLookupID mocks base method. -func (m *MockCommitBatcherApi) StateLookupID(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateLookupID", arg0, arg1, arg2) - ret0, _ := ret[0].(address.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateLookupID indicates an expected call of StateLookupID. -func (mr *MockCommitBatcherApiMockRecorder) StateLookupID(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupID", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateLookupID), arg0, arg1, arg2) -} - -// StateMinerAvailableBalance mocks base method. -func (m *MockCommitBatcherApi) StateMinerAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateMinerAvailableBalance", arg0, arg1, arg2) - ret0, _ := ret[0].(big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateMinerAvailableBalance indicates an expected call of StateMinerAvailableBalance. -func (mr *MockCommitBatcherApiMockRecorder) StateMinerAvailableBalance(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerAvailableBalance", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateMinerAvailableBalance), arg0, arg1, arg2) -} - -// StateMinerInfo mocks base method. -func (m *MockCommitBatcherApi) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MinerInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateMinerInfo", arg0, arg1, arg2) - ret0, _ := ret[0].(api.MinerInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateMinerInfo indicates an expected call of StateMinerInfo. -func (mr *MockCommitBatcherApiMockRecorder) StateMinerInfo(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerInfo", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateMinerInfo), arg0, arg1, arg2) -} - -// StateMinerInitialPledgeForSector mocks base method. -func (m *MockCommitBatcherApi) StateMinerInitialPledgeForSector(arg0 context.Context, arg1 abi.ChainEpoch, arg2 abi.SectorSize, arg3 uint64, arg4 types.TipSetKey) (big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateMinerInitialPledgeForSector", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateMinerInitialPledgeForSector indicates an expected call of StateMinerInitialPledgeForSector. -func (mr *MockCommitBatcherApiMockRecorder) StateMinerInitialPledgeForSector(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerInitialPledgeForSector", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateMinerInitialPledgeForSector), arg0, arg1, arg2, arg3, arg4) -} - -// StateNetworkVersion mocks base method. -func (m *MockCommitBatcherApi) StateNetworkVersion(arg0 context.Context, arg1 types.TipSetKey) (network.Version, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateNetworkVersion", arg0, arg1) - ret0, _ := ret[0].(network.Version) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateNetworkVersion indicates an expected call of StateNetworkVersion. -func (mr *MockCommitBatcherApiMockRecorder) StateNetworkVersion(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateNetworkVersion", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateNetworkVersion), arg0, arg1) -} - -// StateSectorPreCommitInfo mocks base method. -func (m *MockCommitBatcherApi) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateSectorPreCommitInfo", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*miner.SectorPreCommitOnChainInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateSectorPreCommitInfo indicates an expected call of StateSectorPreCommitInfo. -func (mr *MockCommitBatcherApiMockRecorder) StateSectorPreCommitInfo(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateSectorPreCommitInfo", reflect.TypeOf((*MockCommitBatcherApi)(nil).StateSectorPreCommitInfo), arg0, arg1, arg2, arg3) -} - -// WalletBalance mocks base method. -func (m *MockCommitBatcherApi) WalletBalance(arg0 context.Context, arg1 address.Address) (big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WalletBalance", arg0, arg1) - ret0, _ := ret[0].(big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// WalletBalance indicates an expected call of WalletBalance. -func (mr *MockCommitBatcherApiMockRecorder) WalletBalance(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletBalance", reflect.TypeOf((*MockCommitBatcherApi)(nil).WalletBalance), arg0, arg1) -} - -// WalletHas mocks base method. -func (m *MockCommitBatcherApi) WalletHas(arg0 context.Context, arg1 address.Address) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WalletHas", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// WalletHas indicates an expected call of WalletHas. -func (mr *MockCommitBatcherApiMockRecorder) WalletHas(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WalletHas", reflect.TypeOf((*MockCommitBatcherApi)(nil).WalletHas), arg0, arg1) -}