diff --git a/api/api_full.go b/api/api_full.go index ceeceb05b..45ec2299e 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -26,8 +26,6 @@ import ( type FullNode interface { Common - // TODO: TipSetKeys - // MethodGroup: Chain // The Chain method group contains methods for interacting with the // blockchain, but that do not require any form of state computation. @@ -320,10 +318,9 @@ type FullNode interface { // , , MsigApprove(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) // MsigCancel cancels a previously-proposed multisig message - // It takes the following params: , , , , , + // It takes the following params: , , , , // , , - // TODO: You can't cancel someone else's proposed message, so "src" and "proposer" here are redundant - MsigCancel(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) + MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) MarketEnsureAvailable(context.Context, address.Address, address.Address, types.BigInt) (cid.Cid, error) // MarketFreeBalance @@ -380,8 +377,8 @@ type DealInfo struct { type MsgLookup struct { Receipt types.MessageReceipt ReturnDec interface{} - // TODO: This should probably a tipsetkey? - TipSet *types.TipSet + TipSet types.TipSetKey + Height abi.ChainEpoch } type BlockMessages struct { diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index d3b109666..fb7ed50e8 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -161,7 +161,7 @@ type FullNodeStruct struct { MsigCreate func(context.Context, int64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) `perm:"sign"` MsigPropose func(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` MsigApprove func(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` - MsigCancel func(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` + MsigCancel func(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` MarketEnsureAvailable func(context.Context, address.Address, address.Address, types.BigInt) (cid.Cid, error) `perm:"sign"` @@ -704,8 +704,8 @@ func (c *FullNodeStruct) MsigApprove(ctx context.Context, msig address.Address, return c.Internal.MsigApprove(ctx, msig, txID, proposer, to, amt, src, method, params) } -func (c *FullNodeStruct) MsigCancel(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { - return c.Internal.MsigCancel(ctx, msig, txID, proposer, to, amt, src, method, params) +func (c *FullNodeStruct) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { + return c.Internal.MsigCancel(ctx, msig, txID, to, amt, src, method, params) } func (c *FullNodeStruct) MarketEnsureAvailable(ctx context.Context, addr, wallet address.Address, amt types.BigInt) (cid.Cid, error) { diff --git a/cli/state.go b/cli/state.go index da4a201d5..bdc944f46 100644 --- a/cli/state.go +++ b/cli/state.go @@ -337,7 +337,11 @@ var stateReplaySetCmd = &cli.Command{ return xerrors.Errorf("finding message in chain: %w", err) } - ts, err = fapi.ChainGetTipSet(ctx, r.TipSet.Parents()) + childTs, err := fapi.ChainGetTipSet(ctx, r.TipSet) + if err != nil { + return xerrors.Errorf("loading tipset: %w", err) + } + ts, err = fapi.ChainGetTipSet(ctx, childTs.Parents()) } if err != nil { return err diff --git a/node/impl/full/multisig.go b/node/impl/full/multisig.go index 2fe123621..7d450da2e 100644 --- a/node/impl/full/multisig.go +++ b/node/impl/full/multisig.go @@ -139,8 +139,8 @@ func (a *MsigAPI) MsigApprove(ctx context.Context, msig address.Address, txID ui return a.msigApproveOrCancel(ctx, api.MsigApprove, msig, txID, proposer, to, amt, src, method, params) } -func (a *MsigAPI) MsigCancel(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { - return a.msigApproveOrCancel(ctx, api.MsigCancel, msig, txID, proposer, to, amt, src, method, params) +func (a *MsigAPI) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { + return a.msigApproveOrCancel(ctx, api.MsigCancel, msig, txID, src, to, amt, src, method, params) } func (a *MsigAPI) msigApproveOrCancel(ctx context.Context, operation api.MsigProposeResponse, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 179267944..fd33d06b1 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -385,7 +385,8 @@ func (a *StateAPI) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uin return &api.MsgLookup{ Receipt: *recpt, ReturnDec: returndec, - TipSet: ts, + TipSet: ts.Key(), + Height: ts.Height(), }, nil } @@ -398,7 +399,8 @@ func (a *StateAPI) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLoo if ts != nil { return &api.MsgLookup{ Receipt: *recpt, - TipSet: ts, + TipSet: ts.Key(), + Height: ts.Height(), }, nil } else { return nil, nil diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go index 5fc811997..bb5f74840 100644 --- a/storage/adapter_storage_miner.go +++ b/storage/adapter_storage_miner.go @@ -93,8 +93,8 @@ func (s SealingAPIAdapter) StateWaitMsg(ctx context.Context, mcid cid.Cid) (seal Return: wmsg.Receipt.Return, GasUsed: wmsg.Receipt.GasUsed, }, - TipSetTok: wmsg.TipSet.Key().Bytes(), - Height: wmsg.TipSet.Height(), + TipSetTok: wmsg.TipSet.Bytes(), + Height: wmsg.Height, }, nil }