diff --git a/chain/deals/client.go b/chain/deals/client.go index 9346f2905..946e6cb93 100644 --- a/chain/deals/client.go +++ b/chain/deals/client.go @@ -74,6 +74,11 @@ type clientDealUpdate struct { mut func(*ClientDeal) } +type clientApi struct { + full.ChainAPI + full.StateAPI +} + func NewClient(sm *stmgr.StateManager, chain *store.ChainStore, h host.Host, w *wallet.Wallet, dag dtypes.ClientDAG, dataTransfer dtypes.ClientDataTransfer, discovery *discovery.Local, fm *market.FundMgr, deals dtypes.ClientDealStore, chainapi full.ChainAPI, stateapi full.StateAPI) *Client { c := &Client{ sm: sm, @@ -84,7 +89,7 @@ func NewClient(sm *stmgr.StateManager, chain *store.ChainStore, h host.Host, w * dag: dag, discovery: discovery, fm: fm, - events: events.NewEvents(context.TODO(), &struct {full.ChainAPI; full.StateAPI}{chainapi, stateapi}), + events: events.NewEvents(context.TODO(), &clientApi{chainapi, stateapi}), deals: deals, conns: map[cid.Cid]inet.Stream{}, diff --git a/chain/events/utils.go b/chain/events/utils.go index 3dd34a1db..13d620da8 100644 --- a/chain/events/utils.go +++ b/chain/events/utils.go @@ -3,6 +3,8 @@ package events import ( "context" + "golang.org/x/xerrors" + "github.com/filecoin-project/lotus/chain/types" ) @@ -30,6 +32,10 @@ func (e *calledEvents) CheckMsg(ctx context.Context, msg *types.Message, hnd Cal func(e *calledEvents) MatchMsg(inmsg *types.Message) MatchFunc { return func(msg *types.Message) (bool, error) { + if msg.From == inmsg.From && msg.Nonce == inmsg.Nonce && !inmsg.Equals(msg) { + return false, xerrors.Errorf("matching msg %s from %s, nonce %d: got duplicate origin/nonce msg %s", inmsg.Cid(), inmsg.From, inmsg.Nonce, msg.Nonce) + } + return inmsg.Equals(msg), nil } } diff --git a/storage/miner.go b/storage/miner.go index c2ebb0570..fe0839467 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -55,7 +55,7 @@ type storageMinerApi interface { StateMinerSectors(context.Context, address.Address, *types.TipSet) ([]*api.ChainSectorInfo, error) StateMinerProvingSet(context.Context, address.Address, *types.TipSet) ([]*api.ChainSectorInfo, error) StateMinerSectorSize(context.Context, address.Address, *types.TipSet) (uint64, error) - StateWaitMsg(context.Context, cid.Cid) (*api.MsgWait, error) // TODO: removeme + StateWaitMsg(context.Context, cid.Cid) (*api.MsgWait, error) // TODO: removeme eventually StateGetActor(ctx context.Context, actor address.Address, ts *types.TipSet) (*types.Actor, error) StateGetReceipt(context.Context, cid.Cid, *types.TipSet) (*types.MessageReceipt, error)