lotus/storage/sealer/storiface/cbor_gen.go
Łukasz Magiera 6a0f16b084 feat: sealing: Support nv22 DDO features in the sealing pipeline (#11226)
* 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>
2024-03-22 07:00:28 +01:00

477 lines
9.1 KiB
Go

// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT.
package storiface
import (
"fmt"
"io"
"math"
"sort"
cid "github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
xerrors "golang.org/x/xerrors"
)
var _ = xerrors.Errorf
var _ = cid.Undef
var _ = math.E
var _ = sort.Sort
func (t *CallID) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{162}); err != nil {
return err
}
// t.ID (uuid.UUID) (array)
if len("ID") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"ID\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ID"))); err != nil {
return err
}
if _, err := cw.WriteString(string("ID")); err != nil {
return err
}
if len(t.ID) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.ID was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.ID))); err != nil {
return err
}
if _, err := cw.Write(t.ID[:]); err != nil {
return err
}
// t.Sector (abi.SectorID) (struct)
if len("Sector") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"Sector\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Sector"))); err != nil {
return err
}
if _, err := cw.WriteString(string("Sector")); err != nil {
return err
}
if err := t.Sector.MarshalCBOR(cw); err != nil {
return err
}
return nil
}
func (t *CallID) UnmarshalCBOR(r io.Reader) (err error) {
*t = CallID{}
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.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra > cbg.MaxLength {
return fmt.Errorf("CallID: map struct too large (%d)", extra)
}
var name string
n := extra
for i := uint64(0); i < n; i++ {
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
name = string(sval)
}
switch name {
// t.ID (uuid.UUID) (array)
case "ID":
maj, extra, err = cr.ReadHeader()
if err != nil {
return err
}
if extra > cbg.ByteArrayMaxLen {
return fmt.Errorf("t.ID: byte array too large (%d)", extra)
}
if maj != cbg.MajByteString {
return fmt.Errorf("expected byte array")
}
if extra != 16 {
return fmt.Errorf("expected array to have 16 elements")
}
t.ID = [16]uint8{}
if _, err := io.ReadFull(cr, t.ID[:]); err != nil {
return err
}
// t.Sector (abi.SectorID) (struct)
case "Sector":
{
if err := t.Sector.UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.Sector: %w", err)
}
}
default:
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
return nil
}
func (t *SecDataHttpHeader) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{162}); err != nil {
return err
}
// t.Key (string) (string)
if len("Key") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"Key\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Key"))); err != nil {
return err
}
if _, err := cw.WriteString(string("Key")); err != nil {
return err
}
if len(t.Key) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.Key was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil {
return err
}
if _, err := cw.WriteString(string(t.Key)); err != nil {
return err
}
// t.Value (string) (string)
if len("Value") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"Value\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Value"))); err != nil {
return err
}
if _, err := cw.WriteString(string("Value")); err != nil {
return err
}
if len(t.Value) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.Value was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil {
return err
}
if _, err := cw.WriteString(string(t.Value)); err != nil {
return err
}
return nil
}
func (t *SecDataHttpHeader) UnmarshalCBOR(r io.Reader) (err error) {
*t = SecDataHttpHeader{}
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.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra > cbg.MaxLength {
return fmt.Errorf("SecDataHttpHeader: map struct too large (%d)", extra)
}
var name string
n := extra
for i := uint64(0); i < n; i++ {
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
name = string(sval)
}
switch name {
// t.Key (string) (string)
case "Key":
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
t.Key = string(sval)
}
// t.Value (string) (string)
case "Value":
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
t.Value = string(sval)
}
default:
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
return nil
}
func (t *SectorLocation) MarshalCBOR(w io.Writer) error {
if t == nil {
_, err := w.Write(cbg.CborNull)
return err
}
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{163}); err != nil {
return err
}
// t.URL (string) (string)
if len("URL") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"URL\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("URL"))); err != nil {
return err
}
if _, err := cw.WriteString(string("URL")); err != nil {
return err
}
if len(t.URL) > cbg.MaxLength {
return xerrors.Errorf("Value in field t.URL was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.URL))); err != nil {
return err
}
if _, err := cw.WriteString(string(t.URL)); err != nil {
return err
}
// t.Local (bool) (bool)
if len("Local") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"Local\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Local"))); err != nil {
return err
}
if _, err := cw.WriteString(string("Local")); err != nil {
return err
}
if err := cbg.WriteBool(w, t.Local); err != nil {
return err
}
// t.Headers ([]storiface.SecDataHttpHeader) (slice)
if len("Headers") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"Headers\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Headers"))); err != nil {
return err
}
if _, err := cw.WriteString(string("Headers")); err != nil {
return err
}
if len(t.Headers) > cbg.MaxLength {
return xerrors.Errorf("Slice value in field t.Headers was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Headers))); err != nil {
return err
}
for _, v := range t.Headers {
if err := v.MarshalCBOR(cw); err != nil {
return err
}
}
return nil
}
func (t *SectorLocation) UnmarshalCBOR(r io.Reader) (err error) {
*t = SectorLocation{}
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.MajMap {
return fmt.Errorf("cbor input should be of type map")
}
if extra > cbg.MaxLength {
return fmt.Errorf("SectorLocation: map struct too large (%d)", extra)
}
var name string
n := extra
for i := uint64(0); i < n; i++ {
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
name = string(sval)
}
switch name {
// t.URL (string) (string)
case "URL":
{
sval, err := cbg.ReadString(cr)
if err != nil {
return err
}
t.URL = string(sval)
}
// t.Local (bool) (bool)
case "Local":
maj, extra, err = cr.ReadHeader()
if err != nil {
return err
}
if maj != cbg.MajOther {
return fmt.Errorf("booleans must be major type 7")
}
switch extra {
case 20:
t.Local = false
case 21:
t.Local = true
default:
return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra)
}
// t.Headers ([]storiface.SecDataHttpHeader) (slice)
case "Headers":
maj, extra, err = cr.ReadHeader()
if err != nil {
return err
}
if extra > cbg.MaxLength {
return fmt.Errorf("t.Headers: array too large (%d)", extra)
}
if maj != cbg.MajArray {
return fmt.Errorf("expected cbor array")
}
if extra > 0 {
t.Headers = make([]SecDataHttpHeader, extra)
}
for i := 0; i < int(extra); i++ {
{
var maj byte
var extra uint64
var err error
_ = maj
_ = extra
_ = err
{
if err := t.Headers[i].UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.Headers[i]: %w", err)
}
}
}
}
default:
// Field doesn't exist on this type, so ignore it
cbg.ScanForLinks(r, func(cid.Cid) {})
}
}
return nil
}