9e03fcab83
* Initial work supporting DDO pieces in lotus-miner * sealing: Update pipeline input to operate on UniversalPiece * sealing: Update pipeline checks/sealing states to operate on UniversalPiece * sealing: Make pipeline build with UniversalPiece * move PieceDealInfo out of api * make gen * make sealing pipeline unit tests pass * fix itest ensemble build * don't panic in SectorsStatus with deals * stop linter from complaining about checkPieces * fix sector import tests * mod tidy * sealing: Add logic for (pre)committing DDO sectors * sealing: state-types with method defs * DDO non-snap pipeline works(?), DDO Itests * DDO support in snapdeals pipeline * make gen * update actor bundles * update the gst market fix * fix: chain: use PreCommitSectorsBatch2 when setting up genesis * some bug fixes * integration working changes * update actor bundles * Make TestOnboardRawPieceSnap pass * Appease the linter * Make deadlines test pass with v12 actors * Update go-state-types, abstract market DealState * make gen * mod tidy, lint fixes * Fix some more tests * Bump version in master Bump version in master * Make gen Make gen * fix sender * fix: lotus-provider: Fix winning PoSt * fix: sql Scan cannot write to an object * Actually show miner-addrs in info-log Actually show miner-addrs in lotus-provider info-log * [WIP] feat: Add nv22 skeleton Addition of Network Version 22 skeleton * update FFI * ddo is now nv22 * make gen * temp actor bundle with ddo * use working go-state-types * gst with v13 market migration * update bundle, builtin.MethodsMiner.ProveCommitSectors2 -> 3 * actually working v13 migration, v13 migration itest * Address review * sealing: Correct DDO snap pledge math * itests: Mixed ddo itest * pipeline: Fix sectorWeight * sealing: convert market deals into PAMs in mixed sectors * sealing: make market to ddo conversion work * fix lint * update gst * Update actors and GST to lastest integ branch * commit batcher: Update ProveCommitSectors3Params builder logic * make gen * use builtin-actors master * ddo: address review * itests: Add commd assertions to ddo tests * make gen * gst with fixed types * config knobs for RequireActivationSuccess * storage: Drop obsolete flaky tasts --------- Co-authored-by: Jennifer Wang <jiayingw703@gmail.com> Co-authored-by: Aayush <arajasek94@gmail.com> Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai> Co-authored-by: Phi <orjan.roren@gmail.com> Co-authored-by: Andrew Jackson (Ajax) <snadrus@gmail.com> Co-authored-by: TippyFlits <james.bluett@protocol.ai>
712 lines
13 KiB
Go
712 lines
13 KiB
Go
// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
|
|
|
|
package exchange
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"math"
|
|
"sort"
|
|
|
|
cid "github.com/ipfs/go-cid"
|
|
cbg "github.com/whyrusleeping/cbor-gen"
|
|
xerrors "golang.org/x/xerrors"
|
|
|
|
types "github.com/filecoin-project/lotus/chain/types"
|
|
)
|
|
|
|
var _ = xerrors.Errorf
|
|
var _ = cid.Undef
|
|
var _ = math.E
|
|
var _ = sort.Sort
|
|
|
|
var lengthBufRequest = []byte{131}
|
|
|
|
func (t *Request) MarshalCBOR(w io.Writer) error {
|
|
if t == nil {
|
|
_, err := w.Write(cbg.CborNull)
|
|
return err
|
|
}
|
|
|
|
cw := cbg.NewCborWriter(w)
|
|
|
|
if _, err := cw.Write(lengthBufRequest); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.Head ([]cid.Cid) (slice)
|
|
if len(t.Head) > cbg.MaxLength {
|
|
return xerrors.Errorf("Slice value in field t.Head was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Head))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.Head {
|
|
|
|
if err := cbg.WriteCid(cw, v); err != nil {
|
|
return xerrors.Errorf("failed to write cid field v: %w", err)
|
|
}
|
|
|
|
}
|
|
|
|
// t.Length (uint64) (uint64)
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Length)); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.Options (uint64) (uint64)
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Options)); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (t *Request) UnmarshalCBOR(r io.Reader) (err error) {
|
|
*t = Request{}
|
|
|
|
cr := cbg.NewCborReader(r)
|
|
|
|
maj, extra, err := cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
if err == io.EOF {
|
|
err = io.ErrUnexpectedEOF
|
|
}
|
|
}()
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("cbor input should be of type array")
|
|
}
|
|
|
|
if extra != 3 {
|
|
return fmt.Errorf("cbor input had wrong number of fields")
|
|
}
|
|
|
|
// t.Head ([]cid.Cid) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > cbg.MaxLength {
|
|
return fmt.Errorf("t.Head: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.Head = make([]cid.Cid, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
c, err := cbg.ReadCid(cr)
|
|
if err != nil {
|
|
return xerrors.Errorf("failed to read cid field t.Head[i]: %w", err)
|
|
}
|
|
|
|
t.Head[i] = c
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
// t.Length (uint64) (uint64)
|
|
|
|
{
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if maj != cbg.MajUnsignedInt {
|
|
return fmt.Errorf("wrong type for uint64 field")
|
|
}
|
|
t.Length = uint64(extra)
|
|
|
|
}
|
|
// t.Options (uint64) (uint64)
|
|
|
|
{
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if maj != cbg.MajUnsignedInt {
|
|
return fmt.Errorf("wrong type for uint64 field")
|
|
}
|
|
t.Options = uint64(extra)
|
|
|
|
}
|
|
return nil
|
|
}
|
|
|
|
var lengthBufResponse = []byte{131}
|
|
|
|
func (t *Response) MarshalCBOR(w io.Writer) error {
|
|
if t == nil {
|
|
_, err := w.Write(cbg.CborNull)
|
|
return err
|
|
}
|
|
|
|
cw := cbg.NewCborWriter(w)
|
|
|
|
if _, err := cw.Write(lengthBufResponse); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.Status (exchange.status) (uint64)
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Status)); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.ErrorMessage (string) (string)
|
|
if len(t.ErrorMessage) > cbg.MaxLength {
|
|
return xerrors.Errorf("Value in field t.ErrorMessage was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ErrorMessage))); err != nil {
|
|
return err
|
|
}
|
|
if _, err := cw.WriteString(string(t.ErrorMessage)); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.Chain ([]*exchange.BSTipSet) (slice)
|
|
if len(t.Chain) > cbg.MaxLength {
|
|
return xerrors.Errorf("Slice value in field t.Chain was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Chain))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.Chain {
|
|
if err := v.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (t *Response) UnmarshalCBOR(r io.Reader) (err error) {
|
|
*t = Response{}
|
|
|
|
cr := cbg.NewCborReader(r)
|
|
|
|
maj, extra, err := cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
if err == io.EOF {
|
|
err = io.ErrUnexpectedEOF
|
|
}
|
|
}()
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("cbor input should be of type array")
|
|
}
|
|
|
|
if extra != 3 {
|
|
return fmt.Errorf("cbor input had wrong number of fields")
|
|
}
|
|
|
|
// t.Status (exchange.status) (uint64)
|
|
|
|
{
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if maj != cbg.MajUnsignedInt {
|
|
return fmt.Errorf("wrong type for uint64 field")
|
|
}
|
|
t.Status = status(extra)
|
|
|
|
}
|
|
// t.ErrorMessage (string) (string)
|
|
|
|
{
|
|
sval, err := cbg.ReadString(cr)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
t.ErrorMessage = string(sval)
|
|
}
|
|
// t.Chain ([]*exchange.BSTipSet) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > cbg.MaxLength {
|
|
return fmt.Errorf("t.Chain: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.Chain = make([]*BSTipSet, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
b, err := cr.ReadByte()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if b != cbg.CborNull[0] {
|
|
if err := cr.UnreadByte(); err != nil {
|
|
return err
|
|
}
|
|
t.Chain[i] = new(BSTipSet)
|
|
if err := t.Chain[i].UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.Chain[i] pointer: %w", err)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
var lengthBufCompactedMessagesCBOR = []byte{132}
|
|
|
|
func (t *CompactedMessagesCBOR) MarshalCBOR(w io.Writer) error {
|
|
if t == nil {
|
|
_, err := w.Write(cbg.CborNull)
|
|
return err
|
|
}
|
|
|
|
cw := cbg.NewCborWriter(w)
|
|
|
|
if _, err := cw.Write(lengthBufCompactedMessagesCBOR); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.Bls ([]*types.Message) (slice)
|
|
if len(t.Bls) > 150000 {
|
|
return xerrors.Errorf("Slice value in field t.Bls was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Bls))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.Bls {
|
|
if err := v.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
|
|
// t.BlsIncludes ([]exchange.messageIndices) (slice)
|
|
if len(t.BlsIncludes) > cbg.MaxLength {
|
|
return xerrors.Errorf("Slice value in field t.BlsIncludes was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.BlsIncludes))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.BlsIncludes {
|
|
if err := v.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
|
|
// t.Secpk ([]*types.SignedMessage) (slice)
|
|
if len(t.Secpk) > 150000 {
|
|
return xerrors.Errorf("Slice value in field t.Secpk was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Secpk))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.Secpk {
|
|
if err := v.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
|
|
// t.SecpkIncludes ([]exchange.messageIndices) (slice)
|
|
if len(t.SecpkIncludes) > cbg.MaxLength {
|
|
return xerrors.Errorf("Slice value in field t.SecpkIncludes was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.SecpkIncludes))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.SecpkIncludes {
|
|
if err := v.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (t *CompactedMessagesCBOR) UnmarshalCBOR(r io.Reader) (err error) {
|
|
*t = CompactedMessagesCBOR{}
|
|
|
|
cr := cbg.NewCborReader(r)
|
|
|
|
maj, extra, err := cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
if err == io.EOF {
|
|
err = io.ErrUnexpectedEOF
|
|
}
|
|
}()
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("cbor input should be of type array")
|
|
}
|
|
|
|
if extra != 4 {
|
|
return fmt.Errorf("cbor input had wrong number of fields")
|
|
}
|
|
|
|
// t.Bls ([]*types.Message) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > 150000 {
|
|
return fmt.Errorf("t.Bls: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.Bls = make([]*types.Message, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
b, err := cr.ReadByte()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if b != cbg.CborNull[0] {
|
|
if err := cr.UnreadByte(); err != nil {
|
|
return err
|
|
}
|
|
t.Bls[i] = new(types.Message)
|
|
if err := t.Bls[i].UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.Bls[i] pointer: %w", err)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
// t.BlsIncludes ([]exchange.messageIndices) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > cbg.MaxLength {
|
|
return fmt.Errorf("t.BlsIncludes: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.BlsIncludes = make([]messageIndices, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
if err := t.BlsIncludes[i].UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.BlsIncludes[i]: %w", err)
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
// t.Secpk ([]*types.SignedMessage) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > 150000 {
|
|
return fmt.Errorf("t.Secpk: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.Secpk = make([]*types.SignedMessage, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
b, err := cr.ReadByte()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if b != cbg.CborNull[0] {
|
|
if err := cr.UnreadByte(); err != nil {
|
|
return err
|
|
}
|
|
t.Secpk[i] = new(types.SignedMessage)
|
|
if err := t.Secpk[i].UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.Secpk[i] pointer: %w", err)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
// t.SecpkIncludes ([]exchange.messageIndices) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > cbg.MaxLength {
|
|
return fmt.Errorf("t.SecpkIncludes: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.SecpkIncludes = make([]messageIndices, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
if err := t.SecpkIncludes[i].UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.SecpkIncludes[i]: %w", err)
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
var lengthBufBSTipSet = []byte{130}
|
|
|
|
func (t *BSTipSet) MarshalCBOR(w io.Writer) error {
|
|
if t == nil {
|
|
_, err := w.Write(cbg.CborNull)
|
|
return err
|
|
}
|
|
|
|
cw := cbg.NewCborWriter(w)
|
|
|
|
if _, err := cw.Write(lengthBufBSTipSet); err != nil {
|
|
return err
|
|
}
|
|
|
|
// t.Blocks ([]*types.BlockHeader) (slice)
|
|
if len(t.Blocks) > cbg.MaxLength {
|
|
return xerrors.Errorf("Slice value in field t.Blocks was too long")
|
|
}
|
|
|
|
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Blocks))); err != nil {
|
|
return err
|
|
}
|
|
for _, v := range t.Blocks {
|
|
if err := v.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
|
|
// t.Messages (exchange.CompactedMessages) (struct)
|
|
if err := t.Messages.MarshalCBOR(cw); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (t *BSTipSet) UnmarshalCBOR(r io.Reader) (err error) {
|
|
*t = BSTipSet{}
|
|
|
|
cr := cbg.NewCborReader(r)
|
|
|
|
maj, extra, err := cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
defer func() {
|
|
if err == io.EOF {
|
|
err = io.ErrUnexpectedEOF
|
|
}
|
|
}()
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("cbor input should be of type array")
|
|
}
|
|
|
|
if extra != 2 {
|
|
return fmt.Errorf("cbor input had wrong number of fields")
|
|
}
|
|
|
|
// t.Blocks ([]*types.BlockHeader) (slice)
|
|
|
|
maj, extra, err = cr.ReadHeader()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if extra > cbg.MaxLength {
|
|
return fmt.Errorf("t.Blocks: array too large (%d)", extra)
|
|
}
|
|
|
|
if maj != cbg.MajArray {
|
|
return fmt.Errorf("expected cbor array")
|
|
}
|
|
|
|
if extra > 0 {
|
|
t.Blocks = make([]*types.BlockHeader, extra)
|
|
}
|
|
|
|
for i := 0; i < int(extra); i++ {
|
|
{
|
|
var maj byte
|
|
var extra uint64
|
|
var err error
|
|
_ = maj
|
|
_ = extra
|
|
_ = err
|
|
|
|
{
|
|
|
|
b, err := cr.ReadByte()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if b != cbg.CborNull[0] {
|
|
if err := cr.UnreadByte(); err != nil {
|
|
return err
|
|
}
|
|
t.Blocks[i] = new(types.BlockHeader)
|
|
if err := t.Blocks[i].UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.Blocks[i] pointer: %w", err)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
// t.Messages (exchange.CompactedMessages) (struct)
|
|
|
|
{
|
|
|
|
b, err := cr.ReadByte()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if b != cbg.CborNull[0] {
|
|
if err := cr.UnreadByte(); err != nil {
|
|
return err
|
|
}
|
|
t.Messages = new(CompactedMessages)
|
|
if err := t.Messages.UnmarshalCBOR(cr); err != nil {
|
|
return xerrors.Errorf("unmarshaling t.Messages pointer: %w", err)
|
|
}
|
|
}
|
|
|
|
}
|
|
return nil
|
|
}
|