From a055f359d0d12fe951e8aedaf6ea0e1a59f4c718 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Wed, 7 Feb 2024 11:48:41 +1100 Subject: [PATCH] Update for cbor-gen with nullable ints and without globals --- abi/cbor_bytes.go | 2 +- abi/cbor_string.go | 2 +- builtin/v10/account/cbor_gen.go | 8 +- builtin/v10/cron/cbor_gen.go | 4 +- builtin/v10/datacap/cbor_gen.go | 24 +-- builtin/v10/eam/cbor_gen.go | 24 +-- builtin/v10/evm/cbor_gen.go | 24 +-- builtin/v10/init/cbor_gen.go | 20 +- builtin/v10/market/cbor_gen.go | 74 ++++---- builtin/v10/miner/cbor_gen.go | 222 +++++++++++----------- builtin/v10/multisig/cbor_gen.go | 58 +++--- builtin/v10/paych/cbor_gen.go | 26 +-- builtin/v10/power/cbor_gen.go | 50 ++--- builtin/v10/reward/cbor_gen.go | 6 +- builtin/v10/verifreg/cbor_gen.go | 82 ++++----- builtin/v11/account/cbor_gen.go | 8 +- builtin/v11/cron/cbor_gen.go | 4 +- builtin/v11/datacap/cbor_gen.go | 24 +-- builtin/v11/eam/cbor_gen.go | 24 +-- builtin/v11/evm/cbor_gen.go | 24 +-- builtin/v11/init/cbor_gen.go | 20 +- builtin/v11/market/cbor_gen.go | 74 ++++---- builtin/v11/miner/cbor_gen.go | 222 +++++++++++----------- builtin/v11/multisig/cbor_gen.go | 58 +++--- builtin/v11/paych/cbor_gen.go | 26 +-- builtin/v11/power/cbor_gen.go | 50 ++--- builtin/v11/reward/cbor_gen.go | 6 +- builtin/v11/verifreg/cbor_gen.go | 82 ++++----- builtin/v12/account/cbor_gen.go | 8 +- builtin/v12/cron/cbor_gen.go | 4 +- builtin/v12/datacap/cbor_gen.go | 24 +-- builtin/v12/eam/cbor_gen.go | 24 +-- builtin/v12/evm/cbor_gen.go | 24 +-- builtin/v12/init/cbor_gen.go | 20 +- builtin/v12/market/cbor_gen.go | 66 +++---- builtin/v12/miner/cbor_gen.go | 222 +++++++++++----------- builtin/v12/multisig/cbor_gen.go | 58 +++--- builtin/v12/paych/cbor_gen.go | 26 +-- builtin/v12/power/cbor_gen.go | 50 ++--- builtin/v12/reward/cbor_gen.go | 6 +- builtin/v12/verifreg/cbor_gen.go | 82 ++++----- builtin/v13/account/cbor_gen.go | 8 +- builtin/v13/cron/cbor_gen.go | 4 +- builtin/v13/datacap/cbor_gen.go | 24 +-- builtin/v13/eam/cbor_gen.go | 24 +-- builtin/v13/evm/cbor_gen.go | 24 +-- builtin/v13/init/cbor_gen.go | 20 +- builtin/v13/market/cbor_gen.go | 70 +++---- builtin/v13/miner/cbor_gen.go | 304 +++++++++++++++---------------- builtin/v13/multisig/cbor_gen.go | 58 +++--- builtin/v13/paych/cbor_gen.go | 26 +-- builtin/v13/power/cbor_gen.go | 50 ++--- builtin/v13/reward/cbor_gen.go | 6 +- builtin/v13/verifreg/cbor_gen.go | 82 ++++----- builtin/v8/cron/cbor_gen.go | 4 +- builtin/v8/init/cbor_gen.go | 12 +- builtin/v8/market/cbor_gen.go | 60 +++--- builtin/v8/miner/cbor_gen.go | 172 ++++++++--------- builtin/v8/multisig/cbor_gen.go | 58 +++--- builtin/v8/paych/cbor_gen.go | 26 +-- builtin/v8/power/cbor_gen.go | 50 ++--- builtin/v8/reward/cbor_gen.go | 6 +- builtin/v9/account/cbor_gen.go | 8 +- builtin/v9/cron/cbor_gen.go | 4 +- builtin/v9/datacap/cbor_gen.go | 24 +-- builtin/v9/init/cbor_gen.go | 12 +- builtin/v9/market/cbor_gen.go | 66 +++---- builtin/v9/miner/cbor_gen.go | 214 +++++++++++----------- builtin/v9/multisig/cbor_gen.go | 58 +++--- builtin/v9/paych/cbor_gen.go | 26 +-- builtin/v9/power/cbor_gen.go | 50 ++--- builtin/v9/reward/cbor_gen.go | 6 +- builtin/v9/verifreg/cbor_gen.go | 82 ++++----- go.mod | 14 +- go.sum | 30 ++- 75 files changed, 1776 insertions(+), 1768 deletions(-) diff --git a/abi/cbor_bytes.go b/abi/cbor_bytes.go index 7ffddc7f..f3acf177 100644 --- a/abi/cbor_bytes.go +++ b/abi/cbor_bytes.go @@ -11,7 +11,7 @@ import ( type CborBytes []byte func (t *CborBytes) MarshalCBOR(w io.Writer) error { - if uint64(len(*t)) > cbg.ByteArrayMaxLen { + if len(*t) > cbg.ByteArrayMaxLen { return xerrors.Errorf("byte array was too long") } diff --git a/abi/cbor_string.go b/abi/cbor_string.go index 72c9181a..e3d316f7 100644 --- a/abi/cbor_string.go +++ b/abi/cbor_string.go @@ -13,7 +13,7 @@ type CborString string func (t *CborString) MarshalCBOR(w io.Writer) error { scratch := make([]byte, 8) - if uint64(len(*t)) > cbg.MaxLength { + if len(*t) > cbg.MaxLength { return xerrors.Errorf("Value in t was too long") } diff --git a/builtin/v10/account/cbor_gen.go b/builtin/v10/account/cbor_gen.go index 0bd09be2..55e97f33 100644 --- a/builtin/v10/account/cbor_gen.go +++ b/builtin/v10/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { + if len(t.Signature) > 2097152 { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { + if len(t.Message) > 2097152 { return xerrors.Errorf("Byte array in field t.Message was too long") } @@ -147,7 +147,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Signature: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -169,7 +169,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Message: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/cron/cbor_gen.go b/builtin/v10/cron/cbor_gen.go index 73deb41d..b00c94d4 100644 --- a/builtin/v10/cron/cbor_gen.go +++ b/builtin/v10/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if uint64(len(t.Entries)) > cbg.MaxLength { + if len(t.Entries) > 8192 { return xerrors.Errorf("Slice value in field t.Entries was too long") } @@ -80,7 +80,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Entries: array too large (%d)", extra) } diff --git a/builtin/v10/datacap/cbor_gen.go b/builtin/v10/datacap/cbor_gen.go index 42c936a6..11e7cbb1 100644 --- a/builtin/v10/datacap/cbor_gen.go +++ b/builtin/v10/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if uint64(len(t.Operators)) > cbg.MaxLength { + if len(t.Operators) > 8192 { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -291,7 +291,7 @@ func (t *MintParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Operators: array too large (%d)", extra) } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -413,7 +413,7 @@ func (t *MintReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -589,7 +589,7 @@ func (t *TransferParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -695,7 +695,7 @@ func (t *TransferReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -815,7 +815,7 @@ func (t *TransferFromParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -935,7 +935,7 @@ func (t *TransferFromReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/eam/cbor_gen.go b/builtin/v10/eam/cbor_gen.go index ef731149..3c4b391a 100644 --- a/builtin/v10/eam/cbor_gen.go +++ b/builtin/v10/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -85,7 +85,7 @@ func (t *CreateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -220,7 +220,7 @@ func (t *CreateReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { + if len(t.Salt) > 2097152 { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -309,7 +309,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -331,7 +331,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Salt: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -451,7 +451,7 @@ func (t *Create2Return) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -571,7 +571,7 @@ func (t *CreateExternalReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/evm/cbor_gen.go b/builtin/v10/evm/cbor_gen.go index dffac8ac..ea0b5f37 100644 --- a/builtin/v10/evm/cbor_gen.go +++ b/builtin/v10/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { + if len(t.BytecodeHash) > 2097152 { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -196,7 +196,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BytecodeHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { + if len(t.Creator) > 2097152 { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -331,7 +331,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Creator: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -352,7 +352,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { + if len(t.StorageKey) > 2097152 { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -429,7 +429,7 @@ func (t *GetStorageAtParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.StorageKey: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { + if len(t.Input) > 2097152 { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { + if len(t.Caller) > 2097152 { return xerrors.Errorf("Byte array in field t.Caller was too long") } @@ -541,7 +541,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Input: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -563,7 +563,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Caller: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/init/cbor_gen.go b/builtin/v10/init/cbor_gen.go index e648e48a..934e614c 100644 --- a/builtin/v10/init/cbor_gen.go +++ b/builtin/v10/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -111,7 +111,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -175,7 +175,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -263,7 +263,7 @@ func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { + if len(t.SubAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } @@ -442,7 +442,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -464,7 +464,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SubAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/market/cbor_gen.go b/builtin/v10/market/cbor_gen.go index 10542ba0..43006a8b 100644 --- a/builtin/v10/market/cbor_gen.go +++ b/builtin/v10/market/cbor_gen.go @@ -223,10 +223,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.LastCron (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -369,10 +369,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorStartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -394,10 +394,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.LastUpdatedEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -419,10 +419,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SlashEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -589,7 +589,7 @@ func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if uint64(len(t.IDs)) > cbg.MaxLength { + if len(t.IDs) > 8192 { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -690,7 +690,7 @@ func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.IDs: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -812,7 +812,7 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -851,10 +851,10 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -896,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { + if len(t.VerifiedInfos) > 8192 { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -951,7 +951,7 @@ func (t *ActivateDealsResult) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.VerifiedInfos: array too large (%d)", extra) } @@ -1000,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1046,7 +1046,7 @@ func (t *VerifyDealsForActivationParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1095,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDealData) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1141,7 +1141,7 @@ func (t *VerifyDealsForActivationReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if uint64(len(t.Inputs)) > cbg.MaxLength { + if len(t.Inputs) > 8192 { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1236,7 +1236,7 @@ func (t *ComputeDataCommitmentParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Inputs: array too large (%d)", extra) } @@ -1295,7 +1295,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if uint64(len(t.CommDs)) > cbg.MaxLength { + if len(t.CommDs) > 8192 { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1341,7 +1341,7 @@ func (t *ComputeDataCommitmentReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.CommDs: array too large (%d)", extra) } @@ -1591,10 +1591,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Start (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1616,10 +1616,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Duration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1706,10 +1706,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Activated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1731,10 +1731,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Terminated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1782,7 +1782,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1825,10 +1825,10 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1854,7 +1854,7 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2074,10 +2074,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2099,10 +2099,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.EndEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2258,7 +2258,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2301,10 +2301,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2326,10 +2326,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2355,7 +2355,7 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2556,7 +2556,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2615,7 +2615,7 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2654,10 +2654,10 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v10/miner/cbor_gen.go b/builtin/v10/miner/cbor_gen.go index 65d891b1..c0d8b03c 100644 --- a/builtin/v10/miner/cbor_gen.go +++ b/builtin/v10/miner/cbor_gen.go @@ -261,10 +261,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.ProvingPeriodStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if uint64(len(t.ControlAddresses)) > cbg.MaxLength { + if len(t.ControlAddresses) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -522,7 +522,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddresses: array too large (%d)", extra) } @@ -579,7 +579,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -601,7 +601,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -627,7 +627,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -647,10 +647,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -700,10 +700,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ConsensusFaultElapsed (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if uint64(len(t.Due)) > cbg.MaxLength { + if len(t.Due) > 8192 { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -843,7 +843,7 @@ func (t *Deadlines) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Due: array too large (%d)", extra) } @@ -1581,10 +1581,10 @@ func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PreCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1655,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1722,10 +1722,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1773,10 +1773,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1802,7 +1802,7 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1841,10 +1841,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1926,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2063,10 +2063,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2104,7 +2104,7 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2143,10 +2143,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Activation (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2168,10 +2168,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2238,10 +2238,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ReplacedSectorAge (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2379,10 +2379,10 @@ func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2419,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if uint64(len(t.Funds)) > cbg.MaxLength { + if len(t.Funds) > 8192 { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2465,7 +2465,7 @@ func (t *VestingFunds) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Funds: array too large (%d)", extra) } @@ -2557,10 +2557,10 @@ func (t *VestingFund) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2611,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2666,7 +2666,7 @@ func (t *WindowedPoSt) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -2852,10 +2852,10 @@ func (t *BeneficiaryTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2968,10 +2968,10 @@ func (t *PendingBeneficiaryChange) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3052,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3116,7 +3116,7 @@ func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -3170,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { + if len(t.NewControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3225,7 +3225,7 @@ func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewControlAddrs: array too large (%d)", extra) } @@ -3274,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { + if len(t.NewID) > 2097152 { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3319,7 +3319,7 @@ func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewID: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3358,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if uint64(len(t.Partitions)) > cbg.MaxLength { + if len(t.Partitions) > 8192 { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3373,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3399,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { + if len(t.ChainCommitRand) > 2097152 { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3458,7 +3458,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Partitions: array too large (%d)", extra) } @@ -3496,7 +3496,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -3530,10 +3530,10 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ChainCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3559,7 +3559,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ChainCommitRand: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3626,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3704,10 +3704,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3755,10 +3755,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3784,7 +3784,7 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -3823,10 +3823,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3928,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { + if len(t.Proof) > 2097152 { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3987,7 +3987,7 @@ func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Proof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4020,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4066,7 +4066,7 @@ func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4115,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4161,7 +4161,7 @@ func (t *ExtendSectorExpiration2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4210,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if uint64(len(t.Terminations)) > cbg.MaxLength { + if len(t.Terminations) > 8192 { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4256,7 +4256,7 @@ func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terminations: array too large (%d)", extra) } @@ -4369,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if uint64(len(t.Faults)) > cbg.MaxLength { + if len(t.Faults) > 8192 { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4415,7 +4415,7 @@ func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Faults: array too large (%d)", extra) } @@ -4464,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if uint64(len(t.Recoveries)) > cbg.MaxLength { + if len(t.Recoveries) > 8192 { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4510,7 +4510,7 @@ func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Recoveries: array too large (%d)", extra) } @@ -4559,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { + if len(t.EventPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4613,7 +4613,7 @@ func (t *DeferredCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EventPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4797,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader1) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4810,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader2) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4823,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeaderExtra) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4868,7 +4868,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader1: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4890,7 +4890,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader2: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4912,7 +4912,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeaderExtra: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5001,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5063,7 +5063,7 @@ func (t *ConfirmSectorProofsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5144,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { + if len(t.NewMultiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5152,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -5198,7 +5198,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewMultiaddrs: array too large (%d)", extra) } @@ -5224,7 +5224,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewMultiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5474,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5520,7 +5520,7 @@ func (t *PreCommitSectorBatchParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5574,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5628,7 +5628,7 @@ func (t *ProveCommitAggregateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5661,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5707,7 +5707,7 @@ func (t *ProveReplicaUpdatesParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -5795,10 +5795,10 @@ func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) (err error) { // t.EventType (miner.CronEventType) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5835,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5881,7 +5881,7 @@ func (t *PreCommitSectorBatchParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5930,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5976,7 +5976,7 @@ func (t *ProveReplicaUpdatesParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -6092,10 +6092,10 @@ func (t *ChangeBeneficiaryParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6292,7 +6292,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6337,7 +6337,7 @@ func (t *GetPeerIDReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6370,7 +6370,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { + if len(t.MultiAddrs) > 2097152 { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6415,7 +6415,7 @@ func (t *GetMultiAddrsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.MultiAddrs: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6733,10 +6733,10 @@ func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6969,7 +6969,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6996,7 +6996,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7095,7 +7095,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7134,10 +7134,10 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7163,7 +7163,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7226,7 +7226,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7253,7 +7253,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7364,7 +7364,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7403,10 +7403,10 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7432,7 +7432,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7482,7 +7482,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { + if len(t.SectorsWithClaims) > 8192 { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7577,7 +7577,7 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorsWithClaims: array too large (%d)", extra) } @@ -7611,10 +7611,10 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7657,7 +7657,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.MaintainClaims)) > cbg.MaxLength { + if len(t.MaintainClaims) > 8192 { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7673,7 +7673,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.DropClaims)) > cbg.MaxLength { + if len(t.DropClaims) > 8192 { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } @@ -7734,7 +7734,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.MaintainClaims: array too large (%d)", extra) } @@ -7777,7 +7777,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DropClaims: array too large (%d)", extra) } diff --git a/builtin/v10/multisig/cbor_gen.go b/builtin/v10/multisig/cbor_gen.go index c28dfdf4..c9a552a1 100644 --- a/builtin/v10/multisig/cbor_gen.go +++ b/builtin/v10/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -133,7 +133,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -181,10 +181,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NextTxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -240,10 +240,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if uint64(len(t.Approved)) > cbg.MaxLength { + if len(t.Approved) > 8192 { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -399,7 +399,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -421,7 +421,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Approved: array too large (%d)", extra) } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -577,7 +577,7 @@ func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -685,7 +685,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -733,10 +733,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -758,10 +758,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -814,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -891,7 +891,7 @@ func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -951,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -992,10 +992,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.TxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1034,10 +1034,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1063,7 +1063,7 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1263,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { + if len(t.ProposalHash) > 2097152 { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1304,10 +1304,10 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1333,7 +1333,7 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ProposalHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1382,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1440,10 +1440,10 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1469,7 +1469,7 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1689,10 +1689,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1714,10 +1714,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v10/paych/cbor_gen.go b/builtin/v10/paych/cbor_gen.go index b4e06f44..1bff11b5 100644 --- a/builtin/v10/paych/cbor_gen.go +++ b/builtin/v10/paych/cbor_gen.go @@ -133,10 +133,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.SettlingAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -158,10 +158,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { + if len(t.Secret) > 2097152 { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -416,7 +416,7 @@ func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Secret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { + if len(t.SecretHash) > 2097152 { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if uint64(len(t.Merges)) > cbg.MaxLength { + if len(t.Merges) > 8192 { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -578,10 +578,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -603,10 +603,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -632,7 +632,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SecretHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -706,10 +706,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -735,7 +735,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Merges: array too large (%d)", extra) } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { + if len(t.Data) > 2097152 { return xerrors.Errorf("Byte array in field t.Data was too long") } @@ -882,7 +882,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Data: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/power/cbor_gen.go b/builtin/v10/power/cbor_gen.go index 827e4263..4b3371b7 100644 --- a/builtin/v10/power/cbor_gen.go +++ b/builtin/v10/power/cbor_gen.go @@ -246,10 +246,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -271,10 +271,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerAboveMinPowerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,10 +308,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.FirstCronEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -430,10 +430,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -679,7 +679,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -713,10 +713,10 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -742,7 +742,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -764,7 +764,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -790,7 +790,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { + if len(t.Peer) > 2097152 { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -927,10 +927,10 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -956,7 +956,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Peer: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -978,7 +978,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -1004,7 +1004,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1259,10 +1259,10 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { // t.EventEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1288,7 +1288,7 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { + if len(t.CallbackPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } @@ -1458,7 +1458,7 @@ func (t *CronEvent) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.CallbackPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v10/reward/cbor_gen.go b/builtin/v10/reward/cbor_gen.go index ec29a320..568037e7 100644 --- a/builtin/v10/reward/cbor_gen.go +++ b/builtin/v10/reward/cbor_gen.go @@ -146,10 +146,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveNetworkTime (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -207,10 +207,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -425,10 +425,10 @@ func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WinCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v10/verifreg/cbor_gen.go b/builtin/v10/verifreg/cbor_gen.go index e16c254b..777358be 100644 --- a/builtin/v10/verifreg/cbor_gen.go +++ b/builtin/v10/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if uint64(len(t.AllocationIds)) > cbg.MaxLength { + if len(t.AllocationIds) > 8192 { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -699,7 +699,7 @@ func (t *RemoveExpiredAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.AllocationIds: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -810,7 +810,7 @@ func (t *RemoveExpiredAllocationsReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -948,7 +948,7 @@ func (t *BatchReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1048,7 +1048,7 @@ func (t *ClaimAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1251,7 +1251,7 @@ func (t *GetClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if uint64(len(t.Claims)) > cbg.MaxLength { + if len(t.Claims) > 8192 { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1365,7 +1365,7 @@ func (t *GetClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Claims: array too large (%d)", extra) } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1479,7 +1479,7 @@ func (t *UniversalReceiverParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if uint64(len(t.NewAllocations)) > cbg.MaxLength { + if len(t.NewAllocations) > 8192 { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1587,7 +1587,7 @@ func (t *AllocationsResponse) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewAllocations: array too large (%d)", extra) } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if uint64(len(t.Terms)) > cbg.MaxLength { + if len(t.Terms) > 8192 { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1687,7 +1687,7 @@ func (t *ExtendClaimTermsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terms: array too large (%d)", extra) } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1802,7 +1802,7 @@ func (t *ExtendClaimTermsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1918,7 +1918,7 @@ func (t *RemoveExpiredClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2024,7 +2024,7 @@ func (t *RemoveExpiredClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -2363,10 +2363,10 @@ func (t *FailCode) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2540,10 +2540,10 @@ func (t *SectorAllocationClaim) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2725,10 +2725,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2750,10 +2750,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2775,10 +2775,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2908,10 +2908,10 @@ func (t *ClaimTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3021,10 +3021,10 @@ func (t *ClaimExtensionRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3200,10 +3200,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3225,10 +3225,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3250,10 +3250,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3409,10 +3409,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3434,10 +3434,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3459,10 +3459,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3499,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if uint64(len(t.Allocations)) > cbg.MaxLength { + if len(t.Allocations) > 8192 { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3514,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3560,7 +3560,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Allocations: array too large (%d)", extra) } @@ -3598,7 +3598,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } diff --git a/builtin/v11/account/cbor_gen.go b/builtin/v11/account/cbor_gen.go index 0bd09be2..55e97f33 100644 --- a/builtin/v11/account/cbor_gen.go +++ b/builtin/v11/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { + if len(t.Signature) > 2097152 { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { + if len(t.Message) > 2097152 { return xerrors.Errorf("Byte array in field t.Message was too long") } @@ -147,7 +147,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Signature: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -169,7 +169,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Message: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/cron/cbor_gen.go b/builtin/v11/cron/cbor_gen.go index 73deb41d..b00c94d4 100644 --- a/builtin/v11/cron/cbor_gen.go +++ b/builtin/v11/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if uint64(len(t.Entries)) > cbg.MaxLength { + if len(t.Entries) > 8192 { return xerrors.Errorf("Slice value in field t.Entries was too long") } @@ -80,7 +80,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Entries: array too large (%d)", extra) } diff --git a/builtin/v11/datacap/cbor_gen.go b/builtin/v11/datacap/cbor_gen.go index 42c936a6..11e7cbb1 100644 --- a/builtin/v11/datacap/cbor_gen.go +++ b/builtin/v11/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if uint64(len(t.Operators)) > cbg.MaxLength { + if len(t.Operators) > 8192 { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -291,7 +291,7 @@ func (t *MintParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Operators: array too large (%d)", extra) } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -413,7 +413,7 @@ func (t *MintReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -589,7 +589,7 @@ func (t *TransferParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -695,7 +695,7 @@ func (t *TransferReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -815,7 +815,7 @@ func (t *TransferFromParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -935,7 +935,7 @@ func (t *TransferFromReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/eam/cbor_gen.go b/builtin/v11/eam/cbor_gen.go index ef731149..3c4b391a 100644 --- a/builtin/v11/eam/cbor_gen.go +++ b/builtin/v11/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -85,7 +85,7 @@ func (t *CreateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -220,7 +220,7 @@ func (t *CreateReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { + if len(t.Salt) > 2097152 { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -309,7 +309,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -331,7 +331,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Salt: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -451,7 +451,7 @@ func (t *Create2Return) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -571,7 +571,7 @@ func (t *CreateExternalReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/evm/cbor_gen.go b/builtin/v11/evm/cbor_gen.go index dffac8ac..ea0b5f37 100644 --- a/builtin/v11/evm/cbor_gen.go +++ b/builtin/v11/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { + if len(t.BytecodeHash) > 2097152 { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -196,7 +196,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BytecodeHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { + if len(t.Creator) > 2097152 { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -331,7 +331,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Creator: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -352,7 +352,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { + if len(t.StorageKey) > 2097152 { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -429,7 +429,7 @@ func (t *GetStorageAtParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.StorageKey: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { + if len(t.Input) > 2097152 { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { + if len(t.Caller) > 2097152 { return xerrors.Errorf("Byte array in field t.Caller was too long") } @@ -541,7 +541,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Input: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -563,7 +563,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Caller: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/init/cbor_gen.go b/builtin/v11/init/cbor_gen.go index e648e48a..934e614c 100644 --- a/builtin/v11/init/cbor_gen.go +++ b/builtin/v11/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -111,7 +111,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -175,7 +175,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -263,7 +263,7 @@ func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { + if len(t.SubAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } @@ -442,7 +442,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -464,7 +464,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SubAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/market/cbor_gen.go b/builtin/v11/market/cbor_gen.go index 28c99082..89fb2423 100644 --- a/builtin/v11/market/cbor_gen.go +++ b/builtin/v11/market/cbor_gen.go @@ -223,10 +223,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.LastCron (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -369,10 +369,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorStartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -394,10 +394,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.LastUpdatedEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -419,10 +419,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SlashEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -589,7 +589,7 @@ func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if uint64(len(t.IDs)) > cbg.MaxLength { + if len(t.IDs) > 8192 { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -690,7 +690,7 @@ func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.IDs: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -812,7 +812,7 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -851,10 +851,10 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -896,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { + if len(t.VerifiedInfos) > 8192 { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -951,7 +951,7 @@ func (t *ActivateDealsResult) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.VerifiedInfos: array too large (%d)", extra) } @@ -1000,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1046,7 +1046,7 @@ func (t *VerifyDealsForActivationParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1095,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDealData) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1141,7 +1141,7 @@ func (t *VerifyDealsForActivationReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if uint64(len(t.Inputs)) > cbg.MaxLength { + if len(t.Inputs) > 8192 { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1236,7 +1236,7 @@ func (t *ComputeDataCommitmentParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Inputs: array too large (%d)", extra) } @@ -1295,7 +1295,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if uint64(len(t.CommDs)) > cbg.MaxLength { + if len(t.CommDs) > 8192 { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1341,7 +1341,7 @@ func (t *ComputeDataCommitmentReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.CommDs: array too large (%d)", extra) } @@ -1591,10 +1591,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Start (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1616,10 +1616,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Duration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1706,10 +1706,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Activated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1731,10 +1731,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Terminated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1782,7 +1782,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1825,10 +1825,10 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1854,7 +1854,7 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2074,10 +2074,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2099,10 +2099,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.EndEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2258,7 +2258,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2301,10 +2301,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2326,10 +2326,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2355,7 +2355,7 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2556,7 +2556,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2615,7 +2615,7 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2654,10 +2654,10 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v11/miner/cbor_gen.go b/builtin/v11/miner/cbor_gen.go index b550b50a..51bf05a2 100644 --- a/builtin/v11/miner/cbor_gen.go +++ b/builtin/v11/miner/cbor_gen.go @@ -261,10 +261,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.ProvingPeriodStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if uint64(len(t.ControlAddresses)) > cbg.MaxLength { + if len(t.ControlAddresses) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -522,7 +522,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddresses: array too large (%d)", extra) } @@ -579,7 +579,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -601,7 +601,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -627,7 +627,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -647,10 +647,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -700,10 +700,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ConsensusFaultElapsed (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if uint64(len(t.Due)) > cbg.MaxLength { + if len(t.Due) > 8192 { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -843,7 +843,7 @@ func (t *Deadlines) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Due: array too large (%d)", extra) } @@ -1581,10 +1581,10 @@ func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PreCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1655,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1722,10 +1722,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1773,10 +1773,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1802,7 +1802,7 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1841,10 +1841,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1926,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2063,10 +2063,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2104,7 +2104,7 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2143,10 +2143,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Activation (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2168,10 +2168,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2238,10 +2238,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ReplacedSectorAge (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2379,10 +2379,10 @@ func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2419,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if uint64(len(t.Funds)) > cbg.MaxLength { + if len(t.Funds) > 8192 { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2465,7 +2465,7 @@ func (t *VestingFunds) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Funds: array too large (%d)", extra) } @@ -2557,10 +2557,10 @@ func (t *VestingFund) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2611,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2666,7 +2666,7 @@ func (t *WindowedPoSt) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -2852,10 +2852,10 @@ func (t *BeneficiaryTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2968,10 +2968,10 @@ func (t *PendingBeneficiaryChange) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3052,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3116,7 +3116,7 @@ func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -3170,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { + if len(t.NewControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3225,7 +3225,7 @@ func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewControlAddrs: array too large (%d)", extra) } @@ -3274,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { + if len(t.NewID) > 2097152 { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3319,7 +3319,7 @@ func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewID: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3358,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if uint64(len(t.Partitions)) > cbg.MaxLength { + if len(t.Partitions) > 8192 { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3373,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3399,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { + if len(t.ChainCommitRand) > 2097152 { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3458,7 +3458,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Partitions: array too large (%d)", extra) } @@ -3496,7 +3496,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -3530,10 +3530,10 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ChainCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3559,7 +3559,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ChainCommitRand: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3626,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3704,10 +3704,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3755,10 +3755,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3784,7 +3784,7 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -3823,10 +3823,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3928,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { + if len(t.Proof) > 2097152 { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3987,7 +3987,7 @@ func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Proof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4020,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4066,7 +4066,7 @@ func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4115,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4161,7 +4161,7 @@ func (t *ExtendSectorExpiration2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4210,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if uint64(len(t.Terminations)) > cbg.MaxLength { + if len(t.Terminations) > 8192 { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4256,7 +4256,7 @@ func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terminations: array too large (%d)", extra) } @@ -4369,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if uint64(len(t.Faults)) > cbg.MaxLength { + if len(t.Faults) > 8192 { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4415,7 +4415,7 @@ func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Faults: array too large (%d)", extra) } @@ -4464,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if uint64(len(t.Recoveries)) > cbg.MaxLength { + if len(t.Recoveries) > 8192 { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4510,7 +4510,7 @@ func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Recoveries: array too large (%d)", extra) } @@ -4559,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { + if len(t.EventPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4613,7 +4613,7 @@ func (t *DeferredCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EventPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4797,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader1) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4810,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader2) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4823,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeaderExtra) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4868,7 +4868,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader1: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4890,7 +4890,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader2: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4912,7 +4912,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeaderExtra: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5001,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5063,7 +5063,7 @@ func (t *ConfirmSectorProofsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5144,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { + if len(t.NewMultiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5152,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -5198,7 +5198,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewMultiaddrs: array too large (%d)", extra) } @@ -5224,7 +5224,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewMultiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5474,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5520,7 +5520,7 @@ func (t *PreCommitSectorBatchParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5574,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5628,7 +5628,7 @@ func (t *ProveCommitAggregateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5661,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5707,7 +5707,7 @@ func (t *ProveReplicaUpdatesParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -5795,10 +5795,10 @@ func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) (err error) { // t.EventType (miner.CronEventType) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5835,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5881,7 +5881,7 @@ func (t *PreCommitSectorBatchParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5930,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5976,7 +5976,7 @@ func (t *ProveReplicaUpdatesParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -6092,10 +6092,10 @@ func (t *ChangeBeneficiaryParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6292,7 +6292,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6337,7 +6337,7 @@ func (t *GetPeerIDReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6370,7 +6370,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { + if len(t.MultiAddrs) > 2097152 { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6415,7 +6415,7 @@ func (t *GetMultiAddrsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.MultiAddrs: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6733,10 +6733,10 @@ func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6969,7 +6969,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6996,7 +6996,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7095,7 +7095,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7134,10 +7134,10 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7163,7 +7163,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7226,7 +7226,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7253,7 +7253,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7364,7 +7364,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7403,10 +7403,10 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7432,7 +7432,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7482,7 +7482,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { + if len(t.SectorsWithClaims) > 8192 { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7577,7 +7577,7 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorsWithClaims: array too large (%d)", extra) } @@ -7611,10 +7611,10 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7657,7 +7657,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.MaintainClaims)) > cbg.MaxLength { + if len(t.MaintainClaims) > 8192 { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7673,7 +7673,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.DropClaims)) > cbg.MaxLength { + if len(t.DropClaims) > 8192 { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } @@ -7734,7 +7734,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.MaintainClaims: array too large (%d)", extra) } @@ -7777,7 +7777,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DropClaims: array too large (%d)", extra) } diff --git a/builtin/v11/multisig/cbor_gen.go b/builtin/v11/multisig/cbor_gen.go index c28dfdf4..c9a552a1 100644 --- a/builtin/v11/multisig/cbor_gen.go +++ b/builtin/v11/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -133,7 +133,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -181,10 +181,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NextTxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -240,10 +240,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if uint64(len(t.Approved)) > cbg.MaxLength { + if len(t.Approved) > 8192 { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -399,7 +399,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -421,7 +421,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Approved: array too large (%d)", extra) } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -577,7 +577,7 @@ func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -685,7 +685,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -733,10 +733,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -758,10 +758,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -814,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -891,7 +891,7 @@ func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -951,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -992,10 +992,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.TxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1034,10 +1034,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1063,7 +1063,7 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1263,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { + if len(t.ProposalHash) > 2097152 { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1304,10 +1304,10 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1333,7 +1333,7 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ProposalHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1382,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1440,10 +1440,10 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1469,7 +1469,7 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1689,10 +1689,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1714,10 +1714,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v11/paych/cbor_gen.go b/builtin/v11/paych/cbor_gen.go index b4e06f44..1bff11b5 100644 --- a/builtin/v11/paych/cbor_gen.go +++ b/builtin/v11/paych/cbor_gen.go @@ -133,10 +133,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.SettlingAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -158,10 +158,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { + if len(t.Secret) > 2097152 { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -416,7 +416,7 @@ func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Secret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { + if len(t.SecretHash) > 2097152 { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if uint64(len(t.Merges)) > cbg.MaxLength { + if len(t.Merges) > 8192 { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -578,10 +578,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -603,10 +603,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -632,7 +632,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SecretHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -706,10 +706,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -735,7 +735,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Merges: array too large (%d)", extra) } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { + if len(t.Data) > 2097152 { return xerrors.Errorf("Byte array in field t.Data was too long") } @@ -882,7 +882,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Data: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/power/cbor_gen.go b/builtin/v11/power/cbor_gen.go index 827e4263..4b3371b7 100644 --- a/builtin/v11/power/cbor_gen.go +++ b/builtin/v11/power/cbor_gen.go @@ -246,10 +246,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -271,10 +271,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerAboveMinPowerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,10 +308,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.FirstCronEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -430,10 +430,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -679,7 +679,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -713,10 +713,10 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -742,7 +742,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -764,7 +764,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -790,7 +790,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { + if len(t.Peer) > 2097152 { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -927,10 +927,10 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -956,7 +956,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Peer: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -978,7 +978,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -1004,7 +1004,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1259,10 +1259,10 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { // t.EventEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1288,7 +1288,7 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { + if len(t.CallbackPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } @@ -1458,7 +1458,7 @@ func (t *CronEvent) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.CallbackPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v11/reward/cbor_gen.go b/builtin/v11/reward/cbor_gen.go index ec29a320..568037e7 100644 --- a/builtin/v11/reward/cbor_gen.go +++ b/builtin/v11/reward/cbor_gen.go @@ -146,10 +146,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveNetworkTime (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -207,10 +207,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -425,10 +425,10 @@ func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WinCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v11/verifreg/cbor_gen.go b/builtin/v11/verifreg/cbor_gen.go index e16c254b..777358be 100644 --- a/builtin/v11/verifreg/cbor_gen.go +++ b/builtin/v11/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if uint64(len(t.AllocationIds)) > cbg.MaxLength { + if len(t.AllocationIds) > 8192 { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -699,7 +699,7 @@ func (t *RemoveExpiredAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.AllocationIds: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -810,7 +810,7 @@ func (t *RemoveExpiredAllocationsReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -948,7 +948,7 @@ func (t *BatchReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1048,7 +1048,7 @@ func (t *ClaimAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1251,7 +1251,7 @@ func (t *GetClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if uint64(len(t.Claims)) > cbg.MaxLength { + if len(t.Claims) > 8192 { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1365,7 +1365,7 @@ func (t *GetClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Claims: array too large (%d)", extra) } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1479,7 +1479,7 @@ func (t *UniversalReceiverParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if uint64(len(t.NewAllocations)) > cbg.MaxLength { + if len(t.NewAllocations) > 8192 { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1587,7 +1587,7 @@ func (t *AllocationsResponse) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewAllocations: array too large (%d)", extra) } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if uint64(len(t.Terms)) > cbg.MaxLength { + if len(t.Terms) > 8192 { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1687,7 +1687,7 @@ func (t *ExtendClaimTermsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terms: array too large (%d)", extra) } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1802,7 +1802,7 @@ func (t *ExtendClaimTermsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1918,7 +1918,7 @@ func (t *RemoveExpiredClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2024,7 +2024,7 @@ func (t *RemoveExpiredClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -2363,10 +2363,10 @@ func (t *FailCode) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2540,10 +2540,10 @@ func (t *SectorAllocationClaim) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2725,10 +2725,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2750,10 +2750,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2775,10 +2775,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2908,10 +2908,10 @@ func (t *ClaimTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3021,10 +3021,10 @@ func (t *ClaimExtensionRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3200,10 +3200,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3225,10 +3225,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3250,10 +3250,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3409,10 +3409,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3434,10 +3434,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3459,10 +3459,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3499,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if uint64(len(t.Allocations)) > cbg.MaxLength { + if len(t.Allocations) > 8192 { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3514,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3560,7 +3560,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Allocations: array too large (%d)", extra) } @@ -3598,7 +3598,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } diff --git a/builtin/v12/account/cbor_gen.go b/builtin/v12/account/cbor_gen.go index 0bd09be2..55e97f33 100644 --- a/builtin/v12/account/cbor_gen.go +++ b/builtin/v12/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { + if len(t.Signature) > 2097152 { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { + if len(t.Message) > 2097152 { return xerrors.Errorf("Byte array in field t.Message was too long") } @@ -147,7 +147,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Signature: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -169,7 +169,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Message: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/cron/cbor_gen.go b/builtin/v12/cron/cbor_gen.go index 73deb41d..b00c94d4 100644 --- a/builtin/v12/cron/cbor_gen.go +++ b/builtin/v12/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if uint64(len(t.Entries)) > cbg.MaxLength { + if len(t.Entries) > 8192 { return xerrors.Errorf("Slice value in field t.Entries was too long") } @@ -80,7 +80,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Entries: array too large (%d)", extra) } diff --git a/builtin/v12/datacap/cbor_gen.go b/builtin/v12/datacap/cbor_gen.go index 42c936a6..11e7cbb1 100644 --- a/builtin/v12/datacap/cbor_gen.go +++ b/builtin/v12/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if uint64(len(t.Operators)) > cbg.MaxLength { + if len(t.Operators) > 8192 { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -291,7 +291,7 @@ func (t *MintParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Operators: array too large (%d)", extra) } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -413,7 +413,7 @@ func (t *MintReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -589,7 +589,7 @@ func (t *TransferParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -695,7 +695,7 @@ func (t *TransferReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -815,7 +815,7 @@ func (t *TransferFromParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -935,7 +935,7 @@ func (t *TransferFromReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/eam/cbor_gen.go b/builtin/v12/eam/cbor_gen.go index ef731149..3c4b391a 100644 --- a/builtin/v12/eam/cbor_gen.go +++ b/builtin/v12/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -85,7 +85,7 @@ func (t *CreateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -220,7 +220,7 @@ func (t *CreateReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { + if len(t.Salt) > 2097152 { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -309,7 +309,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -331,7 +331,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Salt: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -451,7 +451,7 @@ func (t *Create2Return) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -571,7 +571,7 @@ func (t *CreateExternalReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/evm/cbor_gen.go b/builtin/v12/evm/cbor_gen.go index dffac8ac..ea0b5f37 100644 --- a/builtin/v12/evm/cbor_gen.go +++ b/builtin/v12/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { + if len(t.BytecodeHash) > 2097152 { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -196,7 +196,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BytecodeHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { + if len(t.Creator) > 2097152 { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -331,7 +331,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Creator: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -352,7 +352,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { + if len(t.StorageKey) > 2097152 { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -429,7 +429,7 @@ func (t *GetStorageAtParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.StorageKey: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { + if len(t.Input) > 2097152 { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { + if len(t.Caller) > 2097152 { return xerrors.Errorf("Byte array in field t.Caller was too long") } @@ -541,7 +541,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Input: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -563,7 +563,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Caller: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/init/cbor_gen.go b/builtin/v12/init/cbor_gen.go index e648e48a..934e614c 100644 --- a/builtin/v12/init/cbor_gen.go +++ b/builtin/v12/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -111,7 +111,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -175,7 +175,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -263,7 +263,7 @@ func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { + if len(t.SubAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } @@ -442,7 +442,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -464,7 +464,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SubAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/market/cbor_gen.go b/builtin/v12/market/cbor_gen.go index 5905a7af..eaf5235f 100644 --- a/builtin/v12/market/cbor_gen.go +++ b/builtin/v12/market/cbor_gen.go @@ -223,10 +223,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.LastCron (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -369,10 +369,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorStartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -394,10 +394,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.LastUpdatedEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -419,10 +419,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SlashEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -589,7 +589,7 @@ func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if uint64(len(t.IDs)) > cbg.MaxLength { + if len(t.IDs) > 8192 { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -690,7 +690,7 @@ func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.IDs: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -812,7 +812,7 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -851,10 +851,10 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -896,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { + if len(t.VerifiedInfos) > 8192 { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -951,7 +951,7 @@ func (t *ActivateDealsResult) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.VerifiedInfos: array too large (%d)", extra) } @@ -1000,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1046,7 +1046,7 @@ func (t *VerifyDealsForActivationParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1095,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.UnsealedCIDs ([]*cid.Cid) (slice) - if uint64(len(t.UnsealedCIDs)) > cbg.MaxLength { + if len(t.UnsealedCIDs) > 8192 { return xerrors.Errorf("Slice value in field t.UnsealedCIDs was too long") } @@ -1148,7 +1148,7 @@ func (t *VerifyDealsForActivationReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.UnsealedCIDs: array too large (%d)", extra) } @@ -1411,10 +1411,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Start (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1436,10 +1436,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Duration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1526,10 +1526,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Activated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1551,10 +1551,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Terminated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1602,7 +1602,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1645,10 +1645,10 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1674,7 +1674,7 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1894,10 +1894,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1919,10 +1919,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.EndEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2078,7 +2078,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2121,10 +2121,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2146,10 +2146,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2175,7 +2175,7 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2299,7 +2299,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2358,7 +2358,7 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2397,10 +2397,10 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v12/miner/cbor_gen.go b/builtin/v12/miner/cbor_gen.go index e414b56d..1ac08a72 100644 --- a/builtin/v12/miner/cbor_gen.go +++ b/builtin/v12/miner/cbor_gen.go @@ -261,10 +261,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.ProvingPeriodStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if uint64(len(t.ControlAddresses)) > cbg.MaxLength { + if len(t.ControlAddresses) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -522,7 +522,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddresses: array too large (%d)", extra) } @@ -579,7 +579,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -601,7 +601,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -627,7 +627,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -647,10 +647,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -700,10 +700,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ConsensusFaultElapsed (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if uint64(len(t.Due)) > cbg.MaxLength { + if len(t.Due) > 8192 { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -843,7 +843,7 @@ func (t *Deadlines) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Due: array too large (%d)", extra) } @@ -1581,10 +1581,10 @@ func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PreCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1655,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1722,10 +1722,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1773,10 +1773,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1802,7 +1802,7 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1841,10 +1841,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1926,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2065,10 +2065,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2106,7 +2106,7 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2145,10 +2145,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Activation (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2170,10 +2170,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2240,10 +2240,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PowerBaseEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2378,10 +2378,10 @@ func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2418,7 +2418,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if uint64(len(t.Funds)) > cbg.MaxLength { + if len(t.Funds) > 8192 { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2464,7 +2464,7 @@ func (t *VestingFunds) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Funds: array too large (%d)", extra) } @@ -2556,10 +2556,10 @@ func (t *VestingFund) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2610,7 +2610,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2665,7 +2665,7 @@ func (t *WindowedPoSt) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -2851,10 +2851,10 @@ func (t *BeneficiaryTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2967,10 +2967,10 @@ func (t *PendingBeneficiaryChange) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3051,7 +3051,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3115,7 +3115,7 @@ func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -3169,7 +3169,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { + if len(t.NewControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3224,7 +3224,7 @@ func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewControlAddrs: array too large (%d)", extra) } @@ -3273,7 +3273,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { + if len(t.NewID) > 2097152 { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3318,7 +3318,7 @@ func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewID: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3357,7 +3357,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if uint64(len(t.Partitions)) > cbg.MaxLength { + if len(t.Partitions) > 8192 { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3372,7 +3372,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3398,7 +3398,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { + if len(t.ChainCommitRand) > 2097152 { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3457,7 +3457,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Partitions: array too large (%d)", extra) } @@ -3495,7 +3495,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -3529,10 +3529,10 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ChainCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3558,7 +3558,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ChainCommitRand: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3625,7 +3625,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3703,10 +3703,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3754,10 +3754,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3783,7 +3783,7 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -3822,10 +3822,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3927,7 +3927,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { + if len(t.Proof) > 2097152 { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3986,7 +3986,7 @@ func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Proof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4019,7 +4019,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4065,7 +4065,7 @@ func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4114,7 +4114,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4160,7 +4160,7 @@ func (t *ExtendSectorExpiration2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4209,7 +4209,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if uint64(len(t.Terminations)) > cbg.MaxLength { + if len(t.Terminations) > 8192 { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4255,7 +4255,7 @@ func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terminations: array too large (%d)", extra) } @@ -4368,7 +4368,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if uint64(len(t.Faults)) > cbg.MaxLength { + if len(t.Faults) > 8192 { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4414,7 +4414,7 @@ func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Faults: array too large (%d)", extra) } @@ -4463,7 +4463,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if uint64(len(t.Recoveries)) > cbg.MaxLength { + if len(t.Recoveries) > 8192 { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4509,7 +4509,7 @@ func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Recoveries: array too large (%d)", extra) } @@ -4558,7 +4558,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { + if len(t.EventPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4612,7 +4612,7 @@ func (t *DeferredCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EventPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4796,7 +4796,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader1) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4809,7 +4809,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader2) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4822,7 +4822,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeaderExtra) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4867,7 +4867,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader1: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4889,7 +4889,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader2: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4911,7 +4911,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeaderExtra: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5000,7 +5000,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5062,7 +5062,7 @@ func (t *ConfirmSectorProofsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5143,7 +5143,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { + if len(t.NewMultiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5151,7 +5151,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -5197,7 +5197,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewMultiaddrs: array too large (%d)", extra) } @@ -5223,7 +5223,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewMultiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5473,7 +5473,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5519,7 +5519,7 @@ func (t *PreCommitSectorBatchParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5573,7 +5573,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5627,7 +5627,7 @@ func (t *ProveCommitAggregateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5660,7 +5660,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5706,7 +5706,7 @@ func (t *ProveReplicaUpdatesParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -5794,10 +5794,10 @@ func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) (err error) { // t.EventType (miner.CronEventType) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5834,7 +5834,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5880,7 +5880,7 @@ func (t *PreCommitSectorBatchParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5929,7 +5929,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5975,7 +5975,7 @@ func (t *ProveReplicaUpdatesParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -6091,10 +6091,10 @@ func (t *ChangeBeneficiaryParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6291,7 +6291,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6336,7 +6336,7 @@ func (t *GetPeerIDReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6369,7 +6369,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { + if len(t.MultiAddrs) > 2097152 { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6414,7 +6414,7 @@ func (t *GetMultiAddrsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.MultiAddrs: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6732,10 +6732,10 @@ func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6968,7 +6968,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6995,7 +6995,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7094,7 +7094,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7133,10 +7133,10 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7162,7 +7162,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7225,7 +7225,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7252,7 +7252,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7363,7 +7363,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7402,10 +7402,10 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7431,7 +7431,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7481,7 +7481,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { + if len(t.SectorsWithClaims) > 8192 { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7576,7 +7576,7 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorsWithClaims: array too large (%d)", extra) } @@ -7610,10 +7610,10 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7656,7 +7656,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.MaintainClaims)) > cbg.MaxLength { + if len(t.MaintainClaims) > 8192 { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7672,7 +7672,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.DropClaims)) > cbg.MaxLength { + if len(t.DropClaims) > 8192 { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } @@ -7733,7 +7733,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.MaintainClaims: array too large (%d)", extra) } @@ -7776,7 +7776,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DropClaims: array too large (%d)", extra) } diff --git a/builtin/v12/multisig/cbor_gen.go b/builtin/v12/multisig/cbor_gen.go index c28dfdf4..c9a552a1 100644 --- a/builtin/v12/multisig/cbor_gen.go +++ b/builtin/v12/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -133,7 +133,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -181,10 +181,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NextTxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -240,10 +240,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if uint64(len(t.Approved)) > cbg.MaxLength { + if len(t.Approved) > 8192 { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -399,7 +399,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -421,7 +421,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Approved: array too large (%d)", extra) } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -577,7 +577,7 @@ func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -685,7 +685,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -733,10 +733,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -758,10 +758,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -814,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -891,7 +891,7 @@ func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -951,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -992,10 +992,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.TxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1034,10 +1034,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1063,7 +1063,7 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1263,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { + if len(t.ProposalHash) > 2097152 { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1304,10 +1304,10 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1333,7 +1333,7 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ProposalHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1382,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1440,10 +1440,10 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1469,7 +1469,7 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1689,10 +1689,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1714,10 +1714,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v12/paych/cbor_gen.go b/builtin/v12/paych/cbor_gen.go index b4e06f44..1bff11b5 100644 --- a/builtin/v12/paych/cbor_gen.go +++ b/builtin/v12/paych/cbor_gen.go @@ -133,10 +133,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.SettlingAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -158,10 +158,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { + if len(t.Secret) > 2097152 { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -416,7 +416,7 @@ func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Secret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { + if len(t.SecretHash) > 2097152 { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if uint64(len(t.Merges)) > cbg.MaxLength { + if len(t.Merges) > 8192 { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -578,10 +578,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -603,10 +603,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -632,7 +632,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SecretHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -706,10 +706,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -735,7 +735,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Merges: array too large (%d)", extra) } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { + if len(t.Data) > 2097152 { return xerrors.Errorf("Byte array in field t.Data was too long") } @@ -882,7 +882,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Data: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/power/cbor_gen.go b/builtin/v12/power/cbor_gen.go index 827e4263..4b3371b7 100644 --- a/builtin/v12/power/cbor_gen.go +++ b/builtin/v12/power/cbor_gen.go @@ -246,10 +246,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -271,10 +271,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerAboveMinPowerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,10 +308,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.FirstCronEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -430,10 +430,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -679,7 +679,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -713,10 +713,10 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -742,7 +742,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -764,7 +764,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -790,7 +790,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { + if len(t.Peer) > 2097152 { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -927,10 +927,10 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -956,7 +956,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Peer: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -978,7 +978,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -1004,7 +1004,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1259,10 +1259,10 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { // t.EventEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1288,7 +1288,7 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { + if len(t.CallbackPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } @@ -1458,7 +1458,7 @@ func (t *CronEvent) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.CallbackPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v12/reward/cbor_gen.go b/builtin/v12/reward/cbor_gen.go index ec29a320..568037e7 100644 --- a/builtin/v12/reward/cbor_gen.go +++ b/builtin/v12/reward/cbor_gen.go @@ -146,10 +146,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveNetworkTime (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -207,10 +207,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -425,10 +425,10 @@ func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WinCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v12/verifreg/cbor_gen.go b/builtin/v12/verifreg/cbor_gen.go index e16c254b..777358be 100644 --- a/builtin/v12/verifreg/cbor_gen.go +++ b/builtin/v12/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if uint64(len(t.AllocationIds)) > cbg.MaxLength { + if len(t.AllocationIds) > 8192 { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -699,7 +699,7 @@ func (t *RemoveExpiredAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.AllocationIds: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -810,7 +810,7 @@ func (t *RemoveExpiredAllocationsReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -948,7 +948,7 @@ func (t *BatchReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1048,7 +1048,7 @@ func (t *ClaimAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1251,7 +1251,7 @@ func (t *GetClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if uint64(len(t.Claims)) > cbg.MaxLength { + if len(t.Claims) > 8192 { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1365,7 +1365,7 @@ func (t *GetClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Claims: array too large (%d)", extra) } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1479,7 +1479,7 @@ func (t *UniversalReceiverParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if uint64(len(t.NewAllocations)) > cbg.MaxLength { + if len(t.NewAllocations) > 8192 { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1587,7 +1587,7 @@ func (t *AllocationsResponse) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewAllocations: array too large (%d)", extra) } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if uint64(len(t.Terms)) > cbg.MaxLength { + if len(t.Terms) > 8192 { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1687,7 +1687,7 @@ func (t *ExtendClaimTermsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terms: array too large (%d)", extra) } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1802,7 +1802,7 @@ func (t *ExtendClaimTermsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1918,7 +1918,7 @@ func (t *RemoveExpiredClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2024,7 +2024,7 @@ func (t *RemoveExpiredClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -2363,10 +2363,10 @@ func (t *FailCode) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2540,10 +2540,10 @@ func (t *SectorAllocationClaim) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2725,10 +2725,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2750,10 +2750,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2775,10 +2775,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2908,10 +2908,10 @@ func (t *ClaimTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3021,10 +3021,10 @@ func (t *ClaimExtensionRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3200,10 +3200,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3225,10 +3225,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3250,10 +3250,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3409,10 +3409,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3434,10 +3434,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3459,10 +3459,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3499,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if uint64(len(t.Allocations)) > cbg.MaxLength { + if len(t.Allocations) > 8192 { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3514,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3560,7 +3560,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Allocations: array too large (%d)", extra) } @@ -3598,7 +3598,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } diff --git a/builtin/v13/account/cbor_gen.go b/builtin/v13/account/cbor_gen.go index 0bd09be2..55e97f33 100644 --- a/builtin/v13/account/cbor_gen.go +++ b/builtin/v13/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { + if len(t.Signature) > 2097152 { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { + if len(t.Message) > 2097152 { return xerrors.Errorf("Byte array in field t.Message was too long") } @@ -147,7 +147,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Signature: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -169,7 +169,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Message: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/cron/cbor_gen.go b/builtin/v13/cron/cbor_gen.go index 73deb41d..b00c94d4 100644 --- a/builtin/v13/cron/cbor_gen.go +++ b/builtin/v13/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if uint64(len(t.Entries)) > cbg.MaxLength { + if len(t.Entries) > 8192 { return xerrors.Errorf("Slice value in field t.Entries was too long") } @@ -80,7 +80,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Entries: array too large (%d)", extra) } diff --git a/builtin/v13/datacap/cbor_gen.go b/builtin/v13/datacap/cbor_gen.go index 42c936a6..11e7cbb1 100644 --- a/builtin/v13/datacap/cbor_gen.go +++ b/builtin/v13/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if uint64(len(t.Operators)) > cbg.MaxLength { + if len(t.Operators) > 8192 { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -291,7 +291,7 @@ func (t *MintParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Operators: array too large (%d)", extra) } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -413,7 +413,7 @@ func (t *MintReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -589,7 +589,7 @@ func (t *TransferParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -695,7 +695,7 @@ func (t *TransferReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -815,7 +815,7 @@ func (t *TransferFromParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -935,7 +935,7 @@ func (t *TransferFromReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/eam/cbor_gen.go b/builtin/v13/eam/cbor_gen.go index ef731149..3c4b391a 100644 --- a/builtin/v13/eam/cbor_gen.go +++ b/builtin/v13/eam/cbor_gen.go @@ -34,7 +34,7 @@ func (t *CreateParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -85,7 +85,7 @@ func (t *CreateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -143,7 +143,7 @@ func (t *CreateReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -220,7 +220,7 @@ func (t *CreateReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -252,7 +252,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -265,7 +265,7 @@ func (t *Create2Params) MarshalCBOR(w io.Writer) error { } // t.Salt ([32]uint8) (array) - if uint64(len(t.Salt)) > cbg.ByteArrayMaxLen { + if len(t.Salt) > 2097152 { return xerrors.Errorf("Byte array in field t.Salt was too long") } @@ -309,7 +309,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -331,7 +331,7 @@ func (t *Create2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Salt: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -374,7 +374,7 @@ func (t *Create2Return) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -451,7 +451,7 @@ func (t *Create2Return) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -494,7 +494,7 @@ func (t *CreateExternalReturn) MarshalCBOR(w io.Writer) error { } // t.EthAddress ([20]uint8) (array) - if uint64(len(t.EthAddress)) > cbg.ByteArrayMaxLen { + if len(t.EthAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.EthAddress was too long") } @@ -571,7 +571,7 @@ func (t *CreateExternalReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EthAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/evm/cbor_gen.go b/builtin/v13/evm/cbor_gen.go index dffac8ac..ea0b5f37 100644 --- a/builtin/v13/evm/cbor_gen.go +++ b/builtin/v13/evm/cbor_gen.go @@ -123,7 +123,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.BytecodeHash ([32]uint8) (array) - if uint64(len(t.BytecodeHash)) > cbg.ByteArrayMaxLen { + if len(t.BytecodeHash) > 2097152 { return xerrors.Errorf("Byte array in field t.BytecodeHash was too long") } @@ -196,7 +196,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BytecodeHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -273,7 +273,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Creator ([20]uint8) (array) - if uint64(len(t.Creator)) > cbg.ByteArrayMaxLen { + if len(t.Creator) > 2097152 { return xerrors.Errorf("Byte array in field t.Creator was too long") } @@ -286,7 +286,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Initcode ([]uint8) (slice) - if uint64(len(t.Initcode)) > cbg.ByteArrayMaxLen { + if len(t.Initcode) > 2097152 { return xerrors.Errorf("Byte array in field t.Initcode was too long") } @@ -331,7 +331,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Creator: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -352,7 +352,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Initcode: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -385,7 +385,7 @@ func (t *GetStorageAtParams) MarshalCBOR(w io.Writer) error { } // t.StorageKey ([32]uint8) (array) - if uint64(len(t.StorageKey)) > cbg.ByteArrayMaxLen { + if len(t.StorageKey) > 2097152 { return xerrors.Errorf("Byte array in field t.StorageKey was too long") } @@ -429,7 +429,7 @@ func (t *GetStorageAtParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.StorageKey: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -467,7 +467,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Input ([]uint8) (slice) - if uint64(len(t.Input)) > cbg.ByteArrayMaxLen { + if len(t.Input) > 2097152 { return xerrors.Errorf("Byte array in field t.Input was too long") } @@ -480,7 +480,7 @@ func (t *DelegateCallParams) MarshalCBOR(w io.Writer) error { } // t.Caller ([20]uint8) (array) - if uint64(len(t.Caller)) > cbg.ByteArrayMaxLen { + if len(t.Caller) > 2097152 { return xerrors.Errorf("Byte array in field t.Caller was too long") } @@ -541,7 +541,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Input: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -563,7 +563,7 @@ func (t *DelegateCallParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Caller: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/init/cbor_gen.go b/builtin/v13/init/cbor_gen.go index e648e48a..934e614c 100644 --- a/builtin/v13/init/cbor_gen.go +++ b/builtin/v13/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -111,7 +111,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -175,7 +175,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -263,7 +263,7 @@ func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -372,7 +372,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -385,7 +385,7 @@ func (t *Exec4Params) MarshalCBOR(w io.Writer) error { } // t.SubAddress ([]uint8) (slice) - if uint64(len(t.SubAddress)) > cbg.ByteArrayMaxLen { + if len(t.SubAddress) > 2097152 { return xerrors.Errorf("Byte array in field t.SubAddress was too long") } @@ -442,7 +442,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -464,7 +464,7 @@ func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SubAddress: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/market/cbor_gen.go b/builtin/v13/market/cbor_gen.go index e2889dc2..84934719 100644 --- a/builtin/v13/market/cbor_gen.go +++ b/builtin/v13/market/cbor_gen.go @@ -229,10 +229,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.LastCron (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -401,10 +401,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorStartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -426,10 +426,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.LastUpdatedEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -451,10 +451,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SlashEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -480,7 +480,7 @@ func (t *SectorDealIDs) MarshalCBOR(w io.Writer) error { cw := cbg.NewCborWriter(w) // (*t) (market.SectorDealIDs) (slice) - if uint64(len((*t))) > cbg.MaxLength { + if len((*t)) > 8192 { return xerrors.Errorf("Slice value in field (*t) was too long") } @@ -512,7 +512,7 @@ func (t *SectorDealIDs) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("(*t): array too large (%d)", extra) } @@ -636,7 +636,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -682,7 +682,7 @@ func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -731,7 +731,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if uint64(len(t.IDs)) > cbg.MaxLength { + if len(t.IDs) > 8192 { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -783,7 +783,7 @@ func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.IDs: array too large (%d)", extra) } @@ -846,7 +846,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -905,7 +905,7 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -944,10 +944,10 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -989,7 +989,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { + if len(t.VerifiedInfos) > 8192 { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -1044,7 +1044,7 @@ func (t *ActivateDealsResult) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.VerifiedInfos: array too large (%d)", extra) } @@ -1093,7 +1093,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1139,7 +1139,7 @@ func (t *VerifyDealsForActivationParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1188,7 +1188,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.UnsealedCIDs ([]*cid.Cid) (slice) - if uint64(len(t.UnsealedCIDs)) > cbg.MaxLength { + if len(t.UnsealedCIDs) > 8192 { return xerrors.Errorf("Slice value in field t.UnsealedCIDs was too long") } @@ -1241,7 +1241,7 @@ func (t *VerifyDealsForActivationReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.UnsealedCIDs: array too large (%d)", extra) } @@ -1504,10 +1504,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Start (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1529,10 +1529,10 @@ func (t *GetDealTermReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Duration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1619,10 +1619,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Activated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1644,10 +1644,10 @@ func (t *GetDealActivationReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Terminated (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1695,7 +1695,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1738,10 +1738,10 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1767,7 +1767,7 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1987,10 +1987,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2012,10 +2012,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.EndEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2171,7 +2171,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2214,10 +2214,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2239,10 +2239,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2268,7 +2268,7 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2392,7 +2392,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2451,7 +2451,7 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2490,10 +2490,10 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v13/miner/cbor_gen.go b/builtin/v13/miner/cbor_gen.go index 1d73014b..eb249a78 100644 --- a/builtin/v13/miner/cbor_gen.go +++ b/builtin/v13/miner/cbor_gen.go @@ -262,10 +262,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.ProvingPeriodStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -364,7 +364,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if uint64(len(t.ControlAddresses)) > cbg.MaxLength { + if len(t.ControlAddresses) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -384,7 +384,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -397,7 +397,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -405,7 +405,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -523,7 +523,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddresses: array too large (%d)", extra) } @@ -580,7 +580,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -602,7 +602,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -628,7 +628,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -648,10 +648,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -701,10 +701,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ConsensusFaultElapsed (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -797,7 +797,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if uint64(len(t.Due)) > cbg.MaxLength { + if len(t.Due) > 8192 { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -844,7 +844,7 @@ func (t *Deadlines) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Due: array too large (%d)", extra) } @@ -1582,10 +1582,10 @@ func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PreCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1656,7 +1656,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1723,10 +1723,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1774,10 +1774,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1803,7 +1803,7 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1842,10 +1842,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1927,7 +1927,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2066,10 +2066,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2107,7 +2107,7 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2146,10 +2146,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Activation (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2171,10 +2171,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2241,10 +2241,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PowerBaseEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2379,10 +2379,10 @@ func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2419,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if uint64(len(t.Funds)) > cbg.MaxLength { + if len(t.Funds) > 8192 { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2465,7 +2465,7 @@ func (t *VestingFunds) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Funds: array too large (%d)", extra) } @@ -2557,10 +2557,10 @@ func (t *VestingFund) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2611,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2666,7 +2666,7 @@ func (t *WindowedPoSt) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -2852,10 +2852,10 @@ func (t *BeneficiaryTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2968,10 +2968,10 @@ func (t *PendingBeneficiaryChange) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3052,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3116,7 +3116,7 @@ func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -3170,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { + if len(t.NewControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3225,7 +3225,7 @@ func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewControlAddrs: array too large (%d)", extra) } @@ -3274,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { + if len(t.NewID) > 2097152 { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3319,7 +3319,7 @@ func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewID: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3358,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if uint64(len(t.Partitions)) > cbg.MaxLength { + if len(t.Partitions) > 8192 { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3373,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3399,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { + if len(t.ChainCommitRand) > 2097152 { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3458,7 +3458,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Partitions: array too large (%d)", extra) } @@ -3496,7 +3496,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -3530,10 +3530,10 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ChainCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3559,7 +3559,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ChainCommitRand: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3626,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3704,10 +3704,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3755,10 +3755,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3784,7 +3784,7 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -3823,10 +3823,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3928,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { + if len(t.Proof) > 2097152 { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3987,7 +3987,7 @@ func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Proof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4020,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4066,7 +4066,7 @@ func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4115,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4161,7 +4161,7 @@ func (t *ExtendSectorExpiration2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4210,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if uint64(len(t.Terminations)) > cbg.MaxLength { + if len(t.Terminations) > 8192 { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4256,7 +4256,7 @@ func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terminations: array too large (%d)", extra) } @@ -4369,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if uint64(len(t.Faults)) > cbg.MaxLength { + if len(t.Faults) > 8192 { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4415,7 +4415,7 @@ func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Faults: array too large (%d)", extra) } @@ -4464,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if uint64(len(t.Recoveries)) > cbg.MaxLength { + if len(t.Recoveries) > 8192 { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4510,7 +4510,7 @@ func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Recoveries: array too large (%d)", extra) } @@ -4559,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { + if len(t.EventPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4613,7 +4613,7 @@ func (t *DeferredCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EventPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4797,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader1) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4810,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader2) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4823,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeaderExtra) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4868,7 +4868,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader1: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4890,7 +4890,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader2: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4912,7 +4912,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeaderExtra: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5001,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5063,7 +5063,7 @@ func (t *ConfirmSectorProofsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5144,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { + if len(t.NewMultiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5152,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -5198,7 +5198,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewMultiaddrs: array too large (%d)", extra) } @@ -5224,7 +5224,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewMultiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5474,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5520,7 +5520,7 @@ func (t *PreCommitSectorBatchParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5574,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5628,7 +5628,7 @@ func (t *ProveCommitAggregateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5661,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5707,7 +5707,7 @@ func (t *ProveReplicaUpdatesParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -5795,10 +5795,10 @@ func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) (err error) { // t.EventType (miner.CronEventType) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5835,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5881,7 +5881,7 @@ func (t *PreCommitSectorBatchParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5930,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5976,7 +5976,7 @@ func (t *ProveReplicaUpdatesParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -6092,10 +6092,10 @@ func (t *ChangeBeneficiaryParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6292,7 +6292,7 @@ func (t *GetPeerIDReturn) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -6337,7 +6337,7 @@ func (t *GetPeerIDReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6370,7 +6370,7 @@ func (t *GetMultiAddrsReturn) MarshalCBOR(w io.Writer) error { } // t.MultiAddrs ([]uint8) (slice) - if uint64(len(t.MultiAddrs)) > cbg.ByteArrayMaxLen { + if len(t.MultiAddrs) > 2097152 { return xerrors.Errorf("Byte array in field t.MultiAddrs was too long") } @@ -6415,7 +6415,7 @@ func (t *GetMultiAddrsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.MultiAddrs: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6448,7 +6448,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.SectorActivations ([]miner.SectorActivationManifest) (slice) - if uint64(len(t.SectorActivations)) > cbg.MaxLength { + if len(t.SectorActivations) > 8192 { return xerrors.Errorf("Slice value in field t.SectorActivations was too long") } @@ -6463,7 +6463,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.SectorProofs ([][]uint8) (slice) - if uint64(len(t.SectorProofs)) > cbg.MaxLength { + if len(t.SectorProofs) > 8192 { return xerrors.Errorf("Slice value in field t.SectorProofs was too long") } @@ -6471,7 +6471,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.SectorProofs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -6486,7 +6486,7 @@ func (t *ProveCommitSectors3Params) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -6557,7 +6557,7 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorActivations: array too large (%d)", extra) } @@ -6595,7 +6595,7 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorProofs: array too large (%d)", extra) } @@ -6621,7 +6621,7 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SectorProofs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6645,7 +6645,7 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6671,11 +6671,11 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - maj, extra, err = cr.ReadHeader() - var extraI int64 + maj, extra, err := cr.ReadHeader() if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6691,9 +6691,9 @@ func (t *ProveCommitSectors3Params) UnmarshalCBOR(r io.Reader) (err error) { default: return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.AggregateProofType = &extraI - } + t.AggregateProofType = (*abi.RegisteredAggregationProof)(&extraI) + } } // t.RequireActivationSuccess (bool) (bool) @@ -6753,7 +6753,7 @@ func (t *SectorActivationManifest) MarshalCBOR(w io.Writer) error { } // t.Pieces ([]miner.PieceActivationManifest) (slice) - if uint64(len(t.Pieces)) > cbg.MaxLength { + if len(t.Pieces) > 8192 { return xerrors.Errorf("Slice value in field t.Pieces was too long") } @@ -6813,7 +6813,7 @@ func (t *SectorActivationManifest) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Pieces: array too large (%d)", extra) } @@ -6879,7 +6879,7 @@ func (t *PieceActivationManifest) MarshalCBOR(w io.Writer) error { } // t.Notify ([]miner.DataActivationNotification) (slice) - if uint64(len(t.Notify)) > cbg.MaxLength { + if len(t.Notify) > 8192 { return xerrors.Errorf("Slice value in field t.Notify was too long") } @@ -6970,7 +6970,7 @@ func (t *PieceActivationManifest) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Notify: array too large (%d)", extra) } @@ -7107,7 +7107,7 @@ func (t *DataActivationNotification) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -7161,7 +7161,7 @@ func (t *DataActivationNotification) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7200,7 +7200,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]miner.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -7260,7 +7260,7 @@ func (t *BatchReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -7368,10 +7368,10 @@ func (t *FailCode) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7408,7 +7408,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.SectorUpdates ([]miner.SectorUpdateManifest) (slice) - if uint64(len(t.SectorUpdates)) > cbg.MaxLength { + if len(t.SectorUpdates) > 8192 { return xerrors.Errorf("Slice value in field t.SectorUpdates was too long") } @@ -7423,7 +7423,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.SectorProofs ([][]uint8) (slice) - if uint64(len(t.SectorProofs)) > cbg.MaxLength { + if len(t.SectorProofs) > 8192 { return xerrors.Errorf("Slice value in field t.SectorProofs was too long") } @@ -7431,7 +7431,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.SectorProofs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -7446,7 +7446,7 @@ func (t *ProveReplicaUpdates3Params) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -7528,7 +7528,7 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorUpdates: array too large (%d)", extra) } @@ -7566,7 +7566,7 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorProofs: array too large (%d)", extra) } @@ -7592,7 +7592,7 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SectorProofs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7616,7 +7616,7 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7634,10 +7634,10 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofsType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7667,11 +7667,11 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - maj, extra, err = cr.ReadHeader() - var extraI int64 + maj, extra, err := cr.ReadHeader() if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7687,9 +7687,9 @@ func (t *ProveReplicaUpdates3Params) UnmarshalCBOR(r io.Reader) (err error) { default: return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.AggregateProofType = &extraI - } + t.AggregateProofType = (*abi.RegisteredAggregationProof)(&extraI) + } } // t.RequireActivationSuccess (bool) (bool) @@ -7767,7 +7767,7 @@ func (t *SectorUpdateManifest) MarshalCBOR(w io.Writer) error { } // t.Pieces ([]miner.PieceActivationManifest) (slice) - if uint64(len(t.Pieces)) > cbg.MaxLength { + if len(t.Pieces) > 8192 { return xerrors.Errorf("Slice value in field t.Pieces was too long") } @@ -7867,7 +7867,7 @@ func (t *SectorUpdateManifest) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Pieces: array too large (%d)", extra) } @@ -7933,7 +7933,7 @@ func (t *SectorChanges) MarshalCBOR(w io.Writer) error { } // t.Added ([]miner.PieceChange) (slice) - if uint64(len(t.Added)) > cbg.MaxLength { + if len(t.Added) > 8192 { return xerrors.Errorf("Slice value in field t.Added was too long") } @@ -7989,10 +7989,10 @@ func (t *SectorChanges) UnmarshalCBOR(r io.Reader) (err error) { // t.MinimumCommitmentEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -8018,7 +8018,7 @@ func (t *SectorChanges) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Added: array too large (%d)", extra) } @@ -8079,7 +8079,7 @@ func (t *PieceChange) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -8150,7 +8150,7 @@ func (t *PieceChange) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -8468,10 +8468,10 @@ func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -8704,7 +8704,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -8731,7 +8731,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -8830,7 +8830,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -8869,10 +8869,10 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -8898,7 +8898,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -8961,7 +8961,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -8988,7 +8988,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -9099,7 +9099,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -9138,10 +9138,10 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -9167,7 +9167,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -9217,7 +9217,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { + if len(t.SectorsWithClaims) > 8192 { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -9312,7 +9312,7 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorsWithClaims: array too large (%d)", extra) } @@ -9346,10 +9346,10 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -9392,7 +9392,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.MaintainClaims)) > cbg.MaxLength { + if len(t.MaintainClaims) > 8192 { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -9408,7 +9408,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.DropClaims)) > cbg.MaxLength { + if len(t.DropClaims) > 8192 { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } @@ -9469,7 +9469,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.MaintainClaims: array too large (%d)", extra) } @@ -9512,7 +9512,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DropClaims: array too large (%d)", extra) } diff --git a/builtin/v13/multisig/cbor_gen.go b/builtin/v13/multisig/cbor_gen.go index c28dfdf4..c9a552a1 100644 --- a/builtin/v13/multisig/cbor_gen.go +++ b/builtin/v13/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -133,7 +133,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -181,10 +181,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NextTxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -240,10 +240,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if uint64(len(t.Approved)) > cbg.MaxLength { + if len(t.Approved) > 8192 { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -399,7 +399,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -421,7 +421,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Approved: array too large (%d)", extra) } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -577,7 +577,7 @@ func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -685,7 +685,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -733,10 +733,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -758,10 +758,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -814,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -891,7 +891,7 @@ func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -951,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -992,10 +992,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.TxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1034,10 +1034,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1063,7 +1063,7 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1263,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { + if len(t.ProposalHash) > 2097152 { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1304,10 +1304,10 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1333,7 +1333,7 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ProposalHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1382,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1440,10 +1440,10 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1469,7 +1469,7 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1689,10 +1689,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1714,10 +1714,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v13/paych/cbor_gen.go b/builtin/v13/paych/cbor_gen.go index b4e06f44..1bff11b5 100644 --- a/builtin/v13/paych/cbor_gen.go +++ b/builtin/v13/paych/cbor_gen.go @@ -133,10 +133,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.SettlingAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -158,10 +158,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { + if len(t.Secret) > 2097152 { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -416,7 +416,7 @@ func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Secret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { + if len(t.SecretHash) > 2097152 { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if uint64(len(t.Merges)) > cbg.MaxLength { + if len(t.Merges) > 8192 { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -578,10 +578,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -603,10 +603,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -632,7 +632,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SecretHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -706,10 +706,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -735,7 +735,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Merges: array too large (%d)", extra) } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { + if len(t.Data) > 2097152 { return xerrors.Errorf("Byte array in field t.Data was too long") } @@ -882,7 +882,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Data: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/power/cbor_gen.go b/builtin/v13/power/cbor_gen.go index 827e4263..4b3371b7 100644 --- a/builtin/v13/power/cbor_gen.go +++ b/builtin/v13/power/cbor_gen.go @@ -246,10 +246,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -271,10 +271,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerAboveMinPowerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,10 +308,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.FirstCronEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -430,10 +430,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -679,7 +679,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -713,10 +713,10 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -742,7 +742,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -764,7 +764,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -790,7 +790,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { + if len(t.Peer) > 2097152 { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -927,10 +927,10 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -956,7 +956,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Peer: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -978,7 +978,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -1004,7 +1004,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1259,10 +1259,10 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { // t.EventEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1288,7 +1288,7 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1404,7 +1404,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { + if len(t.CallbackPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } @@ -1458,7 +1458,7 @@ func (t *CronEvent) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.CallbackPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v13/reward/cbor_gen.go b/builtin/v13/reward/cbor_gen.go index ec29a320..568037e7 100644 --- a/builtin/v13/reward/cbor_gen.go +++ b/builtin/v13/reward/cbor_gen.go @@ -146,10 +146,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveNetworkTime (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -207,10 +207,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -425,10 +425,10 @@ func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WinCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v13/verifreg/cbor_gen.go b/builtin/v13/verifreg/cbor_gen.go index e16c254b..777358be 100644 --- a/builtin/v13/verifreg/cbor_gen.go +++ b/builtin/v13/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if uint64(len(t.AllocationIds)) > cbg.MaxLength { + if len(t.AllocationIds) > 8192 { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -699,7 +699,7 @@ func (t *RemoveExpiredAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.AllocationIds: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -810,7 +810,7 @@ func (t *RemoveExpiredAllocationsReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -948,7 +948,7 @@ func (t *BatchReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1048,7 +1048,7 @@ func (t *ClaimAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1251,7 +1251,7 @@ func (t *GetClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if uint64(len(t.Claims)) > cbg.MaxLength { + if len(t.Claims) > 8192 { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1365,7 +1365,7 @@ func (t *GetClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Claims: array too large (%d)", extra) } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1479,7 +1479,7 @@ func (t *UniversalReceiverParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if uint64(len(t.NewAllocations)) > cbg.MaxLength { + if len(t.NewAllocations) > 8192 { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1587,7 +1587,7 @@ func (t *AllocationsResponse) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewAllocations: array too large (%d)", extra) } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if uint64(len(t.Terms)) > cbg.MaxLength { + if len(t.Terms) > 8192 { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1687,7 +1687,7 @@ func (t *ExtendClaimTermsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terms: array too large (%d)", extra) } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1802,7 +1802,7 @@ func (t *ExtendClaimTermsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1918,7 +1918,7 @@ func (t *RemoveExpiredClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2024,7 +2024,7 @@ func (t *RemoveExpiredClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -2363,10 +2363,10 @@ func (t *FailCode) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2540,10 +2540,10 @@ func (t *SectorAllocationClaim) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2725,10 +2725,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2750,10 +2750,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2775,10 +2775,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2908,10 +2908,10 @@ func (t *ClaimTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3021,10 +3021,10 @@ func (t *ClaimExtensionRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3200,10 +3200,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3225,10 +3225,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3250,10 +3250,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3409,10 +3409,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3434,10 +3434,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3459,10 +3459,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3499,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if uint64(len(t.Allocations)) > cbg.MaxLength { + if len(t.Allocations) > 8192 { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3514,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3560,7 +3560,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Allocations: array too large (%d)", extra) } @@ -3598,7 +3598,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } diff --git a/builtin/v8/cron/cbor_gen.go b/builtin/v8/cron/cbor_gen.go index 73deb41d..b00c94d4 100644 --- a/builtin/v8/cron/cbor_gen.go +++ b/builtin/v8/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if uint64(len(t.Entries)) > cbg.MaxLength { + if len(t.Entries) > 8192 { return xerrors.Errorf("Slice value in field t.Entries was too long") } @@ -80,7 +80,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Entries: array too large (%d)", extra) } diff --git a/builtin/v8/init/cbor_gen.go b/builtin/v8/init/cbor_gen.go index ddb5664f..253a32d2 100644 --- a/builtin/v8/init/cbor_gen.go +++ b/builtin/v8/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -111,7 +111,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -175,7 +175,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -263,7 +263,7 @@ func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v8/market/cbor_gen.go b/builtin/v8/market/cbor_gen.go index 4cfec096..1d05e974 100644 --- a/builtin/v8/market/cbor_gen.go +++ b/builtin/v8/market/cbor_gen.go @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.LastCron (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -343,10 +343,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorStartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -368,10 +368,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.LastUpdatedEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -393,10 +393,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SlashEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -503,7 +503,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -549,7 +549,7 @@ func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -598,7 +598,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if uint64(len(t.IDs)) > cbg.MaxLength { + if len(t.IDs) > 8192 { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -650,7 +650,7 @@ func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.IDs: array too large (%d)", extra) } @@ -713,7 +713,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -772,7 +772,7 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -811,10 +811,10 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -851,7 +851,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -897,7 +897,7 @@ func (t *VerifyDealsForActivationParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -946,7 +946,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorWeights) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -992,7 +992,7 @@ func (t *VerifyDealsForActivationReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1041,7 +1041,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if uint64(len(t.Inputs)) > cbg.MaxLength { + if len(t.Inputs) > 8192 { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1087,7 +1087,7 @@ func (t *ComputeDataCommitmentParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Inputs: array too large (%d)", extra) } @@ -1146,7 +1146,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if uint64(len(t.CommDs)) > cbg.MaxLength { + if len(t.CommDs) > 8192 { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1192,7 +1192,7 @@ func (t *ComputeDataCommitmentReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.CommDs: array too large (%d)", extra) } @@ -1252,7 +1252,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1295,10 +1295,10 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1324,7 +1324,7 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1544,10 +1544,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1569,10 +1569,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.EndEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1717,7 +1717,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1760,10 +1760,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1789,7 +1789,7 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1933,7 +1933,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1992,7 +1992,7 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2031,10 +2031,10 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v8/miner/cbor_gen.go b/builtin/v8/miner/cbor_gen.go index cd1a1b73..2a94c42a 100644 --- a/builtin/v8/miner/cbor_gen.go +++ b/builtin/v8/miner/cbor_gen.go @@ -260,10 +260,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.ProvingPeriodStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if uint64(len(t.ControlAddresses)) > cbg.MaxLength { + if len(t.ControlAddresses) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -382,7 +382,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -395,7 +395,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -403,7 +403,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -506,7 +506,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddresses: array too large (%d)", extra) } @@ -563,7 +563,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -585,7 +585,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -611,7 +611,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -631,10 +631,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -684,10 +684,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ConsensusFaultElapsed (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -743,7 +743,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if uint64(len(t.Due)) > cbg.MaxLength { + if len(t.Due) > 8192 { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -790,7 +790,7 @@ func (t *Deadlines) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Due: array too large (%d)", extra) } @@ -1537,10 +1537,10 @@ func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PreCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1629,7 +1629,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1707,10 +1707,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1758,10 +1758,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1787,7 +1787,7 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1826,10 +1826,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1948,7 +1948,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2081,10 +2081,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2122,7 +2122,7 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2161,10 +2161,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Activation (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2186,10 +2186,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2256,10 +2256,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ReplacedSectorAge (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2380,10 +2380,10 @@ func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2420,7 +2420,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if uint64(len(t.Funds)) > cbg.MaxLength { + if len(t.Funds) > 8192 { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2466,7 +2466,7 @@ func (t *VestingFunds) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Funds: array too large (%d)", extra) } @@ -2558,10 +2558,10 @@ func (t *VestingFund) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2612,7 +2612,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2667,7 +2667,7 @@ func (t *WindowedPoSt) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -2726,7 +2726,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -2790,7 +2790,7 @@ func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -2844,7 +2844,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { + if len(t.NewControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -2899,7 +2899,7 @@ func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewControlAddrs: array too large (%d)", extra) } @@ -2948,7 +2948,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { + if len(t.NewID) > 2097152 { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -2993,7 +2993,7 @@ func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewID: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3032,7 +3032,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if uint64(len(t.Partitions)) > cbg.MaxLength { + if len(t.Partitions) > 8192 { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3047,7 +3047,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3073,7 +3073,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { + if len(t.ChainCommitRand) > 2097152 { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3132,7 +3132,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Partitions: array too large (%d)", extra) } @@ -3170,7 +3170,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -3204,10 +3204,10 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ChainCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3233,7 +3233,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ChainCommitRand: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3300,7 +3300,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3378,10 +3378,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3429,10 +3429,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3458,7 +3458,7 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -3497,10 +3497,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3602,7 +3602,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { + if len(t.Proof) > 2097152 { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3661,7 +3661,7 @@ func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Proof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3694,7 +3694,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3740,7 +3740,7 @@ func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -3789,7 +3789,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if uint64(len(t.Terminations)) > cbg.MaxLength { + if len(t.Terminations) > 8192 { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -3835,7 +3835,7 @@ func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terminations: array too large (%d)", extra) } @@ -3948,7 +3948,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if uint64(len(t.Faults)) > cbg.MaxLength { + if len(t.Faults) > 8192 { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -3994,7 +3994,7 @@ func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Faults: array too large (%d)", extra) } @@ -4043,7 +4043,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if uint64(len(t.Recoveries)) > cbg.MaxLength { + if len(t.Recoveries) > 8192 { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4089,7 +4089,7 @@ func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Recoveries: array too large (%d)", extra) } @@ -4138,7 +4138,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { + if len(t.EventPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4192,7 +4192,7 @@ func (t *DeferredCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EventPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4376,7 +4376,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader1) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4389,7 +4389,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader2) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4402,7 +4402,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeaderExtra) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4447,7 +4447,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader1: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4469,7 +4469,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader2: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4491,7 +4491,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeaderExtra: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4580,7 +4580,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -4642,7 +4642,7 @@ func (t *ConfirmSectorProofsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -4723,7 +4723,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { + if len(t.NewMultiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -4731,7 +4731,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -4777,7 +4777,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewMultiaddrs: array too large (%d)", extra) } @@ -4803,7 +4803,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewMultiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5053,7 +5053,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5099,7 +5099,7 @@ func (t *PreCommitSectorBatchParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5153,7 +5153,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5207,7 +5207,7 @@ func (t *ProveCommitAggregateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5240,7 +5240,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5286,7 +5286,7 @@ func (t *ProveReplicaUpdatesParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -5374,10 +5374,10 @@ func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) (err error) { // t.EventType (miner.CronEventType) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5699,10 +5699,10 @@ func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5935,7 +5935,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -5962,7 +5962,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -6061,7 +6061,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -6100,10 +6100,10 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6129,7 +6129,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v8/multisig/cbor_gen.go b/builtin/v8/multisig/cbor_gen.go index c28dfdf4..c9a552a1 100644 --- a/builtin/v8/multisig/cbor_gen.go +++ b/builtin/v8/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -133,7 +133,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -181,10 +181,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NextTxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -240,10 +240,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if uint64(len(t.Approved)) > cbg.MaxLength { + if len(t.Approved) > 8192 { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -399,7 +399,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -421,7 +421,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Approved: array too large (%d)", extra) } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -577,7 +577,7 @@ func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -685,7 +685,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -733,10 +733,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -758,10 +758,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -814,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -891,7 +891,7 @@ func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -951,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -992,10 +992,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.TxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1034,10 +1034,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1063,7 +1063,7 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1263,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { + if len(t.ProposalHash) > 2097152 { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1304,10 +1304,10 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1333,7 +1333,7 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ProposalHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1382,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1440,10 +1440,10 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1469,7 +1469,7 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1689,10 +1689,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1714,10 +1714,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v8/paych/cbor_gen.go b/builtin/v8/paych/cbor_gen.go index b4e06f44..1bff11b5 100644 --- a/builtin/v8/paych/cbor_gen.go +++ b/builtin/v8/paych/cbor_gen.go @@ -133,10 +133,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.SettlingAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -158,10 +158,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { + if len(t.Secret) > 2097152 { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -416,7 +416,7 @@ func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Secret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { + if len(t.SecretHash) > 2097152 { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if uint64(len(t.Merges)) > cbg.MaxLength { + if len(t.Merges) > 8192 { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -578,10 +578,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -603,10 +603,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -632,7 +632,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SecretHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -706,10 +706,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -735,7 +735,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Merges: array too large (%d)", extra) } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { + if len(t.Data) > 2097152 { return xerrors.Errorf("Byte array in field t.Data was too long") } @@ -882,7 +882,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Data: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v8/power/cbor_gen.go b/builtin/v8/power/cbor_gen.go index d28e889e..c09ca4f4 100644 --- a/builtin/v8/power/cbor_gen.go +++ b/builtin/v8/power/cbor_gen.go @@ -246,10 +246,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -271,10 +271,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerAboveMinPowerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,10 +308,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.FirstCronEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -430,10 +430,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -679,7 +679,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -713,10 +713,10 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -742,7 +742,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -764,7 +764,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -790,7 +790,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { + if len(t.Peer) > 2097152 { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -927,10 +927,10 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -956,7 +956,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Peer: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -978,7 +978,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -1004,7 +1004,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1259,10 +1259,10 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { // t.EventEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1288,7 +1288,7 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1326,7 +1326,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { + if len(t.CallbackPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } @@ -1380,7 +1380,7 @@ func (t *CronEvent) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.CallbackPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v8/reward/cbor_gen.go b/builtin/v8/reward/cbor_gen.go index ec29a320..568037e7 100644 --- a/builtin/v8/reward/cbor_gen.go +++ b/builtin/v8/reward/cbor_gen.go @@ -146,10 +146,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveNetworkTime (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -207,10 +207,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -425,10 +425,10 @@ func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WinCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v9/account/cbor_gen.go b/builtin/v9/account/cbor_gen.go index 0bd09be2..55e97f33 100644 --- a/builtin/v9/account/cbor_gen.go +++ b/builtin/v9/account/cbor_gen.go @@ -89,7 +89,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Signature ([]uint8) (slice) - if uint64(len(t.Signature)) > cbg.ByteArrayMaxLen { + if len(t.Signature) > 2097152 { return xerrors.Errorf("Byte array in field t.Signature was too long") } @@ -102,7 +102,7 @@ func (t *AuthenticateMessageParams) MarshalCBOR(w io.Writer) error { } // t.Message ([]uint8) (slice) - if uint64(len(t.Message)) > cbg.ByteArrayMaxLen { + if len(t.Message) > 2097152 { return xerrors.Errorf("Byte array in field t.Message was too long") } @@ -147,7 +147,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Signature: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -169,7 +169,7 @@ func (t *AuthenticateMessageParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Message: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v9/cron/cbor_gen.go b/builtin/v9/cron/cbor_gen.go index 73deb41d..b00c94d4 100644 --- a/builtin/v9/cron/cbor_gen.go +++ b/builtin/v9/cron/cbor_gen.go @@ -34,7 +34,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Entries ([]cron.Entry) (slice) - if uint64(len(t.Entries)) > cbg.MaxLength { + if len(t.Entries) > 8192 { return xerrors.Errorf("Slice value in field t.Entries was too long") } @@ -80,7 +80,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Entries: array too large (%d)", extra) } diff --git a/builtin/v9/datacap/cbor_gen.go b/builtin/v9/datacap/cbor_gen.go index 42c936a6..11e7cbb1 100644 --- a/builtin/v9/datacap/cbor_gen.go +++ b/builtin/v9/datacap/cbor_gen.go @@ -227,7 +227,7 @@ func (t *MintParams) MarshalCBOR(w io.Writer) error { } // t.Operators ([]address.Address) (slice) - if uint64(len(t.Operators)) > cbg.MaxLength { + if len(t.Operators) > 8192 { return xerrors.Errorf("Slice value in field t.Operators was too long") } @@ -291,7 +291,7 @@ func (t *MintParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Operators: array too large (%d)", extra) } @@ -350,7 +350,7 @@ func (t *MintReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -413,7 +413,7 @@ func (t *MintReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -526,7 +526,7 @@ func (t *TransferParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -589,7 +589,7 @@ func (t *TransferParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -632,7 +632,7 @@ func (t *TransferReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -695,7 +695,7 @@ func (t *TransferReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -743,7 +743,7 @@ func (t *TransferFromParams) MarshalCBOR(w io.Writer) error { } // t.OperatorData ([]uint8) (slice) - if uint64(len(t.OperatorData)) > cbg.ByteArrayMaxLen { + if len(t.OperatorData) > 2097152 { return xerrors.Errorf("Byte array in field t.OperatorData was too long") } @@ -815,7 +815,7 @@ func (t *TransferFromParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.OperatorData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -863,7 +863,7 @@ func (t *TransferFromReturn) MarshalCBOR(w io.Writer) error { } // t.RecipientData ([]uint8) (slice) - if uint64(len(t.RecipientData)) > cbg.ByteArrayMaxLen { + if len(t.RecipientData) > 2097152 { return xerrors.Errorf("Byte array in field t.RecipientData was too long") } @@ -935,7 +935,7 @@ func (t *TransferFromReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.RecipientData: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v9/init/cbor_gen.go b/builtin/v9/init/cbor_gen.go index ddb5664f..253a32d2 100644 --- a/builtin/v9/init/cbor_gen.go +++ b/builtin/v9/init/cbor_gen.go @@ -46,7 +46,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -111,7 +111,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -136,7 +136,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.NetworkName (string) (string) - if uint64(len(t.NetworkName)) > cbg.MaxLength { + if len(t.NetworkName) > 8192 { return xerrors.Errorf("Value in field t.NetworkName was too long") } @@ -175,7 +175,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NetworkName (string) (string) { - sval, err := cbg.ReadString(cr) + sval, err := cbg.ReadStringWithMax(cr, 8192) if err != nil { return err } @@ -206,7 +206,7 @@ func (t *ExecParams) MarshalCBOR(w io.Writer) error { } // t.ConstructorParams ([]uint8) (slice) - if uint64(len(t.ConstructorParams)) > cbg.ByteArrayMaxLen { + if len(t.ConstructorParams) > 2097152 { return xerrors.Errorf("Byte array in field t.ConstructorParams was too long") } @@ -263,7 +263,7 @@ func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ConstructorParams: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v9/market/cbor_gen.go b/builtin/v9/market/cbor_gen.go index f8939df4..3f42e55c 100644 --- a/builtin/v9/market/cbor_gen.go +++ b/builtin/v9/market/cbor_gen.go @@ -223,10 +223,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.LastCron (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -369,10 +369,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorStartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -394,10 +394,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.LastUpdatedEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -419,10 +419,10 @@ func (t *DealState) UnmarshalCBOR(r io.Reader) (err error) { // t.SlashEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -543,7 +543,7 @@ func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error { } // t.Deals ([]market.ClientDealProposal) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -589,7 +589,7 @@ func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -638,7 +638,7 @@ func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error { } // t.IDs ([]abi.DealID) (slice) - if uint64(len(t.IDs)) > cbg.MaxLength { + if len(t.IDs) > 8192 { return xerrors.Errorf("Slice value in field t.IDs was too long") } @@ -690,7 +690,7 @@ func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.IDs: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *ActivateDealsParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -812,7 +812,7 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -851,10 +851,10 @@ func (t *ActivateDealsParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -896,7 +896,7 @@ func (t *ActivateDealsResult) MarshalCBOR(w io.Writer) error { } // t.VerifiedInfos ([]market.VerifiedDealInfo) (slice) - if uint64(len(t.VerifiedInfos)) > cbg.MaxLength { + if len(t.VerifiedInfos) > 8192 { return xerrors.Errorf("Slice value in field t.VerifiedInfos was too long") } @@ -951,7 +951,7 @@ func (t *ActivateDealsResult) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.VerifiedInfos: array too large (%d)", extra) } @@ -1000,7 +1000,7 @@ func (t *VerifyDealsForActivationParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDeals) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1046,7 +1046,7 @@ func (t *VerifyDealsForActivationParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1095,7 +1095,7 @@ func (t *VerifyDealsForActivationReturn) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]market.SectorDealData) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1141,7 +1141,7 @@ func (t *VerifyDealsForActivationReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error { } // t.Inputs ([]*market.SectorDataSpec) (slice) - if uint64(len(t.Inputs)) > cbg.MaxLength { + if len(t.Inputs) > 8192 { return xerrors.Errorf("Slice value in field t.Inputs was too long") } @@ -1236,7 +1236,7 @@ func (t *ComputeDataCommitmentParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Inputs: array too large (%d)", extra) } @@ -1295,7 +1295,7 @@ func (t *ComputeDataCommitmentReturn) MarshalCBOR(w io.Writer) error { } // t.CommDs ([]typegen.CborCid) (slice) - if uint64(len(t.CommDs)) > cbg.MaxLength { + if len(t.CommDs) > 8192 { return xerrors.Errorf("Slice value in field t.CommDs was too long") } @@ -1341,7 +1341,7 @@ func (t *ComputeDataCommitmentReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.CommDs: array too large (%d)", extra) } @@ -1401,7 +1401,7 @@ func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1444,10 +1444,10 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1473,7 +1473,7 @@ func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1693,10 +1693,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1718,10 +1718,10 @@ func (t *DealProposal) UnmarshalCBOR(r io.Reader) (err error) { // t.EndEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1877,7 +1877,7 @@ func (t *SectorDeals) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1920,10 +1920,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1945,10 +1945,10 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1974,7 +1974,7 @@ func (t *SectorDeals) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2175,7 +2175,7 @@ func (t *SectorDataSpec) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2234,7 +2234,7 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2273,10 +2273,10 @@ func (t *SectorDataSpec) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorType (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v9/miner/cbor_gen.go b/builtin/v9/miner/cbor_gen.go index 5dc35eda..15deb937 100644 --- a/builtin/v9/miner/cbor_gen.go +++ b/builtin/v9/miner/cbor_gen.go @@ -261,10 +261,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.ProvingPeriodStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -363,7 +363,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.ControlAddresses ([]address.Address) (slice) - if uint64(len(t.ControlAddresses)) > cbg.MaxLength { + if len(t.ControlAddresses) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddresses was too long") } @@ -383,7 +383,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -396,7 +396,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -404,7 +404,7 @@ func (t *MinerInfo) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -522,7 +522,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddresses: array too large (%d)", extra) } @@ -579,7 +579,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -601,7 +601,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -627,7 +627,7 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -647,10 +647,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -700,10 +700,10 @@ func (t *MinerInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ConsensusFaultElapsed (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -796,7 +796,7 @@ func (t *Deadlines) MarshalCBOR(w io.Writer) error { } // t.Due ([48]cid.Cid) (array) - if uint64(len(t.Due)) > cbg.MaxLength { + if len(t.Due) > 8192 { return xerrors.Errorf("Slice value in field t.Due was too long") } @@ -843,7 +843,7 @@ func (t *Deadlines) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Due: array too large (%d)", extra) } @@ -1581,10 +1581,10 @@ func (t *SectorPreCommitOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.PreCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1655,7 +1655,7 @@ func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -1722,10 +1722,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1773,10 +1773,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1802,7 +1802,7 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -1841,10 +1841,10 @@ func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1926,7 +1926,7 @@ func (t *SectorOnChainInfo) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -2063,10 +2063,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2104,7 +2104,7 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -2143,10 +2143,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Activation (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2168,10 +2168,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2238,10 +2238,10 @@ func (t *SectorOnChainInfo) UnmarshalCBOR(r io.Reader) (err error) { // t.ReplacedSectorAge (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2379,10 +2379,10 @@ func (t *WorkerKeyChange) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2419,7 +2419,7 @@ func (t *VestingFunds) MarshalCBOR(w io.Writer) error { } // t.Funds ([]miner.VestingFund) (slice) - if uint64(len(t.Funds)) > cbg.MaxLength { + if len(t.Funds) > 8192 { return xerrors.Errorf("Slice value in field t.Funds was too long") } @@ -2465,7 +2465,7 @@ func (t *VestingFunds) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Funds: array too large (%d)", extra) } @@ -2557,10 +2557,10 @@ func (t *VestingFund) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2611,7 +2611,7 @@ func (t *WindowedPoSt) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -2666,7 +2666,7 @@ func (t *WindowedPoSt) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -2852,10 +2852,10 @@ func (t *BeneficiaryTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2968,10 +2968,10 @@ func (t *PendingBeneficiaryChange) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3052,7 +3052,7 @@ func (t *GetControlAddressesReturn) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -3116,7 +3116,7 @@ func (t *GetControlAddressesReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -3170,7 +3170,7 @@ func (t *ChangeWorkerAddressParams) MarshalCBOR(w io.Writer) error { } // t.NewControlAddrs ([]address.Address) (slice) - if uint64(len(t.NewControlAddrs)) > cbg.MaxLength { + if len(t.NewControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewControlAddrs was too long") } @@ -3225,7 +3225,7 @@ func (t *ChangeWorkerAddressParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewControlAddrs: array too large (%d)", extra) } @@ -3274,7 +3274,7 @@ func (t *ChangePeerIDParams) MarshalCBOR(w io.Writer) error { } // t.NewID ([]uint8) (slice) - if uint64(len(t.NewID)) > cbg.ByteArrayMaxLen { + if len(t.NewID) > 2097152 { return xerrors.Errorf("Byte array in field t.NewID was too long") } @@ -3319,7 +3319,7 @@ func (t *ChangePeerIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewID: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3358,7 +3358,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Partitions ([]miner.PoStPartition) (slice) - if uint64(len(t.Partitions)) > cbg.MaxLength { + if len(t.Partitions) > 8192 { return xerrors.Errorf("Slice value in field t.Partitions was too long") } @@ -3373,7 +3373,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.Proofs ([]proof.PoStProof) (slice) - if uint64(len(t.Proofs)) > cbg.MaxLength { + if len(t.Proofs) > 8192 { return xerrors.Errorf("Slice value in field t.Proofs was too long") } @@ -3399,7 +3399,7 @@ func (t *SubmitWindowedPoStParams) MarshalCBOR(w io.Writer) error { } // t.ChainCommitRand (abi.Randomness) (slice) - if uint64(len(t.ChainCommitRand)) > cbg.ByteArrayMaxLen { + if len(t.ChainCommitRand) > 2097152 { return xerrors.Errorf("Byte array in field t.ChainCommitRand was too long") } @@ -3458,7 +3458,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Partitions: array too large (%d)", extra) } @@ -3496,7 +3496,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Proofs: array too large (%d)", extra) } @@ -3530,10 +3530,10 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ChainCommitEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3559,7 +3559,7 @@ func (t *SubmitWindowedPoStParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ChainCommitRand: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -3626,7 +3626,7 @@ func (t *PreCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.DealIDs ([]abi.DealID) (slice) - if uint64(len(t.DealIDs)) > cbg.MaxLength { + if len(t.DealIDs) > 8192 { return xerrors.Errorf("Slice value in field t.DealIDs was too long") } @@ -3704,10 +3704,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealProof (abi.RegisteredSealProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3755,10 +3755,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.SealRandEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3784,7 +3784,7 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DealIDs: array too large (%d)", extra) } @@ -3823,10 +3823,10 @@ func (t *PreCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3928,7 +3928,7 @@ func (t *ProveCommitSectorParams) MarshalCBOR(w io.Writer) error { } // t.Proof ([]uint8) (slice) - if uint64(len(t.Proof)) > cbg.ByteArrayMaxLen { + if len(t.Proof) > 2097152 { return xerrors.Errorf("Byte array in field t.Proof was too long") } @@ -3987,7 +3987,7 @@ func (t *ProveCommitSectorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Proof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4020,7 +4020,7 @@ func (t *ExtendSectorExpirationParams) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4066,7 +4066,7 @@ func (t *ExtendSectorExpirationParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4115,7 +4115,7 @@ func (t *ExtendSectorExpiration2Params) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]miner.ExpirationExtension2) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -4161,7 +4161,7 @@ func (t *ExtendSectorExpiration2Params) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } @@ -4210,7 +4210,7 @@ func (t *TerminateSectorsParams) MarshalCBOR(w io.Writer) error { } // t.Terminations ([]miner.TerminationDeclaration) (slice) - if uint64(len(t.Terminations)) > cbg.MaxLength { + if len(t.Terminations) > 8192 { return xerrors.Errorf("Slice value in field t.Terminations was too long") } @@ -4256,7 +4256,7 @@ func (t *TerminateSectorsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terminations: array too large (%d)", extra) } @@ -4369,7 +4369,7 @@ func (t *DeclareFaultsParams) MarshalCBOR(w io.Writer) error { } // t.Faults ([]miner.FaultDeclaration) (slice) - if uint64(len(t.Faults)) > cbg.MaxLength { + if len(t.Faults) > 8192 { return xerrors.Errorf("Slice value in field t.Faults was too long") } @@ -4415,7 +4415,7 @@ func (t *DeclareFaultsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Faults: array too large (%d)", extra) } @@ -4464,7 +4464,7 @@ func (t *DeclareFaultsRecoveredParams) MarshalCBOR(w io.Writer) error { } // t.Recoveries ([]miner.RecoveryDeclaration) (slice) - if uint64(len(t.Recoveries)) > cbg.MaxLength { + if len(t.Recoveries) > 8192 { return xerrors.Errorf("Slice value in field t.Recoveries was too long") } @@ -4510,7 +4510,7 @@ func (t *DeclareFaultsRecoveredParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Recoveries: array too large (%d)", extra) } @@ -4559,7 +4559,7 @@ func (t *DeferredCronEventParams) MarshalCBOR(w io.Writer) error { } // t.EventPayload ([]uint8) (slice) - if uint64(len(t.EventPayload)) > cbg.ByteArrayMaxLen { + if len(t.EventPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.EventPayload was too long") } @@ -4613,7 +4613,7 @@ func (t *DeferredCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.EventPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4797,7 +4797,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader1 ([]uint8) (slice) - if uint64(len(t.BlockHeader1)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader1) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader1 was too long") } @@ -4810,7 +4810,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeader2 ([]uint8) (slice) - if uint64(len(t.BlockHeader2)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeader2) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeader2 was too long") } @@ -4823,7 +4823,7 @@ func (t *ReportConsensusFaultParams) MarshalCBOR(w io.Writer) error { } // t.BlockHeaderExtra ([]uint8) (slice) - if uint64(len(t.BlockHeaderExtra)) > cbg.ByteArrayMaxLen { + if len(t.BlockHeaderExtra) > 2097152 { return xerrors.Errorf("Byte array in field t.BlockHeaderExtra was too long") } @@ -4868,7 +4868,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader1: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4890,7 +4890,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeader2: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -4912,7 +4912,7 @@ func (t *ReportConsensusFaultParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.BlockHeaderExtra: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5001,7 +5001,7 @@ func (t *ConfirmSectorProofsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]abi.SectorNumber) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5063,7 +5063,7 @@ func (t *ConfirmSectorProofsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5144,7 +5144,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { } // t.NewMultiaddrs ([][]uint8) (slice) - if uint64(len(t.NewMultiaddrs)) > cbg.MaxLength { + if len(t.NewMultiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.NewMultiaddrs was too long") } @@ -5152,7 +5152,7 @@ func (t *ChangeMultiaddrsParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.NewMultiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -5198,7 +5198,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewMultiaddrs: array too large (%d)", extra) } @@ -5224,7 +5224,7 @@ func (t *ChangeMultiaddrsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.NewMultiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5474,7 +5474,7 @@ func (t *PreCommitSectorBatchParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.PreCommitSectorParams) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5520,7 +5520,7 @@ func (t *PreCommitSectorBatchParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5574,7 +5574,7 @@ func (t *ProveCommitAggregateParams) MarshalCBOR(w io.Writer) error { } // t.AggregateProof ([]uint8) (slice) - if uint64(len(t.AggregateProof)) > cbg.ByteArrayMaxLen { + if len(t.AggregateProof) > 2097152 { return xerrors.Errorf("Byte array in field t.AggregateProof was too long") } @@ -5628,7 +5628,7 @@ func (t *ProveCommitAggregateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.AggregateProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -5661,7 +5661,7 @@ func (t *ProveReplicaUpdatesParams) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5707,7 +5707,7 @@ func (t *ProveReplicaUpdatesParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -5795,10 +5795,10 @@ func (t *CronEventPayload) UnmarshalCBOR(r io.Reader) (err error) { // t.EventType (miner.CronEventType) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -5835,7 +5835,7 @@ func (t *PreCommitSectorBatchParams2) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]miner.SectorPreCommitInfo) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -5881,7 +5881,7 @@ func (t *PreCommitSectorBatchParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -5930,7 +5930,7 @@ func (t *ProveReplicaUpdatesParams2) MarshalCBOR(w io.Writer) error { } // t.Updates ([]miner.ReplicaUpdate2) (slice) - if uint64(len(t.Updates)) > cbg.MaxLength { + if len(t.Updates) > 8192 { return xerrors.Errorf("Slice value in field t.Updates was too long") } @@ -5976,7 +5976,7 @@ func (t *ProveReplicaUpdatesParams2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Updates: array too large (%d)", extra) } @@ -6092,10 +6092,10 @@ func (t *ChangeBeneficiaryParams) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6497,10 +6497,10 @@ func (t *ExpirationExtension) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6733,7 +6733,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -6760,7 +6760,7 @@ func (t *ReplicaUpdate) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -6859,7 +6859,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -6898,10 +6898,10 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -6927,7 +6927,7 @@ func (t *ReplicaUpdate) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -6990,7 +6990,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.Deals ([]abi.DealID) (slice) - if uint64(len(t.Deals)) > cbg.MaxLength { + if len(t.Deals) > 8192 { return xerrors.Errorf("Slice value in field t.Deals was too long") } @@ -7017,7 +7017,7 @@ func (t *ReplicaUpdate2) MarshalCBOR(w io.Writer) error { } // t.ReplicaProof ([]uint8) (slice) - if uint64(len(t.ReplicaProof)) > cbg.ByteArrayMaxLen { + if len(t.ReplicaProof) > 2097152 { return xerrors.Errorf("Byte array in field t.ReplicaProof was too long") } @@ -7128,7 +7128,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Deals: array too large (%d)", extra) } @@ -7167,10 +7167,10 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { // t.UpdateProofType (abi.RegisteredUpdateProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7196,7 +7196,7 @@ func (t *ReplicaUpdate2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ReplicaProof: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -7246,7 +7246,7 @@ func (t *ExpirationExtension2) MarshalCBOR(w io.Writer) error { } // t.SectorsWithClaims ([]miner.SectorClaim) (slice) - if uint64(len(t.SectorsWithClaims)) > cbg.MaxLength { + if len(t.SectorsWithClaims) > 8192 { return xerrors.Errorf("Slice value in field t.SectorsWithClaims was too long") } @@ -7341,7 +7341,7 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.SectorsWithClaims: array too large (%d)", extra) } @@ -7375,10 +7375,10 @@ func (t *ExpirationExtension2) UnmarshalCBOR(r io.Reader) (err error) { // t.NewExpiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -7421,7 +7421,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.MaintainClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.MaintainClaims)) > cbg.MaxLength { + if len(t.MaintainClaims) > 8192 { return xerrors.Errorf("Slice value in field t.MaintainClaims was too long") } @@ -7437,7 +7437,7 @@ func (t *SectorClaim) MarshalCBOR(w io.Writer) error { } // t.DropClaims ([]verifreg.ClaimId) (slice) - if uint64(len(t.DropClaims)) > cbg.MaxLength { + if len(t.DropClaims) > 8192 { return xerrors.Errorf("Slice value in field t.DropClaims was too long") } @@ -7498,7 +7498,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.MaintainClaims: array too large (%d)", extra) } @@ -7541,7 +7541,7 @@ func (t *SectorClaim) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.DropClaims: array too large (%d)", extra) } diff --git a/builtin/v9/multisig/cbor_gen.go b/builtin/v9/multisig/cbor_gen.go index c28dfdf4..c9a552a1 100644 --- a/builtin/v9/multisig/cbor_gen.go +++ b/builtin/v9/multisig/cbor_gen.go @@ -36,7 +36,7 @@ func (t *State) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -133,7 +133,7 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -181,10 +181,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.NextTxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -215,10 +215,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -240,10 +240,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,7 +308,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -321,7 +321,7 @@ func (t *Transaction) MarshalCBOR(w io.Writer) error { } // t.Approved ([]address.Address) (slice) - if uint64(len(t.Approved)) > cbg.MaxLength { + if len(t.Approved) > 8192 { return xerrors.Errorf("Slice value in field t.Approved was too long") } @@ -399,7 +399,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -421,7 +421,7 @@ func (t *Transaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Approved: array too large (%d)", extra) } @@ -491,7 +491,7 @@ func (t *ProposalHashData) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -577,7 +577,7 @@ func (t *ProposalHashData) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -610,7 +610,7 @@ func (t *ConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Signers ([]address.Address) (slice) - if uint64(len(t.Signers)) > cbg.MaxLength { + if len(t.Signers) > 8192 { return xerrors.Errorf("Slice value in field t.Signers was too long") } @@ -685,7 +685,7 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Signers: array too large (%d)", extra) } @@ -733,10 +733,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -758,10 +758,10 @@ func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -814,7 +814,7 @@ func (t *ProposeParams) MarshalCBOR(w io.Writer) error { } // t.Params ([]uint8) (slice) - if uint64(len(t.Params)) > cbg.ByteArrayMaxLen { + if len(t.Params) > 2097152 { return xerrors.Errorf("Byte array in field t.Params was too long") } @@ -891,7 +891,7 @@ func (t *ProposeParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Params: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -951,7 +951,7 @@ func (t *ProposeReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -992,10 +992,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.TxnID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1034,10 +1034,10 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1063,7 +1063,7 @@ func (t *ProposeReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1263,7 +1263,7 @@ func (t *TxnIDParams) MarshalCBOR(w io.Writer) error { } // t.ProposalHash ([]uint8) (slice) - if uint64(len(t.ProposalHash)) > cbg.ByteArrayMaxLen { + if len(t.ProposalHash) > 2097152 { return xerrors.Errorf("Byte array in field t.ProposalHash was too long") } @@ -1304,10 +1304,10 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { // t.ID (multisig.TxnID) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1333,7 +1333,7 @@ func (t *TxnIDParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.ProposalHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1382,7 +1382,7 @@ func (t *ApproveReturn) MarshalCBOR(w io.Writer) error { } // t.Ret ([]uint8) (slice) - if uint64(len(t.Ret)) > cbg.ByteArrayMaxLen { + if len(t.Ret) > 2097152 { return xerrors.Errorf("Byte array in field t.Ret was too long") } @@ -1440,10 +1440,10 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1469,7 +1469,7 @@ func (t *ApproveReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Ret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1689,10 +1689,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.StartEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1714,10 +1714,10 @@ func (t *LockBalanceParams) UnmarshalCBOR(r io.Reader) (err error) { // t.UnlockDuration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v9/paych/cbor_gen.go b/builtin/v9/paych/cbor_gen.go index b4e06f44..1bff11b5 100644 --- a/builtin/v9/paych/cbor_gen.go +++ b/builtin/v9/paych/cbor_gen.go @@ -133,10 +133,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.SettlingAt (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -158,10 +158,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -362,7 +362,7 @@ func (t *UpdateChannelStateParams) MarshalCBOR(w io.Writer) error { } // t.Secret ([]uint8) (slice) - if uint64(len(t.Secret)) > cbg.ByteArrayMaxLen { + if len(t.Secret) > 2097152 { return xerrors.Errorf("Byte array in field t.Secret was too long") } @@ -416,7 +416,7 @@ func (t *UpdateChannelStateParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Secret: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -476,7 +476,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.SecretHash ([]uint8) (slice) - if uint64(len(t.SecretHash)) > cbg.ByteArrayMaxLen { + if len(t.SecretHash) > 2097152 { return xerrors.Errorf("Byte array in field t.SecretHash was too long") } @@ -522,7 +522,7 @@ func (t *SignedVoucher) MarshalCBOR(w io.Writer) error { } // t.Merges ([]paych.Merge) (slice) - if uint64(len(t.Merges)) > cbg.MaxLength { + if len(t.Merges) > 8192 { return xerrors.Errorf("Slice value in field t.Merges was too long") } @@ -578,10 +578,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -603,10 +603,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.TimeLockMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -632,7 +632,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.SecretHash: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -706,10 +706,10 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { // t.MinSettleHeight (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -735,7 +735,7 @@ func (t *SignedVoucher) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Merges: array too large (%d)", extra) } @@ -814,7 +814,7 @@ func (t *ModVerifyParams) MarshalCBOR(w io.Writer) error { } // t.Data ([]uint8) (slice) - if uint64(len(t.Data)) > cbg.ByteArrayMaxLen { + if len(t.Data) > 2097152 { return xerrors.Errorf("Byte array in field t.Data was too long") } @@ -882,7 +882,7 @@ func (t *ModVerifyParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Data: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v9/power/cbor_gen.go b/builtin/v9/power/cbor_gen.go index d28e889e..c09ca4f4 100644 --- a/builtin/v9/power/cbor_gen.go +++ b/builtin/v9/power/cbor_gen.go @@ -246,10 +246,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -271,10 +271,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.MinerAboveMinPowerCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -308,10 +308,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.FirstCronEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -430,10 +430,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -568,7 +568,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.ControlAddrs ([]address.Address) (slice) - if uint64(len(t.ControlAddrs)) > cbg.MaxLength { + if len(t.ControlAddrs) > 8192 { return xerrors.Errorf("Slice value in field t.ControlAddrs was too long") } @@ -594,7 +594,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.PeerId ([]uint8) (slice) - if uint64(len(t.PeerId)) > cbg.ByteArrayMaxLen { + if len(t.PeerId) > 2097152 { return xerrors.Errorf("Byte array in field t.PeerId was too long") } @@ -607,7 +607,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -615,7 +615,7 @@ func (t *MinerConstructorParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -679,7 +679,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ControlAddrs: array too large (%d)", extra) } @@ -713,10 +713,10 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -742,7 +742,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.PeerId: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -764,7 +764,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -790,7 +790,7 @@ func (t *MinerConstructorParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -846,7 +846,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Peer ([]uint8) (slice) - if uint64(len(t.Peer)) > cbg.ByteArrayMaxLen { + if len(t.Peer) > 2097152 { return xerrors.Errorf("Byte array in field t.Peer was too long") } @@ -859,7 +859,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { } // t.Multiaddrs ([][]uint8) (slice) - if uint64(len(t.Multiaddrs)) > cbg.MaxLength { + if len(t.Multiaddrs) > 8192 { return xerrors.Errorf("Slice value in field t.Multiaddrs was too long") } @@ -867,7 +867,7 @@ func (t *CreateMinerParams) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Multiaddrs { - if uint64(len(v)) > cbg.ByteArrayMaxLen { + if len(v) > 2097152 { return xerrors.Errorf("Byte array in field v was too long") } @@ -927,10 +927,10 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WindowPoStProofType (abi.RegisteredPoStProof) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -956,7 +956,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Peer: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -978,7 +978,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Multiaddrs: array too large (%d)", extra) } @@ -1004,7 +1004,7 @@ func (t *CreateMinerParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Multiaddrs[i]: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1218,7 +1218,7 @@ func (t *EnrollCronEventParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1259,10 +1259,10 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { // t.EventEpoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -1288,7 +1288,7 @@ func (t *EnrollCronEventParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1326,7 +1326,7 @@ func (t *CronEvent) MarshalCBOR(w io.Writer) error { } // t.CallbackPayload ([]uint8) (slice) - if uint64(len(t.CallbackPayload)) > cbg.ByteArrayMaxLen { + if len(t.CallbackPayload) > 2097152 { return xerrors.Errorf("Byte array in field t.CallbackPayload was too long") } @@ -1380,7 +1380,7 @@ func (t *CronEvent) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.CallbackPayload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { diff --git a/builtin/v9/reward/cbor_gen.go b/builtin/v9/reward/cbor_gen.go index ec29a320..568037e7 100644 --- a/builtin/v9/reward/cbor_gen.go +++ b/builtin/v9/reward/cbor_gen.go @@ -146,10 +146,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.EffectiveNetworkTime (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -207,10 +207,10 @@ func (t *State) UnmarshalCBOR(r io.Reader) (err error) { // t.Epoch (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -425,10 +425,10 @@ func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) (err error) { // t.WinCount (int64) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) diff --git a/builtin/v9/verifreg/cbor_gen.go b/builtin/v9/verifreg/cbor_gen.go index e16c254b..777358be 100644 --- a/builtin/v9/verifreg/cbor_gen.go +++ b/builtin/v9/verifreg/cbor_gen.go @@ -638,7 +638,7 @@ func (t *RemoveExpiredAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.AllocationIds ([]verifreg.AllocationId) (slice) - if uint64(len(t.AllocationIds)) > cbg.MaxLength { + if len(t.AllocationIds) > 8192 { return xerrors.Errorf("Slice value in field t.AllocationIds was too long") } @@ -699,7 +699,7 @@ func (t *RemoveExpiredAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.AllocationIds: array too large (%d)", extra) } @@ -753,7 +753,7 @@ func (t *RemoveExpiredAllocationsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -810,7 +810,7 @@ func (t *RemoveExpiredAllocationsReturn) UnmarshalCBOR(r io.Reader) (err error) return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -888,7 +888,7 @@ func (t *BatchReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -948,7 +948,7 @@ func (t *BatchReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -997,7 +997,7 @@ func (t *ClaimAllocationsParams) MarshalCBOR(w io.Writer) error { } // t.Sectors ([]verifreg.SectorAllocationClaim) (slice) - if uint64(len(t.Sectors)) > cbg.MaxLength { + if len(t.Sectors) > 8192 { return xerrors.Errorf("Slice value in field t.Sectors was too long") } @@ -1048,7 +1048,7 @@ func (t *ClaimAllocationsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Sectors: array too large (%d)", extra) } @@ -1190,7 +1190,7 @@ func (t *GetClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1251,7 +1251,7 @@ func (t *GetClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1310,7 +1310,7 @@ func (t *GetClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Claims ([]verifreg.Claim) (slice) - if uint64(len(t.Claims)) > cbg.MaxLength { + if len(t.Claims) > 8192 { return xerrors.Errorf("Slice value in field t.Claims was too long") } @@ -1365,7 +1365,7 @@ func (t *GetClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Claims: array too large (%d)", extra) } @@ -1420,7 +1420,7 @@ func (t *UniversalReceiverParams) MarshalCBOR(w io.Writer) error { } // t.Payload ([]uint8) (slice) - if uint64(len(t.Payload)) > cbg.ByteArrayMaxLen { + if len(t.Payload) > 2097152 { return xerrors.Errorf("Byte array in field t.Payload was too long") } @@ -1479,7 +1479,7 @@ func (t *UniversalReceiverParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.ByteArrayMaxLen { + if extra > 2097152 { return fmt.Errorf("t.Payload: byte array too large (%d)", extra) } if maj != cbg.MajByteString { @@ -1522,7 +1522,7 @@ func (t *AllocationsResponse) MarshalCBOR(w io.Writer) error { } // t.NewAllocations ([]verifreg.AllocationId) (slice) - if uint64(len(t.NewAllocations)) > cbg.MaxLength { + if len(t.NewAllocations) > 8192 { return xerrors.Errorf("Slice value in field t.NewAllocations was too long") } @@ -1587,7 +1587,7 @@ func (t *AllocationsResponse) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.NewAllocations: array too large (%d)", extra) } @@ -1641,7 +1641,7 @@ func (t *ExtendClaimTermsParams) MarshalCBOR(w io.Writer) error { } // t.Terms ([]verifreg.ClaimTerm) (slice) - if uint64(len(t.Terms)) > cbg.MaxLength { + if len(t.Terms) > 8192 { return xerrors.Errorf("Slice value in field t.Terms was too long") } @@ -1687,7 +1687,7 @@ func (t *ExtendClaimTermsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Terms: array too large (%d)", extra) } @@ -1742,7 +1742,7 @@ func (t *ExtendClaimTermsReturn) MarshalCBOR(w io.Writer) error { } // t.FailCodes ([]verifreg.FailCode) (slice) - if uint64(len(t.FailCodes)) > cbg.MaxLength { + if len(t.FailCodes) > 8192 { return xerrors.Errorf("Slice value in field t.FailCodes was too long") } @@ -1802,7 +1802,7 @@ func (t *ExtendClaimTermsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.FailCodes: array too large (%d)", extra) } @@ -1857,7 +1857,7 @@ func (t *RemoveExpiredClaimsParams) MarshalCBOR(w io.Writer) error { } // t.ClaimIds ([]verifreg.ClaimId) (slice) - if uint64(len(t.ClaimIds)) > cbg.MaxLength { + if len(t.ClaimIds) > 8192 { return xerrors.Errorf("Slice value in field t.ClaimIds was too long") } @@ -1918,7 +1918,7 @@ func (t *RemoveExpiredClaimsParams) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.ClaimIds: array too large (%d)", extra) } @@ -1972,7 +1972,7 @@ func (t *RemoveExpiredClaimsReturn) MarshalCBOR(w io.Writer) error { } // t.Considered ([]verifreg.AllocationId) (slice) - if uint64(len(t.Considered)) > cbg.MaxLength { + if len(t.Considered) > 8192 { return xerrors.Errorf("Slice value in field t.Considered was too long") } @@ -2024,7 +2024,7 @@ func (t *RemoveExpiredClaimsReturn) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Considered: array too large (%d)", extra) } @@ -2363,10 +2363,10 @@ func (t *FailCode) UnmarshalCBOR(r io.Reader) (err error) { // t.Code (exitcode.ExitCode) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2540,10 +2540,10 @@ func (t *SectorAllocationClaim) UnmarshalCBOR(r io.Reader) (err error) { // t.SectorExpiry (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2725,10 +2725,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2750,10 +2750,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2775,10 +2775,10 @@ func (t *Claim) UnmarshalCBOR(r io.Reader) (err error) { // t.TermStart (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -2908,10 +2908,10 @@ func (t *ClaimTerm) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3021,10 +3021,10 @@ func (t *ClaimExtensionRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3200,10 +3200,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3225,10 +3225,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3250,10 +3250,10 @@ func (t *Allocation) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3409,10 +3409,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMin (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3434,10 +3434,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.TermMax (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3459,10 +3459,10 @@ func (t *AllocationRequest) UnmarshalCBOR(r io.Reader) (err error) { // t.Expiration (abi.ChainEpoch) (int64) { maj, extra, err := cr.ReadHeader() - var extraI int64 if err != nil { return err } + var extraI int64 switch maj { case cbg.MajUnsignedInt: extraI = int64(extra) @@ -3499,7 +3499,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Allocations ([]verifreg.AllocationRequest) (slice) - if uint64(len(t.Allocations)) > cbg.MaxLength { + if len(t.Allocations) > 8192 { return xerrors.Errorf("Slice value in field t.Allocations was too long") } @@ -3514,7 +3514,7 @@ func (t *AllocationRequests) MarshalCBOR(w io.Writer) error { } // t.Extensions ([]verifreg.ClaimExtensionRequest) (slice) - if uint64(len(t.Extensions)) > cbg.MaxLength { + if len(t.Extensions) > 8192 { return xerrors.Errorf("Slice value in field t.Extensions was too long") } @@ -3560,7 +3560,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Allocations: array too large (%d)", extra) } @@ -3598,7 +3598,7 @@ func (t *AllocationRequests) UnmarshalCBOR(r io.Reader) (err error) { return err } - if extra > cbg.MaxLength { + if extra > 8192 { return fmt.Errorf("t.Extensions: array too large (%d)", extra) } diff --git a/go.mod b/go.mod index 1966584f..0535b826 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,12 @@ go 1.18 retract v0.12.7 // wrongfully skipped a patch version, use v0.12.6 or v0.12.8&^ -replace github.com/whyrusleeping/cbor-gen => ../../whyrusleeping/cbor-gen - require ( github.com/filecoin-project/go-address v1.1.0 - github.com/filecoin-project/go-amt-ipld/v4 v4.2.1-0.20240206063011-8207d7a1e4ef + github.com/filecoin-project/go-amt-ipld/v4 v4.2.0 github.com/filecoin-project/go-bitfield v0.2.4 github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837 - github.com/filecoin-project/go-hamt-ipld/v3 v3.3.1-0.20240206064418-6c31c2ab8045 + github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-cid v0.3.2 github.com/ipfs/go-ipld-cbor v0.0.6 @@ -22,8 +20,8 @@ require ( github.com/multiformats/go-multihash v0.2.1 github.com/multiformats/go-varint v0.0.6 github.com/stretchr/testify v1.7.0 - github.com/whyrusleeping/cbor-gen v0.0.0-20240202185644-fcdaca49d05c - golang.org/x/crypto v0.17.0 + github.com/whyrusleeping/cbor-gen v0.0.0-20240207022414-c5f90eb30d41 + golang.org/x/crypto v0.1.0 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 ) @@ -41,7 +39,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - golang.org/x/sys v0.15.0 // indirect - gopkg.in/yaml.v3 v3.0.0 // indirect + golang.org/x/sys v0.1.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect lukechampine.com/blake3 v1.1.6 // indirect ) diff --git a/go.sum b/go.sum index c991e443..200e61f1 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+ github.com/filecoin-project/go-address v1.1.0 h1:ofdtUtEsNxkIxkDw67ecSmvtzaVSdcea4boAmLbnHfE= github.com/filecoin-project/go-address v1.1.0/go.mod h1:5t3z6qPmIADZBtuE9EIzi0EwzcRy2nVhpo0I/c1r0OA= github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= -github.com/filecoin-project/go-amt-ipld/v4 v4.2.1-0.20240206063011-8207d7a1e4ef h1:d2a6kO4Nq8wnFzWC/+x967xZa3y0KrWB5cnnWTH693I= -github.com/filecoin-project/go-amt-ipld/v4 v4.2.1-0.20240206063011-8207d7a1e4ef/go.mod h1:yho4SqDGret1aOl53OnsBL0h7zgodUuzrwsADe0v9ho= +github.com/filecoin-project/go-amt-ipld/v4 v4.2.0 h1:DQTXQwMXxaetd+lhZGODjt5qC1WYT7tMAlYrWqI/fwI= +github.com/filecoin-project/go-amt-ipld/v4 v4.2.0/go.mod h1:0eDVF7pROvxrsxvLJx+SJZXqRaXXcEPUcgb/rG0zGU4= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.4 h1:uZ7MeE+XfM5lqrHJZ93OnhQKc/rveW8p9au0C68JPgk= github.com/filecoin-project/go-bitfield v0.2.4/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= @@ -23,8 +23,8 @@ github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88OqLYEo6roi+GiIeOh8= github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= -github.com/filecoin-project/go-hamt-ipld/v3 v3.3.1-0.20240206064418-6c31c2ab8045 h1:w2Ydu6hiPnxR9lDIbHKU5i31Ho+1pGtN5xTk2i7/sII= -github.com/filecoin-project/go-hamt-ipld/v3 v3.3.1-0.20240206064418-6c31c2ab8045/go.mod h1:LOii7J9ZDSEeMK9jTfYFbStSqD0FlyA0qKoep7w36jw= +github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 h1:rVVNq0x6RGQIzCo1iiJlGFm9AGIZzeifggxtKMU7zmI= +github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0/go.mod h1:bxmzgT8tmeVQA1/gvBwFmYdT8SOFUwB3ovSUfG1Ux0g= github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20/go.mod h1:mPn+LRRd5gEKNAtc+r3ScpW2JRU/pj4NBKdADYWHiak= github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= github.com/filecoin-project/go-state-types v0.0.0-20200904021452-1883f36ca2f4/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= @@ -48,6 +48,7 @@ github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUP github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= +github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc= @@ -147,6 +148,15 @@ github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKw github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a h1:G++j5e0OC488te356JvdhaM8YS6nMsjLAYF7JxCv07w= +github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= +github.com/whyrusleeping/cbor-gen v0.0.0-20200414195334-429a0b5e922e/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= +github.com/whyrusleeping/cbor-gen v0.0.0-20200504204219-64967432584d/go.mod h1:W5MvapuoHRP8rz4vxjwCK1pDqF1aQcWsV5PZ+AHbqdg= +github.com/whyrusleeping/cbor-gen v0.0.0-20200715143311-227fab5a2377/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20200806213330-63aa96ca5488/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20240207022414-c5f90eb30d41 h1:w7OO90SNCSrjl2mgFna9Cpx+o0wcwnRMhalfaQU/dAE= +github.com/whyrusleeping/cbor-gen v0.0.0-20240207022414-c5f90eb30d41/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= github.com/xlab/c-for-go v0.0.0-20200718154222-87b0065af829 h1:wb7xrDzfkLgPHsSEBm+VSx6aDdi64VtV0xvP0E6j8bk= github.com/xlab/c-for-go v0.0.0-20200718154222-87b0065af829/go.mod h1:h/1PEBwj7Ym/8kOuMWvO2ujZ6Lt+TMbySEXNhjjR87I= github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 h1:Sw125DKxZhPUI4JLlWugkzsrlB50jR9v2khiD9FxuSo= @@ -166,8 +176,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= @@ -186,8 +196,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -213,8 +223,8 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA=