diff --git a/app/submodule/chain/miner_api.go b/app/submodule/chain/miner_api.go index 585eaab7da..933faff61f 100644 --- a/app/submodule/chain/miner_api.go +++ b/app/submodule/chain/miner_api.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "reflect" "github.com/filecoin-project/go-address" @@ -21,6 +22,7 @@ import ( cbg "github.com/whyrusleeping/cbor-gen" actorstypes "github.com/filecoin-project/go-state-types/actors" + market12 "github.com/filecoin-project/go-state-types/builtin/v12/market" market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market" "github.com/filecoin-project/venus/pkg/state/tree" @@ -519,25 +521,22 @@ func (msa *minerStateAPI) StateComputeDataCID(ctx context.Context, maddr address return cid.Cid{}, err } - var ccparams []byte if nv < network.Version13 { - ccparams, err = actors.SerializeParams(&market2.ComputeDataCommitmentParams{ - DealIDs: deals, - SectorType: sectorType, - }) + return msa.stateComputeDataCIDv1(ctx, maddr, sectorType, deals, tsk) + } else if nv < network.Version21 { + return msa.stateComputeDataCIDv2(ctx, maddr, sectorType, deals, tsk) } else { - ccparams, err = actors.SerializeParams(&market5.ComputeDataCommitmentParams{ - Inputs: []*market5.SectorDataSpec{ - { - DealIDs: deals, - SectorType: sectorType, - }, - }, - }) + return msa.stateComputeDataCIDv3(ctx, maddr, sectorType, deals, tsk) } +} - if err != nil { - return cid.Undef, fmt.Errorf("computing params for ComputeDataCommitment: %w", err) +func (msa *minerStateAPI) stateComputeDataCIDv1(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) { + ccparams, actorErr := actors.SerializeParams(&market2.ComputeDataCommitmentParams{ + DealIDs: deals, + SectorType: sectorType, + }) + if actorErr != nil { + return cid.Undef, fmt.Errorf("computing params for ComputeDataCommitment: %v", actorErr) } ccmt := &types.Message{ @@ -555,27 +554,99 @@ func (msa *minerStateAPI) StateComputeDataCID(ctx context.Context, maddr address return cid.Undef, fmt.Errorf("receipt for ComputeDataCommitment had exit code %d", r.MsgRct.ExitCode) } - if nv < network.Version13 { - var c cbg.CborCid - if err := c.UnmarshalCBOR(bytes.NewReader(r.MsgRct.Return)); err != nil { - return cid.Undef, fmt.Errorf("failed to unmarshal CBOR to CborCid: %w", err) - } + var c cbg.CborCid + if err := c.UnmarshalCBOR(bytes.NewReader(r.MsgRct.Return)); err != nil { + return cid.Undef, fmt.Errorf("failed to unmarshal CBOR to CborCid: %w", err) + } - return cid.Cid(c), nil + return cid.Cid(c), nil +} + +func (msa *minerStateAPI) stateComputeDataCIDv2(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) { + var err error + ccparams, err := actors.SerializeParams(&market5.ComputeDataCommitmentParams{ + Inputs: []*market5.SectorDataSpec{ + { + DealIDs: deals, + SectorType: sectorType, + }, + }, + }) + + if err != nil { + return cid.Undef, fmt.Errorf("computing params for ComputeDataCommitment: %w", err) + } + ccmt := &types.Message{ + To: market.Address, + From: maddr, + Value: types.NewInt(0), + Method: market.Methods.ComputeDataCommitment, + Params: ccparams, + } + r, err := msa.API().StateCall(ctx, ccmt, tsk) + if err != nil { + return cid.Undef, fmt.Errorf("calling ComputeDataCommitment: %w", err) + } + if r.MsgRct.ExitCode != 0 { + return cid.Undef, fmt.Errorf("receipt for ComputeDataCommitment had exit code %d", r.MsgRct.ExitCode) } var cr market5.ComputeDataCommitmentReturn if err := cr.UnmarshalCBOR(bytes.NewReader(r.MsgRct.Return)); err != nil { return cid.Undef, fmt.Errorf("failed to unmarshal CBOR to CborCid: %w", err) } - if len(cr.CommDs) != 1 { return cid.Undef, fmt.Errorf("CommD output must have 1 entry") } - return cid.Cid(cr.CommDs[0]), nil } +func (msa *minerStateAPI) stateComputeDataCIDv3(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) { + if len(deals) == 0 { + return cid.Undef, nil + } + + var err error + ccparams, err := actors.SerializeParams(&market12.VerifyDealsForActivationParams{ + Sectors: []market12.SectorDeals{{ + SectorType: sectorType, + SectorExpiry: math.MaxInt64, + DealIDs: deals, + }}, + }) + + if err != nil { + return cid.Undef, fmt.Errorf("computing params for VerifyDealsForActivation: %w", err) + } + ccmt := &types.Message{ + To: market.Address, + From: maddr, + Value: types.NewInt(0), + Method: market.Methods.VerifyDealsForActivation, + Params: ccparams, + } + r, err := msa.API().StateCall(ctx, ccmt, tsk) + if err != nil { + return cid.Undef, fmt.Errorf("calling VerifyDealsForActivation: %w", err) + } + if r.MsgRct.ExitCode != 0 { + return cid.Undef, fmt.Errorf("receipt for VerifyDealsForActivation had exit code %d", r.MsgRct.ExitCode) + } + + var cr market12.VerifyDealsForActivationReturn + if err := cr.UnmarshalCBOR(bytes.NewReader(r.MsgRct.Return)); err != nil { + return cid.Undef, fmt.Errorf("failed to unmarshal CBOR to VerifyDealsForActivationReturn: %w", err) + } + if len(cr.UnsealedCIDs) != 1 { + return cid.Undef, fmt.Errorf("sectors output must have 1 entry") + } + ucid := cr.UnsealedCIDs[0] + if ucid == nil { + return cid.Undef, fmt.Errorf("computed data CID is nil") + } + return *ucid, nil +} + var ( initialPledgeNum = big.NewInt(110) initialPledgeDen = big.NewInt(100) diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 310f0ccd42..b53241344b 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 310f0ccd42760f8db567d2fa10959e3ef8b6186f +Subproject commit b53241344bcba6ad12e91a00aa0e61e20e85ef0a diff --git a/fixtures/assets/genesis-car/butterflynet.car b/fixtures/assets/genesis-car/butterflynet.car index fa9fb77b8e..58e2e70729 100644 Binary files a/fixtures/assets/genesis-car/butterflynet.car and b/fixtures/assets/genesis-car/butterflynet.car differ diff --git a/fixtures/networks/butterfly.go b/fixtures/networks/butterfly.go index d5c7ac9b23..ead26b5d71 100644 --- a/fixtures/networks/butterfly.go +++ b/fixtures/networks/butterfly.go @@ -12,8 +12,8 @@ func ButterflySnapNet() *NetworkConf { return &NetworkConf{ Bootstrap: config.BootstrapConfig{ Addresses: []string{ - "/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWMH8fFcfL6K7dwRo2wqa4UjdM5pxg9DAnoWPrVRx4Dioj", - "/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWArCrw1TLyJ5r37pYvHgv9kkXNC8tu2t1Sx7hyoCHpRje", + "/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWCkEj6aZnm1WVDg9HhH5w58Pyhs3SjALxSXrAgN2YSb2j", + "/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWLC7hNLa1X7ZRzVfRzAzuHszSD5wj3x1CkUSB13Zj6XUP", }, Period: "30s", }, @@ -55,7 +55,7 @@ func ButterflySnapNet() *NetworkConf { UpgradeHyggeHeight: -21, UpgradeLightningHeight: -22, UpgradeThunderHeight: -23, - UpgradeWatermelonHeight: 900, + UpgradeWatermelonHeight: 400, }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1}, AddressNetwork: address.Testnet, diff --git a/go.mod b/go.mod index f0fe4e636e..b181a115c6 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/filecoin-project/go-fil-markets v1.27.0-rc1 github.com/filecoin-project/go-jsonrpc v0.1.5 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.12.1 + github.com/filecoin-project/go-state-types v0.12.3 github.com/filecoin-project/pubsub v1.0.0 github.com/filecoin-project/specs-actors v0.9.15 github.com/filecoin-project/specs-actors/v2 v2.3.6 @@ -93,7 +93,7 @@ require ( github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e github.com/stretchr/testify v1.8.4 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa + github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f github.com/whyrusleeping/go-logging v0.0.1 github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 github.com/zyedidia/generic v1.2.1 diff --git a/go.sum b/go.sum index f381222d3b..b03c5d410b 100644 --- a/go.sum +++ b/go.sum @@ -450,8 +450,8 @@ github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd github.com/filecoin-project/go-state-types v0.1.12/go.mod h1:n/kujdC9JphvYTrmaD1+vJpvDPy/DwzckoMzP0nBKWI= github.com/filecoin-project/go-state-types v0.11.1/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= github.com/filecoin-project/go-state-types v0.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.1 h1:/1ip/jXIP4QzWd3hlaQ7RGp1DHKKYG3+NOhd/r08UJY= -github.com/filecoin-project/go-state-types v0.12.1/go.mod h1:KOBGyvCalT8uHBS7KSKOVbjsilD90bBZHgLAqrzz6gU= +github.com/filecoin-project/go-state-types v0.12.3 h1:tPljjwrmLUT+b/H0R0yWZQVjVEso7ld9JBh4mpF6c8c= +github.com/filecoin-project/go-state-types v0.12.3/go.mod h1:iJTqGdWDvzXhuVf64Lw0hzt4TIoitMo0VgHdxdjNDZI= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.2-0.20220322104818-27f8fbb86dfd/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= @@ -2384,8 +2384,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20220323183124-98fa8256a799/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20220514204315-f29c37e9c44c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20221021053955-c138aae13722/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= -github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f h1:SBuSxXJL0/ZJMtTxbXZgHZkThl9dNrzyaNhlyaqscRo= +github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= diff --git a/pkg/constants/env.go b/pkg/constants/env.go index 043f22befb..93dfcab014 100644 --- a/pkg/constants/env.go +++ b/pkg/constants/env.go @@ -10,3 +10,6 @@ var InsecurePoStValidation = os.Getenv("INSECURE_POST_VALIDATION") == "1" // NoSlashFilter will not check whether the miner's block violates the consensus var NoSlashFilter = os.Getenv("VENUS_NO_SLASHFILTER") == "_yes_i_know_and_i_accept_that_may_loss_my_fil" + +// NoMigrationResultCache will not use cached migration results +var NoMigrationResultCache = os.Getenv("VENUS_NOs_MIGRATION_RESULT_CACHE") == "1" diff --git a/pkg/fork/fork.go b/pkg/fork/fork.go index 643f136db2..870cf9133f 100644 --- a/pkg/fork/fork.go +++ b/pkg/fork/fork.go @@ -638,7 +638,7 @@ func (c *ChainFork) HandleStateForks(ctx context.Context, root cid.Cid, height a u := c.stateMigrations[height] if u != nil && u.upgrade != nil { migCid, ok, err := u.migrationResultCache.Get(ctx, root) - if err == nil && ok { + if err == nil && ok && !constants.NoMigrationResultCache { log.Infow("CACHED migration", "height", height, "from", root, "to", migCid) return migCid, nil } else if err != nil { diff --git a/pkg/gen/genesis/miners.go b/pkg/gen/genesis/miners.go index 98db70c90e..77506838ed 100644 --- a/pkg/gen/genesis/miners.go +++ b/pkg/gen/genesis/miners.go @@ -147,7 +147,11 @@ func SetupStorageMiners(ctx context.Context, sectorWeight []abi.StoragePower }, len(miners)) - maxPeriods := policy.GetMaxSectorExpirationExtension() / minertypes.WPoStProvingPeriod + maxLifetime, err := policy.GetMaxSectorExpirationExtension(nv) + if err != nil { + return cid.Undef, fmt.Errorf("failed to get max extension: %w", err) + } + maxPeriods := maxLifetime / minertypes.WPoStProvingPeriod rawPow, qaPow := big.NewInt(0), big.NewInt(0) for i, m := range miners { // Create miner through power actor diff --git a/pkg/net/helloprotocol/cbor_gen.go b/pkg/net/helloprotocol/cbor_gen.go index 40dd03c4de..64f737aa49 100644 --- a/pkg/net/helloprotocol/cbor_gen.go +++ b/pkg/net/helloprotocol/cbor_gen.go @@ -42,9 +42,11 @@ func (t *HelloMessage) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.HeaviestTipSetCids { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.HeaviestTipSetCids: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.HeaviestTipSetHeight (abi.ChainEpoch) (int64) @@ -115,12 +117,25 @@ func (t *HelloMessage) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.HeaviestTipSetCids failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.HeaviestTipSetCids[i]: %w", err) + } + + t.HeaviestTipSetCids[i] = c + + } } - t.HeaviestTipSetCids[i] = c } // t.HeaviestTipSetHeight (abi.ChainEpoch) (int64) diff --git a/pkg/vm/dispatch/cbor_gen.go b/pkg/vm/dispatch/cbor_gen.go index 74d364721f..2c91f74ca5 100644 --- a/pkg/vm/dispatch/cbor_gen.go +++ b/pkg/vm/dispatch/cbor_gen.go @@ -40,7 +40,7 @@ func (t *SimpleParams) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Name)); err != nil { + if _, err := cw.WriteString(string(t.Name)); err != nil { return err } return nil diff --git a/venus-devtool/go.mod b/venus-devtool/go.mod index 3266471735..7a69d41c6e 100644 --- a/venus-devtool/go.mod +++ b/venus-devtool/go.mod @@ -8,8 +8,8 @@ require ( github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc7 github.com/filecoin-project/go-fil-markets v1.28.3 github.com/filecoin-project/go-jsonrpc v0.3.1 - github.com/filecoin-project/go-state-types v0.12.1 - github.com/filecoin-project/lotus v1.23.4-0.20230919170504-4fd6eb6e8743 + github.com/filecoin-project/go-state-types v0.12.3 + github.com/filecoin-project/lotus v1.23.4-0.20230924140339-a0e38c905e78 github.com/filecoin-project/venus v0.0.0-00010101000000-000000000000 github.com/google/uuid v1.3.0 github.com/ipfs/go-block-format v0.1.2 @@ -20,7 +20,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.9.3 github.com/multiformats/go-multiaddr v0.9.0 github.com/urfave/cli/v2 v2.25.5 - github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa + github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f golang.org/x/tools v0.9.1 ) diff --git a/venus-devtool/go.sum b/venus-devtool/go.sum index fcf460c83a..95b79fcf08 100644 --- a/venus-devtool/go.sum +++ b/venus-devtool/go.sum @@ -222,8 +222,8 @@ github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4 github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.1 h1:/1ip/jXIP4QzWd3hlaQ7RGp1DHKKYG3+NOhd/r08UJY= -github.com/filecoin-project/go-state-types v0.12.1/go.mod h1:KOBGyvCalT8uHBS7KSKOVbjsilD90bBZHgLAqrzz6gU= +github.com/filecoin-project/go-state-types v0.12.3 h1:tPljjwrmLUT+b/H0R0yWZQVjVEso7ld9JBh4mpF6c8c= +github.com/filecoin-project/go-state-types v0.12.3/go.mod h1:iJTqGdWDvzXhuVf64Lw0hzt4TIoitMo0VgHdxdjNDZI= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= @@ -232,8 +232,8 @@ github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNd github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo= github.com/filecoin-project/kubo-api-client v0.0.1 h1:IR1b+sm+VYxSRvbgECVv9SbhIgygcXcSoN1Q7xsHDXg= github.com/filecoin-project/kubo-api-client v0.0.1/go.mod h1:c36PPMIVOkKfHDwDG5U05gUlPRY9wNuh/BePwo0e+6Y= -github.com/filecoin-project/lotus v1.23.4-0.20230919170504-4fd6eb6e8743 h1:mtKLJQQ/d7REL39TwH1pbMOIf5LS4RtZsv3E96vus5M= -github.com/filecoin-project/lotus v1.23.4-0.20230919170504-4fd6eb6e8743/go.mod h1:56nGHg5UYutBuPOQZUfs0aJpdZTt4qFXcxkhQ4y9hrw= +github.com/filecoin-project/lotus v1.23.4-0.20230924140339-a0e38c905e78 h1:8NaW7uJs8QSbJZDtAL8SIkuR9tjIPyicBGQXFo3yjjI= +github.com/filecoin-project/lotus v1.23.4-0.20230924140339-a0e38c905e78/go.mod h1:qOWv/IuIQJFmtynCOwddh+cXOqU6GkFG8u4yRkLkU14= github.com/filecoin-project/pubsub v1.0.0 h1:ZTmT27U07e54qV1mMiQo4HDr0buo8I1LDHBYLXlsNXM= github.com/filecoin-project/pubsub v1.0.0/go.mod h1:GkpB33CcUtUNrLPhJgfdy4FDx4OMNR9k+46DHx/Lqrg= github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= @@ -984,8 +984,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20220323183124-98fa8256a799/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= -github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f h1:SBuSxXJL0/ZJMtTxbXZgHZkThl9dNrzyaNhlyaqscRo= +github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= diff --git a/venus-shared/actors/builtin-actors-code/v12.tar.zst b/venus-shared/actors/builtin-actors-code/v12.tar.zst index 0c48ea4268..a08d9935d1 100644 Binary files a/venus-shared/actors/builtin-actors-code/v12.tar.zst and b/venus-shared/actors/builtin-actors-code/v12.tar.zst differ diff --git a/venus-shared/actors/builtin_actors_gen.go b/venus-shared/actors/builtin_actors_gen.go index 6fd209459e..a5886e180b 100644 --- a/venus-shared/actors/builtin_actors_gen.go +++ b/venus-shared/actors/builtin_actors_gen.go @@ -97,24 +97,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "butterflynet", Version: 12, - ManifestCid: mustParseCid("bafy2bzacebwfbz63adpfgjtub2tg7yrosmxtyc4cmi55lvrv6rqnurzviuzlg"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacea55xtffuyilgsriwilzkezlddbjb5yqsoy7ejjx5lhuvwniev2zs"), - "cron": mustParseCid("bafk2bzacebp4sc3finb4tz7imuw7qkk7gvyaprs5rohpuomu3f4x4sub7zy4e"), - "datacap": mustParseCid("bafk2bzacea5occ7omwxfrqohsage677sift7vn5ogcyxn3g7e6rmz3wcnfbj4"), - "eam": mustParseCid("bafk2bzacebogeqkimibpwigydinqrn4j7vd23pscs4de5yfrpf2ltppcqrtec"), - "ethaccount": mustParseCid("bafk2bzacecs3afxqq4fzrvycqvpgdqcvqbojoa3nihokqox4f6dv6jmz23dpg"), - "evm": mustParseCid("bafk2bzacebbsfhhwiv6n4k5buz2xdu3yff4qs43hxlibb335jmdx5xc44wv6g"), - "init": mustParseCid("bafk2bzacecuog2pnpc6r55suclspolpnrrnxykcgc33lhlz7n3fgjy22vn7de"), - "multisig": mustParseCid("bafk2bzaceczgigux7xwsfpg2e5zyjpvpay32hn47gpn7l4jhbofii7rqgxteg"), - "paymentchannel": mustParseCid("bafk2bzacect2psbtgvrvasxef46lvk7kitpdcbfkg5u3nac72pobqcmfilhh4"), + ManifestCid: mustParseCid("bafy2bzacebheb3qrt45gl2mrugnys5rm56xerarnjcvulf55rgdc2ejyp3v24"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzaceaax3tggwg2eaqsydltyzvrk4xsgxwpxos73lrqmsbgutv67ht7sm"), + "cron": mustParseCid("bafk2bzacedyltatovipojuyijrm4unqwjayb5kwtzvrog55igtbgpn66ogk56"), + "datacap": mustParseCid("bafk2bzacec73alnbszpcf5tu7llh4mvsjhsyrtbw75sp35loan55t22b6meda"), + "eam": mustParseCid("bafk2bzacedodqunug2sa22ne5uy3vmjcjz5va7vqojcekpd5ijingir65ukfg"), + "ethaccount": mustParseCid("bafk2bzaceawhkdswuxsp32mwujvwheiybpepfv2ngfioeh7ho2ruzgp3olwsq"), + "evm": mustParseCid("bafk2bzacebhpftearnnb3qtxygwgvedrxuazznwyhd3wpbrc2zoytj3ewg3ia"), + "init": mustParseCid("bafk2bzaceasfksgh65pulxgg5uhl5e72euac25kizfzouppssmw3zreo6t64s"), + "multisig": mustParseCid("bafk2bzacecaeld3tux6vqzndc5b4igc4k3db3wjkyzrxgobb3fshir65vzdfi"), + "paymentchannel": mustParseCid("bafk2bzaceao2tiixjrlvnewl5q6dr6krpehdob6kk2hga6tyrz4wbwpsmutg6"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacecwudnigxo45gd6khqqeowquzlguj4fkkstccnmnziovutav4fey6"), - "storagemarket": mustParseCid("bafk2bzacecfmp3jh6i3csrtyr2zyzhzpkmgelyykznin6lmyagicwf7gjpk5y"), - "storageminer": mustParseCid("bafk2bzacea7esq47iaiu6ecukvmtlgmv7oforo4f456p2gerumapbykh4cjf4"), - "storagepower": mustParseCid("bafk2bzacec6eyeyvmh5hnb6aqhmpns3ry4isxxmtqfcdlfhgatbandlfh3tzu"), - "system": mustParseCid("bafk2bzacecs7cbnk4rd2qke4jrag5evyq4a4qlp4h5mbycgoiunqrgtnz7bnk"), - "verifiedregistry": mustParseCid("bafk2bzacebwqzbqvaxyr4wlrwj7l4zg7ymu6pcqaoltnodmgjgynuizc56y4m"), + "reward": mustParseCid("bafk2bzaceahzrkoebsaa4gezbzyabqpuf7fhw5gnn7o6s6uvdat4mscb2mgcs"), + "storagemarket": mustParseCid("bafk2bzacebmwd5brgj5fn3b7qqxsvxs4cbjerznib6gqk4etdyibyj2q5jexi"), + "storageminer": mustParseCid("bafk2bzacebouts42ha42nngelbgnhvsry4k7b3jojphhovl7xtwf3t243c22o"), + "storagepower": mustParseCid("bafk2bzacebtljpw53z4feru2oggywxlv6b47qxceeazg7rlrkvlo2tjdyhqku"), + "system": mustParseCid("bafk2bzacebhmn5wuaylovcuathhjbvgbi7zwk7eg6jtgttymwqemk4adrtvkq"), + "verifiedregistry": mustParseCid("bafk2bzacedw7zfs5tb6jrp2za3mcdkpi5xicxbvfgu4v3ycrshbelvlpjr7nq"), }, }, { Network: "calibrationnet", @@ -203,24 +203,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "calibrationnet", Version: 12, - ManifestCid: mustParseCid("bafy2bzaceaipkdiplb5geo2plfrpaxisen46lqbzn4lt7ffmsdwdps4zb6424"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacedgtgdr2oj2jwdp6kapxvqvuec5s5awvbcjre3npygezasdl5yb52"), - "cron": mustParseCid("bafk2bzacea4k2cgqv2aefs2rz3xd2ky25wlqoo6r3fdytlmhsf4emzqpvid2s"), - "datacap": mustParseCid("bafk2bzaceab4367hss5dd4a2q5oodmtpml5nnrnybtmf52wgxfb4cw7voxu62"), - "eam": mustParseCid("bafk2bzaceac3qbafk2ucohhurwqmoolanf33tiwtyicukiecboj3zshbd7ao2"), - "ethaccount": mustParseCid("bafk2bzacedy2lbg6qrr5z3vzyuz3qeaids7t4pvdu7ohk34e7a56xtijmhj4u"), - "evm": mustParseCid("bafk2bzacebqx3jxucwtjo5j7b5mupuybrzamq2gzd5t6lohwxzga7vuc6zhag"), - "init": mustParseCid("bafk2bzacebvqeg7ka4ogomupjnikaziqf37huz4jgvoctqwiobffdad3e2d3y"), - "multisig": mustParseCid("bafk2bzacechwpp2kvsjvrj4ry5ploj2ejkfo2zvzq4umxy7tberjaregp6kdo"), - "paymentchannel": mustParseCid("bafk2bzacedfhhvzjzhrpokf2jt7es4jq25ryagzf4qy3txyffvje23vih75i4"), + ManifestCid: mustParseCid("bafy2bzacec46zrw3audq7bcubljpjxabibpa6oxxi2bi6mx7dexzef6corc42"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzaceazknqujefijifwqjt5bp6osspbuvkxl2fqzdgqkbco3jseuzcpmm"), + "cron": mustParseCid("bafk2bzaceatqs5ypt4b5fnnqtvbkjbmgbm4kvpjoow7xt4wdvv4tcuhsl3rh4"), + "datacap": mustParseCid("bafk2bzacebgicoy4uc5yt4iaefdg63fbfaocqda3hkidhjepjyx5ybzg6gd5q"), + "eam": mustParseCid("bafk2bzacebfiy2lmycixi2lm2gzm7laqwmq6ljwwzrrdzlg5sjd5av2mxhyza"), + "ethaccount": mustParseCid("bafk2bzacecqf4tnx7h3b5yv6mmqwip2tpwv5apoi5fu7r5xcsggg62aopmbh6"), + "evm": mustParseCid("bafk2bzacebhmpzjmeqitktlrxeqgv5t3k4jx6adpdgul5nbgjtl42sz6qydci"), + "init": mustParseCid("bafk2bzacecvr75cexy7pavybgpbqnr6qikugz4oqmon5plt642uce5djpkw7u"), + "multisig": mustParseCid("bafk2bzacea57gzxplsk2aqvmoqltvf3b2mep67fy2xs6acrlglphetrw2sn2g"), + "paymentchannel": mustParseCid("bafk2bzacecsc63ffhhkwwo4gadbt6mviynjx7pstb76fqbbxk34m56cwmz3go"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzaceby3y6qhaunjqmwrvegqh7ouj4ua7advg6eyzxcj43spaypeomjgg"), - "storagemarket": mustParseCid("bafk2bzacedgdck3s5asnn5di5ijg22gpqnxj7bynekbycvydwqgemqwzzmere"), - "storageminer": mustParseCid("bafk2bzacebwecbrksabe5w25iop6ysgwk57etueo67vnwsyny3nkzbnk6xshq"), - "storagepower": mustParseCid("bafk2bzacedam2fr6yyo5qhief6mxkxz7b53xgflntwgch6ujbc3wp35h4g4sa"), - "system": mustParseCid("bafk2bzacecfs5d6ktybdq6jeqiomte6tewufptk72qc6gstn6hb3gzkyedn3a"), - "verifiedregistry": mustParseCid("bafk2bzaceamkpusx5yglkb5oghqeihugs6zyouzxz6jjmk5s4qs4bovnpldgg"), + "reward": mustParseCid("bafk2bzacec4nr5wns7zcokbrmtubqhahqzr2dn32cokzoughuqpibvbd7bcdi"), + "storagemarket": mustParseCid("bafk2bzacedu6ztca5cca656hp5vci2jdd6amnr4qng6zmhsoxjpiw3rvdoozw"), + "storageminer": mustParseCid("bafk2bzacedes62nulops6p46n7uys4wsidss3nne4wt3m37l5jnu2jfgbttww"), + "storagepower": mustParseCid("bafk2bzacedvyxyw2gdqili4t6px4ggl5faxk25aihbm7culeqjzqixrsrsw42"), + "system": mustParseCid("bafk2bzaceaqc4ckrlttyyq4shkog4ymeulli5drxwvnxxwi5lcx5t4mdelgw6"), + "verifiedregistry": mustParseCid("bafk2bzaceb7hrconkdpbzrsnu3hhblxuum7jrlrswj7dafhnl5xutblnl4kci"), }, }, { Network: "caterpillarnet", @@ -318,24 +318,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "caterpillarnet", Version: 12, - ManifestCid: mustParseCid("bafy2bzaceaq2fun5mrdea6zrpbctybhbmjnhfwb42xryabxchdyjewdlembu4"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacecvsfyecyerrkhb4wtdahiwltc47abn2an5bxktkef2wxzevuh2vg"), - "cron": mustParseCid("bafk2bzacedgofnfgnlrcsihb2dvjacekhlz6k4txc4wof3wm2n3yj2wv2exii"), - "datacap": mustParseCid("bafk2bzacedd7j6fmon4k4pepohsm5nsvdr52xagbkbroeouid2fkgkpwug32e"), - "eam": mustParseCid("bafk2bzacecbita45luvxs7v4lmwqj3pv2z5qbjeugt7vl6ct46kvd3zl53fzo"), - "ethaccount": mustParseCid("bafk2bzaceaz7esfh3itqdxiraogqtair3jlxevb2quuxfhgm3bxyers5s2mgw"), - "evm": mustParseCid("bafk2bzaceacl3yet4pmuyzzfu6bnqtcslqjbinpjlhgwltu6iklqqmytkxjro"), - "init": mustParseCid("bafk2bzaceb2iuaasrij2232x4a35glhisddmmlykqwao723urapgacqyrcixk"), - "multisig": mustParseCid("bafk2bzacedqjjgilxkqjupkwppmolav5757ngdv4vdg4hitth4kamsv272m6k"), - "paymentchannel": mustParseCid("bafk2bzaced67dmxjymwype5ugx3i2kdugh56eyew6s3rgn5uc7fhjr5tq4dwg"), + ManifestCid: mustParseCid("bafy2bzaceb3dwdchw7pc7vkqfo3pscy6gcxplilisjrzg4pzsa7rbbe3xrdn4"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzaceaxcwzahxj6i6hoyurmdes3tnx7japxy7lwhfc7e6l5nyrq6gev2e"), + "cron": mustParseCid("bafk2bzaceaeiof4orsftdo75kfdnhk26yshedda2wx77fozhvecvln42e5vgm"), + "datacap": mustParseCid("bafk2bzaced36kvsmpx3j4bu63b4xfadmh4xk6htlz4rqzut3f5areqtsztdn6"), + "eam": mustParseCid("bafk2bzacedjrkr4wxkfqxdbi5y3hegnuls3jnhq22hm4rqtfgwtv4vikdouue"), + "ethaccount": mustParseCid("bafk2bzacedb5nc4ahq4gi7kcc6vw377zv6mj2ych6mbefw7r5ts5hg5ayfssm"), + "evm": mustParseCid("bafk2bzacebchr2p5shvmj56mggikjlzc4kwwgvinw7jarxy7xliyf2kukkmqs"), + "init": mustParseCid("bafk2bzaceas2x7zp23xidychzaiddirum62gszcatksy5372ymaxjhlgfsl4w"), + "multisig": mustParseCid("bafk2bzacebmj5lueub6rffjb3jfmf4spf5rtilfeyqjkwwrr4s3fx357dzsv4"), + "paymentchannel": mustParseCid("bafk2bzacebejg54jpzbd3swpe4brxfxxml76np2iqa25drmomz2xnqhybti4c"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacedqwx7ntb2lz4l6oorvlv732oxt6ots7wfzkjeyn6wmfmasr3opvu"), - "storagemarket": mustParseCid("bafk2bzacecprrqtbvrxrbviv4x5iu7xcbf4vm3jkftsauh7dfx5lab3z4z4es"), - "storageminer": mustParseCid("bafk2bzacecesuudr3q3do4semhdtrj3j4tjaxheqz3hrqtkja42ceszxzubwe"), - "storagepower": mustParseCid("bafk2bzacednsnvf6hrjoagqnvdoa74hu7m4fbrvezqhfsq6r7n3vmv5kjoc5a"), - "system": mustParseCid("bafk2bzaceczxdboh4nwcou4lkfnxzaixqhhlpq2ypyql73p55l2qlkeeuliei"), - "verifiedregistry": mustParseCid("bafk2bzacebr3pjfzmpkauu3qs2c2ow53frjux564zjawb5tclacll23omulzk"), + "reward": mustParseCid("bafk2bzaceduxa6lkazdaabrofo63qq56uoctrgfamuvqkxri5vb36b6zlyg62"), + "storagemarket": mustParseCid("bafk2bzacec577tsgcmvoz5errtc5hlgesw52jjk3l72ey6zbkowntssxcjvys"), + "storageminer": mustParseCid("bafk2bzacedgltxtcdxqq6rea7zi45y25b4tsvufaumlhi3d6wsjk7knobbfew"), + "storagepower": mustParseCid("bafk2bzacedcjabfskycamxgzlkpupztnp5cbwebhirho3x5ntykye5gvl4c7m"), + "system": mustParseCid("bafk2bzacear2j7rlfgirczggjejukdib4gmryyumknbfekgq6nqmaadds2ayc"), + "verifiedregistry": mustParseCid("bafk2bzacebxfct6htl2zqutzifxbzv7esuzdyaebuxforkucskbxqa5qle5q6"), }, }, { Network: "devnet", @@ -424,24 +424,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "devnet", Version: 12, - ManifestCid: mustParseCid("bafy2bzaceagonf7bxmnyf7hdkw6hktywrc4qachnpocas2mhayuyucdpsi6de"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacebzxft7ljumqlwrj6kbwaiblwftfigvde6zpk2jlfy6kfab3eivvw"), - "cron": mustParseCid("bafk2bzacedzx7dxt2vj27gc7rzi73qshakdjd4r4h7rjlft573kql6uuuoxze"), - "datacap": mustParseCid("bafk2bzacecut7lxz2bbfq5r2izmhbnbebdivwkfr45lfy262oiaqietmxow54"), - "eam": mustParseCid("bafk2bzaceadhudlti25kcsiuxvpjtipjh6p7wr66m76q25lcha56vxhe7iio6"), - "ethaccount": mustParseCid("bafk2bzacec2a4fcnhgvnei2eeafevcanbtmzxndprejlgigesmoyyq3vxjrta"), - "evm": mustParseCid("bafk2bzaceaikthq6wlk47covv55ddwjupvomcj6nmj6gfdpqemri2ymimtgeq"), - "init": mustParseCid("bafk2bzaceaka7tbqwgi3ogp2kcu5r7meo4l7zflycyezlck7lv5yp32ttxqyo"), - "multisig": mustParseCid("bafk2bzacebrhrgjid4mi2ch6fm7aqgwlqqt22vk54dv3o4a3iqg6scp2a6irs"), - "paymentchannel": mustParseCid("bafk2bzacecpiztcznkmreklw4kmfcydiwbnmb3pkptrr47dy6vwa6awecodzq"), + ManifestCid: mustParseCid("bafy2bzacebie7spydnd3nbx2e3muo6qqex2d7zsttphf7gamx7iog7tmfgsru"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacebwcirmvgh4exhmud7ov57amc26r5udwcpidgyq3dl7w4bhwqqbqw"), + "cron": mustParseCid("bafk2bzaced2dapvep3tdbghg2mcnypfumo5qsnwnmyzo7s64vnpffgm3osose"), + "datacap": mustParseCid("bafk2bzaceac3vs2l2yivsygafquxkx24muyelbtx7nlemyxnq2rzrzgr747q4"), + "eam": mustParseCid("bafk2bzacebcqukj4p5eciomzalofmei6n66ac2ykqjsqzfxjirnhgihtwiwp6"), + "ethaccount": mustParseCid("bafk2bzaceahyfc5gkr62imqypew3u56svyauwihz3xau33iy2vvfqknri7zoo"), + "evm": mustParseCid("bafk2bzacedm3y7djcc3a2dplb27qdzv4pqd42qelsqjpb4ouop5m7sc4rnsge"), + "init": mustParseCid("bafk2bzacecytopo2myozwqwdic5r6j7awzqcwp6jo3psyinm5sjutkiap5oxa"), + "multisig": mustParseCid("bafk2bzacebydlta5mzpqmulee2zz36c7knkkh2auu5zpqvh6auyd4ymywja6k"), + "paymentchannel": mustParseCid("bafk2bzaceafk4hkecxh3crczmwv2bcx62hucz6zunma6l6re6f5boxq67psv4"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzaceag34lek46iifugz7bqx5pjoszasp2ldkqnbfesvpwczhlnl2giiu"), - "storagemarket": mustParseCid("bafk2bzacea7574mwdfgpsgucvgmpg6upblalqh4dgk6lurzxugj7vrygmbiga"), - "storageminer": mustParseCid("bafk2bzaceclulipufdxs46niodn7peetgd7uhrxenw7sjiilsutquj5ac3rjs"), - "storagepower": mustParseCid("bafk2bzacednqafym2q3o3t63dirrrlurtiyau5vxlup7anc4k7nxkyxdayegm"), - "system": mustParseCid("bafk2bzacea4bi63eonaqh3ol2dx5neiw245gh3h4bc5nyourvsqfwo32go3bc"), - "verifiedregistry": mustParseCid("bafk2bzacebxo7xv4gruof2p36pvdt4nqlrjypewemz35m5rvkta2unfjkhfgg"), + "reward": mustParseCid("bafk2bzacedfqmdaop5e2hpg7jwj65d5wvvzox7qoilbzvruenosdshiyjfbke"), + "storagemarket": mustParseCid("bafk2bzacedbxsezacrv3nmwmlksmuvtlg4gpru5fz4pajkm6dogkohae5aarg"), + "storageminer": mustParseCid("bafk2bzacea3encig7orwntdkry64mlillvejonxzuczxj4tamtpi3rcmnbr5m"), + "storagepower": mustParseCid("bafk2bzacedctrzu4b3a6tmaech5cmhoifobqx4eqhbbjt3yu4dmh25i7f5z6y"), + "system": mustParseCid("bafk2bzacecvw2nad46yz37uex3apkovcfnbo47a3bevwlelrbrgsebrxsr24y"), + "verifiedregistry": mustParseCid("bafk2bzacebxqyfj7ewxm4xxewe5jj4ry7n6gttzzj6wsznm7kcecskqdqskzw"), }, }, { Network: "hyperspace", @@ -553,24 +553,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "mainnet", Version: 12, - ManifestCid: mustParseCid("bafy2bzacedowjygm2fy5yryyyjcww6znqngoz4rildgouuj6uk35z7a2u5gmc"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacedzaf3mtu57zkzg64druer5yyckyjxcqzp6j7d5aub3bhtukocges"), - "cron": mustParseCid("bafk2bzaceadfvanqrxocz4meefl45p7gwf37oboufk3ek54qdpnlz3vkpecw2"), - "datacap": mustParseCid("bafk2bzacecvy53fceivrvl3zks37y5nx5a6u24h72toebefrnwcl4nxkla6j2"), - "eam": mustParseCid("bafk2bzacedpxcqfmommw6yvqmdqryb2lloyou72ga6b3daph56gntgbrachdg"), - "ethaccount": mustParseCid("bafk2bzaceaqqvv22w5664fbktnzo2pqlli3mwr6sqsm6bn2tmcrecyudclz66"), - "evm": mustParseCid("bafk2bzaceb3aktnl7hgsr7nr2murlyqzecmxcs5t3wiatdsxfgmctxh44uzcg"), - "init": mustParseCid("bafk2bzaceb4dichby4a2dilbzspkxpklbittslnnuhfe32ouotcydbaxjkyoc"), - "multisig": mustParseCid("bafk2bzaced2dvtci3pemxonxkfnyeew2fxsmzqcaun2kqkcf7eyot7k6k23zq"), - "paymentchannel": mustParseCid("bafk2bzacec64pr3ekvcokfx4z6nyl7ge4gk6ddlnv6vcpfnw3llsfxlukqbbi"), + ManifestCid: mustParseCid("bafy2bzacebo7pbwl7oifbj2vavy6qbpbwyqruhkhtqswibc6yr2iruepupzpo"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacedpb57hg3k3qxrozhl4gm7exxy6dmmseqkkdptme42f3nznnilx4g"), + "cron": mustParseCid("bafk2bzaced4f33wsbenjj3u323vm5hkkssto4jccjzytsnigmulg3vsxxmzca"), + "datacap": mustParseCid("bafk2bzacedu3pigkb7wqyw4lulidtuj4ubnyitxog2ynp2av2bkhghbmleni4"), + "eam": mustParseCid("bafk2bzacebjqrptl6263twwlvibojfg2m4prvuzb23olztnsxfzkhpkbrwoig"), + "ethaccount": mustParseCid("bafk2bzacearkzkdgfm367yykho3i5nttjocdg4w3zgfxolt53bln4rvj4qzhi"), + "evm": mustParseCid("bafk2bzaceczvko7yucqm2gf2hobkio2s47ln4oczfx3ly2q624xdoumotcyhw"), + "init": mustParseCid("bafk2bzacedvak3dp6sugmtgd6kdg3acxtlrm7zs3petcb323bs52tmpypjlqk"), + "multisig": mustParseCid("bafk2bzacedcx4o6qm7uyge6uoddfhva5oumcr3isbbbqmxycr7zvf3rrxndtm"), + "paymentchannel": mustParseCid("bafk2bzacebuacnyucqmpi5mgtzw2twdvtf4dyvawqjxlowxrbfm4kgqmp7tly"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacedwhowydy4bzqvixahs3dfofzuxgdmgtmbbsymgn7ml5vcx4noyb6"), - "storagemarket": mustParseCid("bafk2bzaceczbmzpnucj4jtk3i5pcygf4cnl3sd4yfpvlpwed2vte25q7crevw"), - "storageminer": mustParseCid("bafk2bzaceddf5eoidcxj3ujktarujfgvujy2ry2uhr56ah4cl5ppyonx4mib6"), - "storagepower": mustParseCid("bafk2bzacebm7akrycbzyzlkophliwlemt72qhald2f67yfzzmcjzrz4vyanpa"), - "system": mustParseCid("bafk2bzacedksemrry4htnpmlx2wxp7e6qm733zqkfxiqpm4g34g7cqkqm55tg"), - "verifiedregistry": mustParseCid("bafk2bzacea4rrffnjxdqtdluf2jgawvcksx7yhilru4bzsbdxafyxuxpbtous"), + "reward": mustParseCid("bafk2bzacecyrtaxq3y4fyb4oxj2yo2eiyoji3myvicxk5bnwcornmtl6ro7by"), + "storagemarket": mustParseCid("bafk2bzacecj43gwtjlbuacou3zgo4g4milgzm4dgrammttlz3y5plyjubsu5c"), + "storageminer": mustParseCid("bafk2bzacebyoi7zwm7qukjlbjox3urbbgjvsnwm3fnepa643p3oawxjauekjw"), + "storagepower": mustParseCid("bafk2bzacecm36o2vdwqiueyqnnlwh5q7pfctpcockqathrnjy47iotgshmxrc"), + "system": mustParseCid("bafk2bzacecsyyjhphhjaateyabzkubunv76yy2au4srs2ia35davww4tjxr7k"), + "verifiedregistry": mustParseCid("bafk2bzacecscdqn3dcs74mawfjijeqs73q2irjg7phzec52h4wcu6s3ma7smi"), }, }, { Network: "testing", @@ -659,24 +659,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "testing", Version: 12, - ManifestCid: mustParseCid("bafy2bzacea2qiia5hnmpryp4oxeijq4rxex2wbutksvlnfqqic3ioeh3hk4wk"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzaceb432jqlwz2tfafqbmyrowojd6lhevcyg6i2gkot2a4742n4vld3c"), - "cron": mustParseCid("bafk2bzacedl5w6nowgjzrul5mllwtfhoxqr7mmovu74egitkx5v5gqunmeyrk"), - "datacap": mustParseCid("bafk2bzaceb3763jtueduhikfakm5uu7lglom5yd3kyqtjxdrgmbtmjdk3utyy"), - "eam": mustParseCid("bafk2bzaceb3fijyw3y7jcqojsos4nmhj2n5kg7jpmyh74pqic7vowvyevyrfe"), - "ethaccount": mustParseCid("bafk2bzaceb6je4q53fuvnsbubr2ozpow6jphugjfafcrdtrycpoe3742erldq"), - "evm": mustParseCid("bafk2bzaceawy7ntpzraa7zpb3jn3ins5v7z2a2bafdg6hfijme3pzeibmqudo"), - "init": mustParseCid("bafk2bzacecjnj4dupkeg6vfa4d5abhwzlgti5lxj62d76ebxuwi72qfswzsxe"), - "multisig": mustParseCid("bafk2bzacebrasao55cae4t6ss7lkmybglsbc5ep23k2xemyw4tmkklf47xah4"), - "paymentchannel": mustParseCid("bafk2bzacebfse3hrno6joffqhr7m3lqqxkbcm4h35b53zxfa7u7vuuq7avhde"), + ManifestCid: mustParseCid("bafy2bzacebfy4wz5kxtblv33vs25jkuqoxmdhy2wm7jzk6jvno4wz22nkzyeu"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacec2mxouocy7h3ohahbexu6pbzencarfm2q423y5glxyaclgso52qk"), + "cron": mustParseCid("bafk2bzaceas5abq2a4zayl54xvo4o7mzzsao6kjixoztcrrv3rrt4tbrde2um"), + "datacap": mustParseCid("bafk2bzacedfmgyuognrzp3ul3h6czmhr3aunj5da25uhpwbutxaona6shz34g"), + "eam": mustParseCid("bafk2bzacecez7diadkz54aqsvxaixjq2n4ekxkuswfawywx6rbzo5h6z7i54q"), + "ethaccount": mustParseCid("bafk2bzacedxkhuauw3tlh7aezjyi2n7ufs2ai5dho6levo4d7dj2wqz2lp5re"), + "evm": mustParseCid("bafk2bzacectw2lb73ukdtqwmep6c77ejlkx2gkxqizugzufavzosdgde5pv3i"), + "init": mustParseCid("bafk2bzacecfqtx6xoapxan5n2r6krkx5fj6dnrzb57hhcg4p4v7nbuxf2kdjk"), + "multisig": mustParseCid("bafk2bzacea5zddhue64kkj7iev75lvf3i2n5qvjnku7unq2psjnsgbjkv2aee"), + "paymentchannel": mustParseCid("bafk2bzaceap4nhkt224mhekarcyr5ehs4bjhkc62oezumxheveucph6wgx5ok"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacedbx7lduyouqad2r32kugdfvornk25zvwhgua5u3b3qr44mcafxgm"), - "storagemarket": mustParseCid("bafk2bzacebvnjqvwqbvdrv47ti4fqjada4qynnph7i3dcg7pwcq44kksxiqr4"), - "storageminer": mustParseCid("bafk2bzacednlenhzjjxgue7z2vsjbnwt2pplyvh3t3ok2a6vimjdqiq4hnnkc"), - "storagepower": mustParseCid("bafk2bzacedizg46rjo3os6mopuvnyftlecfixsf5eijz2u4os3zzsepoqhrqw"), - "system": mustParseCid("bafk2bzacedvnvuuxvaednmoqtm7vo2rzdwjkwmn46oheck5xqy7i2txrwsjci"), - "verifiedregistry": mustParseCid("bafk2bzacedisnzlqdxpuopf22ya77n54jto6vi3lf7fxfcdqnchmhemlychca"), + "reward": mustParseCid("bafk2bzacecuyuetbjfmcbg5x6o2rbb7q3jy2baxmuzvvtobvpcudaou44zp2c"), + "storagemarket": mustParseCid("bafk2bzacedm3wtouilvpjlx4xbsp2ktakb53muvt5dhvzwx2vycxmsrcckjh4"), + "storageminer": mustParseCid("bafk2bzacea4j45eonhbk7tho4oztrsz5skkracyuuten6oebfxevbiilp7lms"), + "storagepower": mustParseCid("bafk2bzacecx7kmxkac6qr3amf4pihmps3lbknypqwqbqeao3ccjhuoathlvbi"), + "system": mustParseCid("bafk2bzaceconbwh6sfqtfuxbx2at2lcdallils5yowfov3sbganufyegih4ns"), + "verifiedregistry": mustParseCid("bafk2bzacealytv5rsiozhcbpscuvigur6s2wlexkec55pzitudji2iy3kaofy"), }, }, { Network: "testing-fake-proofs", @@ -765,24 +765,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet Network: "testing-fake-proofs", Version: 12, - ManifestCid: mustParseCid("bafy2bzacebejjwowoaa3kkss27eksvehslp7khhrtl33dr6fz2v3tznkne25c"), - Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzaceb432jqlwz2tfafqbmyrowojd6lhevcyg6i2gkot2a4742n4vld3c"), - "cron": mustParseCid("bafk2bzacedl5w6nowgjzrul5mllwtfhoxqr7mmovu74egitkx5v5gqunmeyrk"), - "datacap": mustParseCid("bafk2bzaceb3763jtueduhikfakm5uu7lglom5yd3kyqtjxdrgmbtmjdk3utyy"), - "eam": mustParseCid("bafk2bzaceb3fijyw3y7jcqojsos4nmhj2n5kg7jpmyh74pqic7vowvyevyrfe"), - "ethaccount": mustParseCid("bafk2bzaceb6je4q53fuvnsbubr2ozpow6jphugjfafcrdtrycpoe3742erldq"), - "evm": mustParseCid("bafk2bzaceawy7ntpzraa7zpb3jn3ins5v7z2a2bafdg6hfijme3pzeibmqudo"), - "init": mustParseCid("bafk2bzacecjnj4dupkeg6vfa4d5abhwzlgti5lxj62d76ebxuwi72qfswzsxe"), - "multisig": mustParseCid("bafk2bzacebrasao55cae4t6ss7lkmybglsbc5ep23k2xemyw4tmkklf47xah4"), - "paymentchannel": mustParseCid("bafk2bzacebfse3hrno6joffqhr7m3lqqxkbcm4h35b53zxfa7u7vuuq7avhde"), + ManifestCid: mustParseCid("bafy2bzacedury3anneawcx2mj27e6k4kacib3gtkm3q6xg6mf7wz3drlm4vpo"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacec2mxouocy7h3ohahbexu6pbzencarfm2q423y5glxyaclgso52qk"), + "cron": mustParseCid("bafk2bzaceas5abq2a4zayl54xvo4o7mzzsao6kjixoztcrrv3rrt4tbrde2um"), + "datacap": mustParseCid("bafk2bzacedfmgyuognrzp3ul3h6czmhr3aunj5da25uhpwbutxaona6shz34g"), + "eam": mustParseCid("bafk2bzacecez7diadkz54aqsvxaixjq2n4ekxkuswfawywx6rbzo5h6z7i54q"), + "ethaccount": mustParseCid("bafk2bzacedxkhuauw3tlh7aezjyi2n7ufs2ai5dho6levo4d7dj2wqz2lp5re"), + "evm": mustParseCid("bafk2bzacectw2lb73ukdtqwmep6c77ejlkx2gkxqizugzufavzosdgde5pv3i"), + "init": mustParseCid("bafk2bzacecfqtx6xoapxan5n2r6krkx5fj6dnrzb57hhcg4p4v7nbuxf2kdjk"), + "multisig": mustParseCid("bafk2bzacea5zddhue64kkj7iev75lvf3i2n5qvjnku7unq2psjnsgbjkv2aee"), + "paymentchannel": mustParseCid("bafk2bzaceap4nhkt224mhekarcyr5ehs4bjhkc62oezumxheveucph6wgx5ok"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacedbx7lduyouqad2r32kugdfvornk25zvwhgua5u3b3qr44mcafxgm"), - "storagemarket": mustParseCid("bafk2bzacebvnjqvwqbvdrv47ti4fqjada4qynnph7i3dcg7pwcq44kksxiqr4"), - "storageminer": mustParseCid("bafk2bzacebhb4prwkgqzcdvq3vziuk4n4t74fnedgpok44cakkzc47a774oou"), - "storagepower": mustParseCid("bafk2bzacebzijogcuowc7bgwb76vqhq5hkpczianyeg6bqspd4isajn66w6mu"), - "system": mustParseCid("bafk2bzacedvnvuuxvaednmoqtm7vo2rzdwjkwmn46oheck5xqy7i2txrwsjci"), - "verifiedregistry": mustParseCid("bafk2bzacedisnzlqdxpuopf22ya77n54jto6vi3lf7fxfcdqnchmhemlychca"), + "reward": mustParseCid("bafk2bzacecuyuetbjfmcbg5x6o2rbb7q3jy2baxmuzvvtobvpcudaou44zp2c"), + "storagemarket": mustParseCid("bafk2bzacedm3wtouilvpjlx4xbsp2ktakb53muvt5dhvzwx2vycxmsrcckjh4"), + "storageminer": mustParseCid("bafk2bzacebfmhawnn6ms2phshtxusa5vjv4vfhz47oaxjnu3sop5eyrm3okho"), + "storagepower": mustParseCid("bafk2bzacebz3ez3uzhmxfeb7mstwfbdstawwcfkxby77co66fvkjyedwv7fle"), + "system": mustParseCid("bafk2bzaceconbwh6sfqtfuxbx2at2lcdallils5yowfov3sbganufyegih4ns"), + "verifiedregistry": mustParseCid("bafk2bzacealytv5rsiozhcbpscuvigur6s2wlexkec55pzitudji2iy3kaofy"), }, }} diff --git a/venus-shared/actors/policy/policy.go b/venus-shared/actors/policy/policy.go index 0c917cd341..3385d9013e 100644 --- a/venus-shared/actors/policy/policy.go +++ b/venus-shared/actors/policy/policy.go @@ -584,8 +584,53 @@ func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch { return ChainFinality } -func GetMaxSectorExpirationExtension() abi.ChainEpoch { - return miner12.MaxSectorExpirationExtension +func GetMaxSectorExpirationExtension(nv network.Version) (abi.ChainEpoch, error) { + v, err := actorstypes.VersionForNetwork(nv) + if err != nil { + return 0, fmt.Errorf("failed to get actors version: %w", err) + } + switch v { + + case actorstypes.Version0: + return miner0.MaxSectorExpirationExtension, nil + + case actorstypes.Version2: + return miner2.MaxSectorExpirationExtension, nil + + case actorstypes.Version3: + return miner3.MaxSectorExpirationExtension, nil + + case actorstypes.Version4: + return miner4.MaxSectorExpirationExtension, nil + + case actorstypes.Version5: + return miner5.MaxSectorExpirationExtension, nil + + case actorstypes.Version6: + return miner6.MaxSectorExpirationExtension, nil + + case actorstypes.Version7: + return miner7.MaxSectorExpirationExtension, nil + + case actorstypes.Version8: + return miner8.MaxSectorExpirationExtension, nil + + case actorstypes.Version9: + return miner9.MaxSectorExpirationExtension, nil + + case actorstypes.Version10: + return miner10.MaxSectorExpirationExtension, nil + + case actorstypes.Version11: + return miner11.MaxSectorExpirationExtension, nil + + case actorstypes.Version12: + return miner12.MaxSectorExpirationExtension, nil + + default: + return 0, fmt.Errorf("unsupported network version") + } + } func GetMinSectorExpiration() abi.ChainEpoch { diff --git a/venus-shared/actors/policy/policy.go.template b/venus-shared/actors/policy/policy.go.template index 989d0ddcd1..7f04824643 100644 --- a/venus-shared/actors/policy/policy.go.template +++ b/venus-shared/actors/policy/policy.go.template @@ -225,8 +225,20 @@ func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch { return ChainFinality } -func GetMaxSectorExpirationExtension() abi.ChainEpoch { - return miner{{.latestVersion}}.MaxSectorExpirationExtension +func GetMaxSectorExpirationExtension(nv network.Version) (abi.ChainEpoch, error) { + v, err := actorstypes.VersionForNetwork(nv) + if err != nil { + return 0, fmt.Errorf("failed to get actors version: %w", err) + } + switch v { + {{range .versions}} + case actorstypes.Version{{.}}: + return miner{{.}}.MaxSectorExpirationExtension, nil + {{end}} + default: + return 0, fmt.Errorf("unsupported network version") + } + } func GetMinSectorExpiration() abi.ChainEpoch { diff --git a/venus-shared/blockstore/cbor_gen.go b/venus-shared/blockstore/cbor_gen.go index 49997aedc1..a1048911ed 100644 --- a/venus-shared/blockstore/cbor_gen.go +++ b/venus-shared/blockstore/cbor_gen.go @@ -52,9 +52,11 @@ func (t *NetRPCReq) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Cid { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.Cid: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.Data ([][]uint8) (slice) @@ -151,12 +153,25 @@ func (t *NetRPCReq) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.Cid failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.Cid[i]: %w", err) + } + + t.Cid[i] = c + + } } - t.Cid[i] = c } // t.Data ([][]uint8) (slice) @@ -183,6 +198,9 @@ func (t *NetRPCReq) UnmarshalCBOR(r io.Reader) (err error) { var maj byte var extra uint64 var err error + _ = maj + _ = extra + _ = err maj, extra, err = cr.ReadHeader() if err != nil { @@ -350,7 +368,7 @@ func (t *NetRPCErr) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Msg))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Msg)); err != nil { + if _, err := cw.WriteString(string(t.Msg)); err != nil { return err } diff --git a/venus-shared/libp2p/exchange/cbor_gen.go b/venus-shared/libp2p/exchange/cbor_gen.go index 73f610dcf1..9f85dfd751 100644 --- a/venus-shared/libp2p/exchange/cbor_gen.go +++ b/venus-shared/libp2p/exchange/cbor_gen.go @@ -43,9 +43,11 @@ func (t *Request) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Head { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.Head: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.Length (uint64) (uint64) @@ -106,12 +108,25 @@ func (t *Request) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.Head failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.Head[i]: %w", err) + } + + t.Head[i] = c + + } } - t.Head[i] = c } // t.Length (uint64) (uint64) @@ -173,7 +188,7 @@ func (t *Response) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ErrorMessage))); err != nil { return err } - if _, err := io.WriteString(w, string(t.ErrorMessage)); err != nil { + if _, err := cw.WriteString(string(t.ErrorMessage)); err != nil { return err } @@ -260,13 +275,32 @@ func (t *Response) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v BSTipSet - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.Chain[i] = &v + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Chain[i] = new(BSTipSet) + if err := t.Chain[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Chain[i] pointer: %w", err) + } + } + + } + } } return nil @@ -317,9 +351,11 @@ func (t *CompactedMessages) MarshalCBOR(w io.Writer) error { return err } for _, v := range v { - if err := cw.CborWriteHeader(cbg.MajUnsignedInt, uint64(v)); err != nil { + + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(v)); err != nil { return err } + } } @@ -354,9 +390,11 @@ func (t *CompactedMessages) MarshalCBOR(w io.Writer) error { return err } for _, v := range v { - if err := cw.CborWriteHeader(cbg.MajUnsignedInt, uint64(v)); err != nil { + + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(v)); err != nil { return err } + } } return nil @@ -405,13 +443,32 @@ func (t *CompactedMessages) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v types.Message - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.Bls[i] = &v + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Bls[i] = new(types.Message) + if err := t.Bls[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Bls[i] pointer: %w", err) + } + } + + } + } } // t.BlsIncludes ([][]uint64) (slice) @@ -438,6 +495,9 @@ func (t *CompactedMessages) UnmarshalCBOR(r io.Reader) (err error) { var maj byte var extra uint64 var err error + _ = maj + _ = extra + _ = err maj, extra, err = cr.ReadHeader() if err != nil { @@ -457,17 +517,27 @@ func (t *CompactedMessages) UnmarshalCBOR(r io.Reader) (err error) { } for j := 0; j < int(extra); j++ { - - maj, val, err := cr.ReadHeader() - if err != nil { - return xerrors.Errorf("failed to read uint64 for t.BlsIncludes[i] slice: %w", err) + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.BlsIncludes[i][j] = uint64(extra) + + } } - - if maj != cbg.MajUnsignedInt { - return xerrors.Errorf("value read for array t.BlsIncludes[i] was not a uint, instead got %d", maj) - } - - t.BlsIncludes[i][j] = uint64(val) } } @@ -493,13 +563,32 @@ func (t *CompactedMessages) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v types.SignedMessage - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.Secpk[i] = &v + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Secpk[i] = new(types.SignedMessage) + if err := t.Secpk[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Secpk[i] pointer: %w", err) + } + } + + } + } } // t.SecpkIncludes ([][]uint64) (slice) @@ -526,6 +615,9 @@ func (t *CompactedMessages) UnmarshalCBOR(r io.Reader) (err error) { var maj byte var extra uint64 var err error + _ = maj + _ = extra + _ = err maj, extra, err = cr.ReadHeader() if err != nil { @@ -545,17 +637,27 @@ func (t *CompactedMessages) UnmarshalCBOR(r io.Reader) (err error) { } for j := 0; j < int(extra); j++ { - - maj, val, err := cr.ReadHeader() - if err != nil { - return xerrors.Errorf("failed to read uint64 for t.SecpkIncludes[i] slice: %w", err) - } - - if maj != cbg.MajUnsignedInt { - return xerrors.Errorf("value read for array t.SecpkIncludes[i] was not a uint, instead got %d", maj) + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + if maj != cbg.MajUnsignedInt { + return fmt.Errorf("wrong type for uint64 field") + } + t.SecpkIncludes[i][j] = uint64(extra) + + } } - - t.SecpkIncludes[i][j] = uint64(val) } } @@ -642,13 +744,32 @@ func (t *BSTipSet) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v types1.BlockHeader - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.Blocks[i] = &v + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Blocks[i] = new(types1.BlockHeader) + if err := t.Blocks[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Blocks[i] pointer: %w", err) + } + } + + } + } } // t.Messages (exchange.CompactedMessages) (struct) diff --git a/venus-shared/libp2p/hello/cbor_gen.go b/venus-shared/libp2p/hello/cbor_gen.go index c546c2fa62..c768c33076 100644 --- a/venus-shared/libp2p/hello/cbor_gen.go +++ b/venus-shared/libp2p/hello/cbor_gen.go @@ -42,9 +42,11 @@ func (t *GreetingMessage) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.HeaviestTipSet { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.HeaviestTipSet: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.HeaviestTipSetHeight (abi.ChainEpoch) (int64) @@ -115,12 +117,25 @@ func (t *GreetingMessage) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.HeaviestTipSet failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.HeaviestTipSet[i]: %w", err) + } + + t.HeaviestTipSet[i] = c + + } } - t.HeaviestTipSet[i] = c } // t.HeaviestTipSetHeight (abi.ChainEpoch) (int64) diff --git a/venus-shared/types/cbor_gen.go b/venus-shared/types/cbor_gen.go index c1d45900c3..56f586782c 100644 --- a/venus-shared/types/cbor_gen.go +++ b/venus-shared/types/cbor_gen.go @@ -90,9 +90,11 @@ func (t *BlockHeader) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Parents { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.Parents: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.ParentWeight (big.Int) (struct) @@ -248,13 +250,22 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v BeaconEntry - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.BeaconEntries[i] = v + if err := t.BeaconEntries[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.BeaconEntries[i]: %w", err) + } + + } + } } // t.WinPoStProof ([]proof.PoStProof) (slice) @@ -277,13 +288,22 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v proof.PoStProof - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { + + if err := t.WinPoStProof[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.WinPoStProof[i]: %w", err) + } - t.WinPoStProof[i] = v + } + } } // t.Parents ([]cid.Cid) (slice) @@ -306,12 +326,25 @@ func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.Parents failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.Parents[i]: %w", err) + } + + t.Parents[i] = c + + } } - t.Parents[i] = c } // t.ParentWeight (big.Int) (struct) @@ -853,9 +886,11 @@ func (t *BlockMsg) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.BlsMessages { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.BlsMessages: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.SecpkMessages ([]cid.Cid) (slice) @@ -867,9 +902,11 @@ func (t *BlockMsg) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.SecpkMessages { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.SecpkMessages: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } return nil } @@ -936,12 +973,25 @@ func (t *BlockMsg) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.BlsMessages failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.BlsMessages[i]: %w", err) + } + + t.BlsMessages[i] = c + + } } - t.BlsMessages[i] = c } // t.SecpkMessages ([]cid.Cid) (slice) @@ -964,12 +1014,25 @@ func (t *BlockMsg) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.SecpkMessages failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.SecpkMessages[i]: %w", err) + } + + t.SecpkMessages[i] = c + + } } - t.SecpkMessages[i] = c } return nil @@ -998,9 +1061,11 @@ func (t *ExpTipSet) MarshalCBOR(w io.Writer) error { return err } for _, v := range t.Cids { - if err := cbg.WriteCid(w, v); err != nil { - return xerrors.Errorf("failed writing cid field t.Cids: %w", err) + + if err := cbg.WriteCid(cw, v); err != nil { + return xerrors.Errorf("failed to write cid field v: %w", err) } + } // t.Blocks ([]*types.BlockHeader) (slice) @@ -1073,12 +1138,25 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - c, err := cbg.ReadCid(cr) - if err != nil { - return xerrors.Errorf("reading cid field t.Cids failed: %w", err) + { + + c, err := cbg.ReadCid(cr) + if err != nil { + return xerrors.Errorf("failed to read cid field t.Cids[i]: %w", err) + } + + t.Cids[i] = c + + } } - t.Cids[i] = c } // t.Blocks ([]*types.BlockHeader) (slice) @@ -1101,13 +1179,32 @@ func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Blocks[i] = new(BlockHeader) + if err := t.Blocks[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Blocks[i] pointer: %w", err) + } + } - var v BlockHeader - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Blocks[i] = &v } // t.Height (abi.ChainEpoch) (int64) @@ -1243,13 +1340,32 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Vouchers[i] = new(paych.SignedVoucher) + if err := t.Vouchers[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Vouchers[i] pointer: %w", err) + } + } - var v paych.SignedVoucher - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Vouchers[i] = &v } return nil @@ -1348,13 +1464,22 @@ func (t *Event) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v EventEntry - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.Entries[i] = v + if err := t.Entries[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Entries[i]: %w", err) + } + + } + } } return nil @@ -1387,7 +1512,7 @@ func (t *EventEntry) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Key)); err != nil { + if _, err := cw.WriteString(string(t.Key)); err != nil { return err } @@ -1518,7 +1643,7 @@ func (t *GasTrace) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Name)); err != nil { + if _, err := cw.WriteString(string(t.Name)); err != nil { return err } @@ -2171,13 +2296,32 @@ func (t *ExecutionTrace) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.GasCharges[i] = new(GasTrace) + if err := t.GasCharges[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.GasCharges[i] pointer: %w", err) + } + } - var v GasTrace - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.GasCharges[i] = &v } // t.Subcalls ([]types.ExecutionTrace) (slice) @@ -2200,13 +2344,22 @@ func (t *ExecutionTrace) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err - var v ExecutionTrace - if err := v.UnmarshalCBOR(cr); err != nil { - return err - } + { - t.Subcalls[i] = v + if err := t.Subcalls[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Subcalls[i]: %w", err) + } + + } + } } return nil diff --git a/venus-shared/types/market/cbor_gen.go b/venus-shared/types/market/cbor_gen.go index 8bdf0930b5..12cc7fe976 100644 --- a/venus-shared/types/market/cbor_gen.go +++ b/venus-shared/types/market/cbor_gen.go @@ -167,7 +167,7 @@ func (t *MsgInfo) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil { return err } - if _, err := io.WriteString(w, string(t.ChannelID)); err != nil { + if _, err := cw.WriteString(string(t.ChannelID)); err != nil { return err } @@ -190,7 +190,7 @@ func (t *MsgInfo) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Err))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Err)); err != nil { + if _, err := cw.WriteString(string(t.Err)); err != nil { return err } @@ -307,7 +307,7 @@ func (t *ChannelInfo) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.ChannelID))); err != nil { return err } - if _, err := io.WriteString(w, string(t.ChannelID)); err != nil { + if _, err := cw.WriteString(string(t.ChannelID)); err != nil { return err } @@ -512,13 +512,32 @@ func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error) { } for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Vouchers[i] = new(VoucherInfo) + if err := t.Vouchers[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Vouchers[i] pointer: %w", err) + } + } - var v VoucherInfo - if err := v.UnmarshalCBOR(cr); err != nil { - return err + } } - - t.Vouchers[i] = &v } // t.NextLane (uint64) (uint64) @@ -823,7 +842,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Miner))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Miner)); err != nil { + if _, err := cw.WriteString(string(t.Miner)); err != nil { return err } @@ -835,7 +854,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Client))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Client)); err != nil { + if _, err := cw.WriteString(string(t.Client)); err != nil { return err } @@ -853,7 +872,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.PiecePath))); err != nil { return err } - if _, err := io.WriteString(w, string(t.PiecePath)); err != nil { + if _, err := cw.WriteString(string(t.PiecePath)); err != nil { return err } @@ -871,7 +890,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.MetadataPath))); err != nil { return err } - if _, err := io.WriteString(w, string(t.MetadataPath)); err != nil { + if _, err := cw.WriteString(string(t.MetadataPath)); err != nil { return err } @@ -899,7 +918,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Message))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Message)); err != nil { + if _, err := cw.WriteString(string(t.Message)); err != nil { return err } @@ -954,7 +973,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.PieceStatus))); err != nil { return err } - if _, err := io.WriteString(w, string(t.PieceStatus)); err != nil { + if _, err := cw.WriteString(string(t.PieceStatus)); err != nil { return err } @@ -966,7 +985,7 @@ func (t *MinerDeal) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.InboundCAR))); err != nil { return err } - if _, err := io.WriteString(w, string(t.InboundCAR)); err != nil { + if _, err := cw.WriteString(string(t.InboundCAR)); err != nil { return err } @@ -1520,7 +1539,7 @@ func (t *ProviderDealState) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Receiver))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Receiver)); err != nil { + if _, err := cw.WriteString(string(t.Receiver)); err != nil { return err } @@ -1543,7 +1562,7 @@ func (t *ProviderDealState) MarshalCBOR(w io.Writer) error { if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Message))); err != nil { return err } - if _, err := io.WriteString(w, string(t.Message)); err != nil { + if _, err := cw.WriteString(string(t.Message)); err != nil { return err }