diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6422093501b..8dad1795843 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,7 +16,11 @@ Before you mark the PR ready for review, please make sure that: - example: ` fix: mempool: Introduce a cache for valid signatures` - `PR type`: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test - `area`, e.g. api, chain, state, mempool, multisig, networking, paych, proving, sealing, wallet, deps -- [ ] If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section. +- [ ] Update CHANGELOG.md or signal that this change does not need it. + - If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section. + - If the change does not require a CHANGELOG.md entry, do one of the following: + - Add `[skip changelog]` to the PR title + - Add the label `skip/changelog` to the PR - [ ] New features have usage guidelines and / or documentation updates in - [ ] [Lotus Documentation](https://lotus.filecoin.io) - [ ] [Discussion Tutorials](https://github.com/filecoin-project/lotus/discussions/categories/tutorials) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000000..1ee5178eb91 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,39 @@ +name: Changelog + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + - labeled + - unlabeled + paths: + - '**.go' + - '**/go.mod' + - '**/go.sum' + +jobs: + changelog: + if: contains(github.event.pull_request.title, '[skip changelog]') == false && + contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false + runs-on: ubuntu-latest + name: Changelog + steps: + - id: changelog + env: + GITHUB_TOKEN: ${{ github.token }} + ENDPOINT: repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files + SELECTOR: 'map(select(.filename == "CHANGELOG.md")) | length' + run: gh api "$ENDPOINT" --jq "$SELECTOR" | xargs -I{} echo "modified={}" | tee -a $GITHUB_OUTPUT + - if: steps.changelog.outputs.modified == '0' + env: + MESSAGE: | + docs/changelogs/ was not modified in this PR. Please do one of the following: + - add a changelog entry + - add `[skip changelog]` to the PR title + - label the PR with `skip/changelog` + run: | + echo "::error::${MESSAGE//$'\n'/%0A}" + exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index b247713b524..79f7d55f0c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # UNRELEASED +- https://github.com/filecoin-project/lotus/pull/12203: Fix slice modification bug in ETH Tx Events Bloom Filter +- https://github.com/filecoin-project/lotus/pull/12221: Fix a nil reference panic in the ETH Trace API +- https://github.com/filecoin-project/lotus/pull/12112: Moved consts from build/ to build/buildconstants/ for ligher curio deps. + ## ☢️ Upgrade Warnings ☢️ - This Lotus release includes some correctness improvements to the events subsystem, impacting RPC APIs including `GetActorEventsRaw`, `SubscribeActorEventsRaw`, `eth_getLogs` and the `eth` filter APIs. Part of these improvements involve an events database migration that may take some time to complete on nodes with extensive event databases. See [filecoin-project/lotus#12080](https://github.com/filecoin-project/lotus/pull/12080) for details. @@ -12,6 +16,93 @@ ## Improvements +- chore!: markets: remove stray unixfs constants, features and references ([filecoin-project/lotus#12217](https://github.com/filecoin-project/lotus/pull/12217)) +- [Upgrade to OpenTelemetry v1.28.0](https://github.com/filecoin-project/lotus/pull/12223) +- [Upgrade to go-f3 v0.0.3](https://github.com/filecoin-project/lotus/pull/12216): This upgrade introduces multiple enhancements in Finality Certificate Exchange as well as bug fixes across the rebroadcast protocol. + +# v1.28.0-rc4 / 2024-07-04 + +This is the fourth release candidate of the upcoming MANDATORY Lotus v1.28.0 release, which will deliver the Filecoin network version 23, codenamed Waffle 🧇. + +**This release candidate sets the calibration network to upgrade at epoch 1779094, corresponding to 2024-07-11T12:00:00Z.** This release does NOT set the mainnet upgrade epoch yet, in which will be updated in the final release. + +Compared to `Lotus v1.28.0-rc3`, the `Lotus v1.28.0-rc4` release addresses an issue that allows us to publish Docker builds. + +☢️ Upgrade Warnings ☢️ + +If you are running the `v1.26.0` or an earlier version of Lotus, please go through the `Upgrade Warnings` section for the `v1.27.*` releases, before upgrading to this RC. + +- This upgrade includes an additional migration to the events database. Node operators running Lotus with events turned on (off by default) may experience some delay in initial start-up of Lotus as a minor database migration takes place. See [filecoin-project/lotus#12080](https://github.com/filecoin-project/lotus/pull/12080) for full details. + +## The Filecoin network version 23 delivers the following FIPs: + +- [FIP-0065: Ignore built-in market locked balance in circulating supply calculation](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0065.md) +- [FIP-0079: Add BLS Aggregate Signatures to FVM](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0079.md) +- [FIP-0084: Remove Storage Miner Actor Method ProveCommitSectors](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0084.md) +- [FIP-0085: Convert f090 Mining Reserve Actor to Keyless Account Actor](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0085.md) +- [FIP-0091: Add support for legacy Ethereum transactions](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0091.md) +- [FIP-0092: NI-PoRep](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0092.md) +- [FIP-0086: Fast Finality Soft Launch](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0086.md) + +Note that we are only doing a "soft launch"/"passive testing" for F3 (Fast Finality) i.e. FIP-0086 in NV23. Please see [this doc](https://docs.google.com/document/d/14hMFN95_AsByBh7iMc4r_czUgg8tfjHQ1gTsmmHZ8jI/edit#heading=h.dhzqs3lisv24) for more details. + +## v14 Builtin Actor Bundle +The actor bundles for the **calibration network** can be checked as follows: + +``` +lotus state actor-cids --network-version=23 +Network Version: 23 +Actor Version: 14 +Manifest CID: bafy2bzacebq3hncszqpojglh2dkwekybq4zn6qpc4gceqbx36wndps5qehtau + +Actor CID +account bafk2bzaced5ecfm56dvtw26q56j4d32yoccyd7ggxn3qdki2enxpqqav45ths +cron bafk2bzacedpbtttpyvtjncqoyobr63mhqqtlrygbnudhxyp2vha56f626dkfs +datacap bafk2bzacecded3lcvo7ndsk66samyecw2trnhrgzi7jxsary3sqgopxlk6rku +eam bafk2bzacecsda4uw7dcu76a27gnrrdcm73tgms7wrte6jbou63vloktkqc5ne +ethaccount bafk2bzacebu2lcxfmohomjj3umslnylwugf5gssywdq3575tjarta7o227dls +evm bafk2bzacea4xnekruhfmdnzvzeo6cbf7jsfgco6x5wje2ckwc2ui2ojzcrlgu +init bafk2bzacedfmsdlewihdcrkdepnfata26nj7akbvexzs3chicujhjf2uxsazc +multisig bafk2bzacedwx4svscsp6wqqu2vlcunjihvvm4u2jnsqjkwutjhir7dwtl7z6m +paymentchannel bafk2bzacedbit7oo6lryhbo64uikvtjtfcth6oxwy3eebxerenu2h7rj44n24 +placeholder bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro +reward bafk2bzaced5rlycj7fzpscfc7p3wwxarngwqylqshj7te3uffey5tevunz4we +storagemarket bafk2bzaceatwbyrec2nnwggxc2alpqve7rl52fmbhqflebuxmmnvg3qckjb7c +storageminer bafk2bzacecr7ozkdz7l2pq3ig5qxae2ysivbnojhsn4gw3o57ov4mhksma7me +storagepower bafk2bzacedgeolvjtnw7fkji5kqmx322abv6uls2v34fuml6nw36dvfcw4mtu +system bafk2bzacederl6tlpieldsn6mkndqwd4wj5orfoqgab6p2klswfn3cjagxwla +verifiedregistry bafk2bzaceczw2kp6gjjdcjbso7mewp7guik7gr525pal6dotdja2lrct6ok3c +``` + +## Migration + +All node operators, including storage providers, should be aware that ONE pre-migration is being scheduled 120 epochs before the network upgrade. The migration for the NV23 upgrade is expected to be light with no heavy pre-migrations, here are some expected timings and resource consumption numbers: + +- Pre-Migration is expected to take less then 1 minute +- The migration is expected to take less then 30 seconds on a node with a NVMe-drive and a newer CPU. For nodes running on slower disks/CPU, it is still expected to take less then 1 minute. + +We recommend node operators (who haven't enabled splitstore discard mode) that do not care about historical chain states, to prune the chain blockstore by syncing from a snapshot 1-2 days before the upgrade. + +For certain node operators, such as full archival nodes or systems that need to keep large amounts of state (RPC providers), we recommend skipping the pre-migration and run the non-cached migration (i.e., just running the migration at the network upgrade epoch), and schedule for some additional downtime. Operators of such nodes can read the [How to disable premigration in network upgrade tutorial.](https://lotus.filecoin.io/kb/disable-premigration/) + +## Dependencies +- github.com/filecoin-project/go-state-types (`v0.14.0-dev` -> `v0.14.0-rc5`) +- github.com/filecoin-project/filecoin-ffi (`v1.27.0-rc2` -> `v1.28.0-rc2`) +- `ref-fvm4` (as part of `filecoin-ffi`) (`4.2.0` -> `4.3.1`) +- A new `github.com/filecoin-project/go-f3` dependency for F3 soft launch (`v0.0.2`) + +## Others + +- Soft launch of F3 (https://github.com/filecoin-project/lotus/pull/12119) +- NI-PoRep changes (https://github.com/filecoin-project/lotus/pull/12130) +- Fixes for the ETH events API (https://github.com/filecoin-project/lotus/pull/12080) +- Support for legacy Ethereum transactions (https://github.com/filecoin-project/lotus/pull/11969) +- Ignore market balance after nv23 (https://github.com/filecoin-project/lotus/pull/11976) +- Add finality-related params for `eth_getBlockByNumber` (https://github.com/filecoin-project/lotus/pull/12110) +- rename `Actor.Address` to `Actor.DelegatedAddress` and only use it for f4 addresses (https://github.com/filecoin-project/lotus/pull/12155) +- feat:ec: integrate F3 dynamic manifest #12185 +- fix: f3: Fix F3 build parameters for testground target (#12189) ([filecoin-project/lotus#12189](https://github.com/filecoin-project/lotus/pull/12189)) + # v1.27.1 / 2024-06-24 This release, v1.27.1, is an OPTIONAL lotus release. It is HIGHLY RECOMMENDED for node operators that are building Filecoin index off lotus! diff --git a/api/api_full.go b/api/api_full.go index 5d2f6d4176e..599e0040fe8 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -11,6 +11,8 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" + "github.com/filecoin-project/go-f3/certs" + "github.com/filecoin-project/go-f3/gpbft" "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -859,6 +861,26 @@ type FullNode interface { // Note: this API is only available via websocket connections. // This is an EXPERIMENTAL API and may be subject to change. SubscribeActorEventsRaw(ctx context.Context, filter *types.ActorEventFilter) (<-chan *types.ActorEvent, error) //perm:read + + // F3Participate should be called by a storage provider to participate in signing F3 consensus. + // Calling this API gives the lotus node a lease to sign in F3 on behalf of given SP. + // The lease should be active only on one node. The lease will expire at the newLeaseExpiration. + // To continue participating in F3 with the given node, call F3Participate again before + // the newLeaseExpiration time. + // newLeaseExpiration cannot be further than 5 minutes in the future. + // It is recommended to call F3Participate every 60 seconds + // with newLeaseExpiration set 2min into the future. + // The oldLeaseExpiration has to be set to newLeaseExpiration of the last successful call. + // For the first call to F3Participate, set the oldLeaseExpiration to zero value/time in the past. + // F3Participate will return true if the lease was accepted. + // The minerID has to be the ID address of the miner. + F3Participate(ctx context.Context, minerID address.Address, newLeaseExpiration time.Time, oldLeaseExpiration time.Time) (bool, error) //perm:sign + // F3GetCertificate returns a finality certificate at given instance number + F3GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) //perm:read + // F3GetLatestCertificate returns the latest finality certificate + F3GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) //perm:read + // F3GetPowerTable returns a F3 specific power table for use in standalone F3 nodes. + F3GetPowerTable(ctx context.Context, tsk types.TipSetKey) (gpbft.PowerEntries, error) //perm:read } // reverse interface to the client, called after EthSubscribe diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index cba7bb6b5b3..b8190ce187a 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -25,6 +25,8 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" + "github.com/filecoin-project/go-f3/certs" + "github.com/filecoin-project/go-f3/gpbft" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" @@ -399,6 +401,8 @@ func init() { FromHeight: epochPtr(1010), ToHeight: epochPtr(1020), }) + addExample(&certs.FinalityCertificate{}) + addExample(gpbft.ActorID(1000)) } func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) { diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index b15eea34111..a4c1e8aa563 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -21,6 +21,8 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" + certs "github.com/filecoin-project/go-f3/certs" + gpbft "github.com/filecoin-project/go-f3/gpbft" jsonrpc "github.com/filecoin-project/go-jsonrpc" auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" @@ -1152,6 +1154,66 @@ func (mr *MockFullNodeMockRecorder) EthUnsubscribe(arg0, arg1 interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthUnsubscribe", reflect.TypeOf((*MockFullNode)(nil).EthUnsubscribe), arg0, arg1) } +// F3GetCertificate mocks base method. +func (m *MockFullNode) F3GetCertificate(arg0 context.Context, arg1 uint64) (*certs.FinalityCertificate, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "F3GetCertificate", arg0, arg1) + ret0, _ := ret[0].(*certs.FinalityCertificate) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// F3GetCertificate indicates an expected call of F3GetCertificate. +func (mr *MockFullNodeMockRecorder) F3GetCertificate(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "F3GetCertificate", reflect.TypeOf((*MockFullNode)(nil).F3GetCertificate), arg0, arg1) +} + +// F3GetLatestCertificate mocks base method. +func (m *MockFullNode) F3GetLatestCertificate(arg0 context.Context) (*certs.FinalityCertificate, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "F3GetLatestCertificate", arg0) + ret0, _ := ret[0].(*certs.FinalityCertificate) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// F3GetLatestCertificate indicates an expected call of F3GetLatestCertificate. +func (mr *MockFullNodeMockRecorder) F3GetLatestCertificate(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "F3GetLatestCertificate", reflect.TypeOf((*MockFullNode)(nil).F3GetLatestCertificate), arg0) +} + +// F3GetPowerTable mocks base method. +func (m *MockFullNode) F3GetPowerTable(arg0 context.Context, arg1 types.TipSetKey) (gpbft.PowerEntries, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "F3GetPowerTable", arg0, arg1) + ret0, _ := ret[0].(gpbft.PowerEntries) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// F3GetPowerTable indicates an expected call of F3GetPowerTable. +func (mr *MockFullNodeMockRecorder) F3GetPowerTable(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "F3GetPowerTable", reflect.TypeOf((*MockFullNode)(nil).F3GetPowerTable), arg0, arg1) +} + +// F3Participate mocks base method. +func (m *MockFullNode) F3Participate(arg0 context.Context, arg1 address.Address, arg2, arg3 time.Time) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "F3Participate", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// F3Participate indicates an expected call of F3Participate. +func (mr *MockFullNodeMockRecorder) F3Participate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "F3Participate", reflect.TypeOf((*MockFullNode)(nil).F3Participate), arg0, arg1, arg2, arg3) +} + // FilecoinAddressToEthAddress mocks base method. func (m *MockFullNode) FilecoinAddressToEthAddress(arg0 context.Context, arg1 address.Address) (ethtypes.EthAddress, error) { m.ctrl.T.Helper() diff --git a/api/proxy_gen.go b/api/proxy_gen.go index 1881a6f9dac..0005a1cec32 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -18,6 +18,8 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" + "github.com/filecoin-project/go-f3/certs" + "github.com/filecoin-project/go-f3/gpbft" "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-state-types/abi" @@ -249,6 +251,14 @@ type FullNodeMethods struct { EthUnsubscribe func(p0 context.Context, p1 ethtypes.EthSubscriptionID) (bool, error) `perm:"read"` + F3GetCertificate func(p0 context.Context, p1 uint64) (*certs.FinalityCertificate, error) `perm:"read"` + + F3GetLatestCertificate func(p0 context.Context) (*certs.FinalityCertificate, error) `perm:"read"` + + F3GetPowerTable func(p0 context.Context, p1 types.TipSetKey) (gpbft.PowerEntries, error) `perm:"read"` + + F3Participate func(p0 context.Context, p1 address.Address, p2 time.Time, p3 time.Time) (bool, error) `perm:"sign"` + FilecoinAddressToEthAddress func(p0 context.Context, p1 address.Address) (ethtypes.EthAddress, error) `perm:"read"` GasEstimateFeeCap func(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` @@ -2063,6 +2073,50 @@ func (s *FullNodeStub) EthUnsubscribe(p0 context.Context, p1 ethtypes.EthSubscri return false, ErrNotSupported } +func (s *FullNodeStruct) F3GetCertificate(p0 context.Context, p1 uint64) (*certs.FinalityCertificate, error) { + if s.Internal.F3GetCertificate == nil { + return nil, ErrNotSupported + } + return s.Internal.F3GetCertificate(p0, p1) +} + +func (s *FullNodeStub) F3GetCertificate(p0 context.Context, p1 uint64) (*certs.FinalityCertificate, error) { + return nil, ErrNotSupported +} + +func (s *FullNodeStruct) F3GetLatestCertificate(p0 context.Context) (*certs.FinalityCertificate, error) { + if s.Internal.F3GetLatestCertificate == nil { + return nil, ErrNotSupported + } + return s.Internal.F3GetLatestCertificate(p0) +} + +func (s *FullNodeStub) F3GetLatestCertificate(p0 context.Context) (*certs.FinalityCertificate, error) { + return nil, ErrNotSupported +} + +func (s *FullNodeStruct) F3GetPowerTable(p0 context.Context, p1 types.TipSetKey) (gpbft.PowerEntries, error) { + if s.Internal.F3GetPowerTable == nil { + return *new(gpbft.PowerEntries), ErrNotSupported + } + return s.Internal.F3GetPowerTable(p0, p1) +} + +func (s *FullNodeStub) F3GetPowerTable(p0 context.Context, p1 types.TipSetKey) (gpbft.PowerEntries, error) { + return *new(gpbft.PowerEntries), ErrNotSupported +} + +func (s *FullNodeStruct) F3Participate(p0 context.Context, p1 address.Address, p2 time.Time, p3 time.Time) (bool, error) { + if s.Internal.F3Participate == nil { + return false, ErrNotSupported + } + return s.Internal.F3Participate(p0, p1, p2, p3) +} + +func (s *FullNodeStub) F3Participate(p0 context.Context, p1 address.Address, p2 time.Time, p3 time.Time) (bool, error) { + return false, ErrNotSupported +} + func (s *FullNodeStruct) FilecoinAddressToEthAddress(p0 context.Context, p1 address.Address) (ethtypes.EthAddress, error) { if s.Internal.FilecoinAddressToEthAddress == nil { return *new(ethtypes.EthAddress), ErrNotSupported diff --git a/build/buildconstants/drand.go b/build/buildconstants/drand.go new file mode 100644 index 00000000000..7925acdbaa9 --- /dev/null +++ b/build/buildconstants/drand.go @@ -0,0 +1,12 @@ +package buildconstants + +type DrandEnum int + +const ( + DrandMainnet DrandEnum = iota + 1 + DrandTestnet + DrandDevnet + DrandLocalnet + DrandIncentinet + DrandQuicknet +) diff --git a/build/buildconstants/limits.go b/build/buildconstants/limits.go new file mode 100644 index 00000000000..1a2024479be --- /dev/null +++ b/build/buildconstants/limits.go @@ -0,0 +1,6 @@ +package buildconstants + +var ( + DefaultFDLimit uint64 = 16 << 10 + MinerFDLimit uint64 = 100_000 +) diff --git a/build/buildconstants/params.go b/build/buildconstants/params.go new file mode 100644 index 00000000000..bdee1add2ad --- /dev/null +++ b/build/buildconstants/params.go @@ -0,0 +1,25 @@ +package buildconstants + +import "github.com/filecoin-project/go-state-types/network" + +var BuildType int + +const ( + BuildDefault = 0 + BuildMainnet = 0x1 + Build2k = 0x2 + BuildDebug = 0x3 + BuildCalibnet = 0x4 + BuildInteropnet = 0x5 + BuildButterflynet = 0x7 +) + +var Devnet = true + +// Used by tests and some obscure tooling +/* inline-gen template +const TestNetworkVersion = network.Version{{.latestNetworkVersion}} +/* inline-gen start */ +const TestNetworkVersion = network.Version23 + +/* inline-gen end */ diff --git a/build/params_2k.go b/build/buildconstants/params_2k.go similarity index 91% rename from build/params_2k.go rename to build/buildconstants/params_2k.go index f1907ae0bc3..64cede0d3fa 100644 --- a/build/params_2k.go +++ b/build/buildconstants/params_2k.go @@ -1,7 +1,7 @@ //go:build debug || 2k // +build debug 2k -package build +package buildconstants import ( "os" @@ -10,17 +10,13 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" - - "github.com/filecoin-project/lotus/chain/actors/policy" ) const BootstrappersFile = "" const GenesisFile = "" var NetworkBundle = "devnet" -var BundleOverrides map[actorstypes.Version]string var ActorDebugging = true var GenesisNetworkVersion = network.Version22 @@ -83,8 +79,7 @@ const UpgradeWatermelonFix2Height = -101 const UpgradeCalibrationDragonFixHeight = -102 var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ - 0: DrandMainnet, - UpgradePhoenixHeight: DrandQuicknet, + 0: DrandQuicknet, } var SupportedProofTypes = []abi.RegisteredSealProof{ @@ -96,11 +91,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(256) var PreCommitChallengeDelay = abi.ChainEpoch(10) func init() { - policy.SetSupportedProofTypes(SupportedProofTypes...) - policy.SetConsensusMinerMinPower(ConsensusMinerMinPower) - policy.SetMinVerifiedDealSize(MinVerifiedDealSize) - policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay) - getGenesisNetworkVersion := func(ev string, def network.Version) network.Version { hs, found := os.LookupEnv(ev) if found { @@ -160,8 +150,7 @@ func init() { UpgradePhoenixHeight = getUpgradeHeight("LOTUS_PHOENIX_HEIGHT", UpgradePhoenixHeight) DrandSchedule = map[abi.ChainEpoch]DrandEnum{ - 0: DrandMainnet, - UpgradePhoenixHeight: DrandQuicknet, + 0: DrandQuicknet, } BuildType |= Build2k @@ -190,3 +179,7 @@ const BootstrapPeerThreshold = 1 const Eip155ChainId = 31415926 var WhitelistedBlock = cid.Undef + +const F3Enabled = true +const ManifestServerID = "12D3KooWHcNBkqXEBrsjoveQvj6zDF3vK5S9tAfqyYaQF1LGSJwG" +const F3BootstrapEpoch abi.ChainEpoch = 100 diff --git a/build/params_butterfly.go b/build/buildconstants/params_butterfly.go similarity index 81% rename from build/params_butterfly.go rename to build/buildconstants/params_butterfly.go index ad2f8794661..e8d76473073 100644 --- a/build/params_butterfly.go +++ b/build/buildconstants/params_butterfly.go @@ -1,29 +1,24 @@ //go:build butterflynet // +build butterflynet -package build +package buildconstants import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - - "github.com/filecoin-project/lotus/chain/actors/policy" ) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ - 0: DrandMainnet, - UpgradePhoenixHeight: DrandQuicknet, + 0: DrandQuicknet, } -const GenesisNetworkVersion = network.Version21 +const GenesisNetworkVersion = network.Version22 var NetworkBundle = "butterflynet" -var BundleOverrides map[actorstypes.Version]string var ActorDebugging = false const BootstrappersFile = "butterflynet.pi" @@ -59,7 +54,7 @@ const UpgradeWatermelonHeight = -24 const UpgradeDragonHeight = -25 const UpgradePhoenixHeight = -26 -const UpgradeWaffleHeight = 400 +const UpgradeWaffleHeight = 100 // This fix upgrade only ran on calibrationnet const UpgradeWatermelonFixHeight = -100 @@ -80,11 +75,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(1 << 20) var PreCommitChallengeDelay = abi.ChainEpoch(150) func init() { - policy.SetSupportedProofTypes(SupportedProofTypes...) - policy.SetConsensusMinerMinPower(ConsensusMinerMinPower) - policy.SetMinVerifiedDealSize(MinVerifiedDealSize) - policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay) - SetAddressNetwork(address.Testnet) Devnet = true @@ -106,3 +96,7 @@ const BootstrapPeerThreshold = 2 const Eip155ChainId = 3141592 var WhitelistedBlock = cid.Undef + +const F3Enabled = true +const ManifestServerID = "12D3KooWJr9jy4ngtJNR7JC1xgLFra3DjEtyxskRYWvBK9TC3Yn6" +const F3BootstrapEpoch abi.ChainEpoch = 200 diff --git a/build/params_calibnet.go b/build/buildconstants/params_calibnet.go similarity index 88% rename from build/params_calibnet.go rename to build/buildconstants/params_calibnet.go index bbcc253220c..4d2b1cec4e9 100644 --- a/build/params_calibnet.go +++ b/build/buildconstants/params_calibnet.go @@ -1,7 +1,7 @@ //go:build calibnet // +build calibnet -package build +package buildconstants import ( "os" @@ -11,11 +11,8 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - - "github.com/filecoin-project/lotus/chain/actors/policy" ) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ @@ -26,7 +23,6 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ const GenesisNetworkVersion = network.Version0 var NetworkBundle = "calibrationnet" -var BundleOverrides map[actorstypes.Version]string var ActorDebugging = false const BootstrappersFile = "calibnet.pi" @@ -98,8 +94,8 @@ const UpgradePhoenixHeight = UpgradeDragonHeight + 120 // 2024-04-03T11:00:00Z const UpgradeCalibrationDragonFixHeight = 1493854 -// ????? -const UpgradeWaffleHeight = 999999999999999 +// 2024-07-11T12:00:00Z +const UpgradeWaffleHeight = 1779094 var SupportedProofTypes = []abi.RegisteredSealProof{ abi.RegisteredSealProof_StackedDrg32GiBV1, @@ -110,11 +106,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(1 << 20) var PreCommitChallengeDelay = abi.ChainEpoch(150) func init() { - policy.SetSupportedProofTypes(SupportedProofTypes...) - policy.SetConsensusMinerMinPower(ConsensusMinerMinPower) - policy.SetMinVerifiedDealSize(MinVerifiedDealSize) - policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay) - SetAddressNetwork(address.Testnet) Devnet = true @@ -135,7 +126,6 @@ func init() { } BuildType = BuildCalibnet - } const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) @@ -152,3 +142,7 @@ const BootstrapPeerThreshold = 4 const Eip155ChainId = 314159 var WhitelistedBlock = cid.Undef + +const F3Enabled = true +const ManifestServerID = "12D3KooWS9vD9uwm8u2uPyJV32QBAhKAmPYwmziAgr3Xzk2FU1Mr" +const F3BootstrapEpoch abi.ChainEpoch = UpgradeWaffleHeight + 100 diff --git a/build/params_debug.go b/build/buildconstants/params_debug.go similarity index 87% rename from build/params_debug.go rename to build/buildconstants/params_debug.go index e977cda0562..29facea2ac5 100644 --- a/build/params_debug.go +++ b/build/buildconstants/params_debug.go @@ -1,7 +1,7 @@ //go:build debug // +build debug -package build +package buildconstants func init() { InsecurePoStValidation = true diff --git a/build/params_interop.go b/build/buildconstants/params_interop.go similarity index 90% rename from build/params_interop.go rename to build/buildconstants/params_interop.go index 991257881a7..a2fb4faf293 100644 --- a/build/params_interop.go +++ b/build/buildconstants/params_interop.go @@ -1,31 +1,30 @@ //go:build interopnet // +build interopnet -package build +package buildconstants import ( "os" "strconv" "github.com/ipfs/go-cid" + logging "github.com/ipfs/go-log/v2" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - - "github.com/filecoin-project/lotus/chain/actors/policy" ) +var log = logging.Logger("buildconstants") + var NetworkBundle = "caterpillarnet" -var BundleOverrides map[actorstypes.Version]string var ActorDebugging = false const BootstrappersFile = "interopnet.pi" const GenesisFile = "interopnet.car" -const GenesisNetworkVersion = network.Version16 +const GenesisNetworkVersion = network.Version22 var UpgradeBreezeHeight = abi.ChainEpoch(-1) @@ -69,8 +68,7 @@ const UpgradeWatermelonFix2Height = -2 const UpgradeCalibrationDragonFixHeight = -3 var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ - 0: DrandMainnet, - UpgradePhoenixHeight: DrandQuicknet, + 0: DrandQuicknet, } var SupportedProofTypes = []abi.RegisteredSealProof{ @@ -83,11 +81,6 @@ var MinVerifiedDealSize = abi.NewStoragePower(256) var PreCommitChallengeDelay = abi.ChainEpoch(10) func init() { - policy.SetSupportedProofTypes(SupportedProofTypes...) - policy.SetConsensusMinerMinPower(ConsensusMinerMinPower) - policy.SetMinVerifiedDealSize(MinVerifiedDealSize) - policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay) - getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch { hs, found := os.LookupEnv(ev) if found { @@ -145,3 +138,7 @@ const BootstrapPeerThreshold = 2 const Eip155ChainId = 3141592 var WhitelistedBlock = cid.Undef + +const F3Enabled = true +const ManifestServerID = "12D3KooWQJ2rdVnG4okDUB6yHQhAjNutGNemcM7XzqC9Eo4z9Jce" +const F3BootstrapEpoch abi.ChainEpoch = 1000 diff --git a/build/params_mainnet.go b/build/buildconstants/params_mainnet.go similarity index 95% rename from build/params_mainnet.go rename to build/buildconstants/params_mainnet.go index e644ca1ba9b..1dfe97afe1a 100644 --- a/build/params_mainnet.go +++ b/build/buildconstants/params_mainnet.go @@ -1,7 +1,7 @@ //go:build !debug && !2k && !testground && !calibnet && !butterflynet && !interopnet // +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet -package build +package buildconstants import ( "math" @@ -10,7 +10,6 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" ) @@ -23,8 +22,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ var NetworkBundle = "mainnet" -// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical. -var BundleOverrides map[actorstypes.Version]string +var MinVerifiedDealSize = abi.NewStoragePower(1 << 20) // NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical. const ActorDebugging = false @@ -168,3 +166,7 @@ const Eip155ChainId = 314 // WhitelistedBlock skips checks on message validity in this block to sidestep the zero-bls signature var WhitelistedBlock = MustParseCid("bafy2bzaceapyg2uyzk7vueh3xccxkuwbz3nxewjyguoxvhx77malc2lzn2ybi") + +const F3Enabled = false +const ManifestServerID = "12D3KooWENMwUF9YxvQxar7uBWJtZkA6amvK4xWmKXfSiHUo2Qq7" +const F3BootstrapEpoch abi.ChainEpoch = -1 diff --git a/build/buildconstants/params_shared_vals.go b/build/buildconstants/params_shared_vals.go new file mode 100644 index 00000000000..0a3798099a9 --- /dev/null +++ b/build/buildconstants/params_shared_vals.go @@ -0,0 +1,109 @@ +//go:build !testground +// +build !testground + +package buildconstants + +import ( + "math/big" + "os" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" + + "github.com/filecoin-project/lotus/chain/actors/policy" +) + +// ///// +// Storage + +const UnixfsChunkSize uint64 = 1 << 20 +const UnixfsLinksPerLevel = 1024 + +// ///// +// Consensus / Network + +const AllowableClockDriftSecs = uint64(1) + +// Blocks (e) +var BlocksPerEpoch = uint64(builtin2.ExpectedLeadersPerEpoch) + +// Epochs +const MessageConfidence = uint64(5) + +// constants for Weight calculation +// The ratio of weight contributed by short-term vs long-term factors in a given round +const WRatioNum = int64(1) +const WRatioDen = uint64(2) + +// ///// +// Proofs + +// Epochs +// TODO: unused +const SealRandomnessLookback = policy.SealRandomnessLookback + +// ///// +// Mining + +// Epochs +const TicketRandomnessLookback = abi.ChainEpoch(1) + +// ///// +// Address + +const AddressMainnetEnvVar = "_mainnet_" + +// the 'f' prefix doesn't matter +var ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a") + +const FilBase = uint64(2_000_000_000) +const FilAllocStorageMining = uint64(1_100_000_000) + +const FilecoinPrecision = uint64(1_000_000_000_000_000_000) +const FilReserved = uint64(300_000_000) + +var InitialRewardBalance *big.Int +var InitialFilReserved *big.Int + +func init() { + InitialRewardBalance = big.NewInt(int64(FilAllocStorageMining)) + InitialRewardBalance = InitialRewardBalance.Mul(InitialRewardBalance, big.NewInt(int64(FilecoinPrecision))) + + InitialFilReserved = big.NewInt(int64(FilReserved)) + InitialFilReserved = InitialFilReserved.Mul(InitialFilReserved, big.NewInt(int64(FilecoinPrecision))) + + if os.Getenv("LOTUS_ADDRESS_TYPE") == AddressMainnetEnvVar { + SetAddressNetwork(address.Mainnet) + } +} + +// Sync +const BadBlockCacheSize = 1 << 15 + +// assuming 4000 messages per round, this lets us not lose any messages across a +// 10 block reorg. +const BlsSignatureCacheSize = 40000 + +// Size of signature verification cache +// 32k keeps the cache around 10MB in size, max +const VerifSigCacheSize = 32000 + +// /////// +// Limits + +const BlockMessageLimit = 10000 + +var BlockGasLimit = int64(10_000_000_000) +var BlockGasTarget = BlockGasLimit / 2 + +const BaseFeeMaxChangeDenom = 8 // 12.5% +const InitialBaseFee = 100e6 +const MinimumBaseFee = 100 +const PackingEfficiencyNum = 4 +const PackingEfficiencyDenom = 5 + +// revive:disable-next-line:exported +// Actor consts +// TODO: pieceSize unused from actors +var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) diff --git a/build/params_testground.go b/build/buildconstants/params_testground.go similarity index 88% rename from build/params_testground.go rename to build/buildconstants/params_testground.go index 3ba63409e91..ee442927fff 100644 --- a/build/params_testground.go +++ b/build/buildconstants/params_testground.go @@ -5,7 +5,7 @@ // // Its purpose is to unlock various degrees of flexibility and parametrization // when writing Testground plans for Lotus. -package build +package buildconstants import ( "math/big" @@ -13,7 +13,6 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/go-state-types/abi" - actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" @@ -21,9 +20,6 @@ import ( ) var ( - UnixfsChunkSize = uint64(1 << 20) - UnixfsLinksPerLevel = 1024 - BlocksPerEpoch = uint64(builtin2.ExpectedLeadersPerEpoch) BlockMessageLimit = 512 BlockGasLimit = int64(100_000_000_000) @@ -55,8 +51,6 @@ var ( BlsSignatureCacheSize = 40000 VerifSigCacheSize = 32000 - SealRandomnessLookback = policy.SealRandomnessLookback - TicketRandomnessLookback = abi.ChainEpoch(1) FilBase uint64 = 2_000_000_000 @@ -77,10 +71,6 @@ var ( return v }() - // Actor consts - // TODO: pieceSize unused from actors - MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) - PackingEfficiencyNum int64 = 4 PackingEfficiencyDenom int64 = 5 @@ -124,25 +114,29 @@ var ( GenesisNetworkVersion = network.Version0 NetworkBundle = "devnet" - BundleOverrides map[actorstypes.Version]string ActorDebugging = true NewestNetworkVersion = network.Version16 ActorUpgradeNetworkVersion = network.Version16 - Devnet = true ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a") - WhitelistedBlock = cid.Undef - BootstrappersFile = "" - GenesisFile = "" + WhitelistedBlock = cid.Undef + BootstrappersFile = "" + GenesisFile = "" + F3Enabled = false + ManifestServerID = "" + F3BootstrapEpoch abi.ChainEpoch = -1 ) -const Finality = policy.ChainFinality -const ForkLengthThreshold = Finality +func init() { + Devnet = true +} const BootstrapPeerThreshold = 1 // ChainId defines the chain ID used in the Ethereum JSON-RPC endpoint. // As per https://github.com/ethereum-lists/chains const Eip155ChainId = 31415926 + +var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) diff --git a/build/buildconstants/shared_funcs.go b/build/buildconstants/shared_funcs.go new file mode 100644 index 00000000000..c440e78e6e9 --- /dev/null +++ b/build/buildconstants/shared_funcs.go @@ -0,0 +1,33 @@ +package buildconstants + +import ( + "github.com/ipfs/go-cid" + logging "github.com/ipfs/go-log/v2" + + "github.com/filecoin-project/go-address" +) + +// moved from now-defunct build/paramfetch.go +var log = logging.Logger("build/buildtypes") + +func SetAddressNetwork(n address.Network) { + address.CurrentNetwork = n +} + +func MustParseAddress(addr string) address.Address { + ret, err := address.NewFromString(addr) + if err != nil { + panic(err) + } + + return ret +} + +func MustParseCid(c string) cid.Cid { + ret, err := cid.Decode(c) + if err != nil { + panic(err) + } + + return ret +} diff --git a/build/drand.go b/build/drand.go index c4ba4b3b7af..9b54be057e7 100644 --- a/build/drand.go +++ b/build/drand.go @@ -3,35 +3,19 @@ package build import ( "sort" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/node/modules/dtypes" ) -type DrandEnum int +var DrandMainnet = buildconstants.DrandMainnet +var DrandTestnet = buildconstants.DrandTestnet +var DrandDevnet = buildconstants.DrandDevnet +var DrandLocalnet = buildconstants.DrandLocalnet +var DrandIncentinet = buildconstants.DrandIncentinet +var DrandQuicknet = buildconstants.DrandQuicknet -func DrandConfigSchedule() dtypes.DrandSchedule { - out := dtypes.DrandSchedule{} - for start, network := range DrandSchedule { - out = append(out, dtypes.DrandPoint{Start: start, Config: DrandConfigs[network]}) - } - - sort.Slice(out, func(i, j int) bool { - return out[i].Start < out[j].Start - }) - - return out -} - -const ( - DrandMainnet DrandEnum = iota + 1 - DrandTestnet - DrandDevnet - DrandLocalnet - DrandIncentinet - DrandQuicknet -) - -var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{ - DrandMainnet: { +var DrandConfigs = map[buildconstants.DrandEnum]dtypes.DrandConfig{ + buildconstants.DrandMainnet: { Servers: []string{ "https://api.drand.sh", "https://api2.drand.sh", @@ -47,7 +31,7 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{ IsChained: true, ChainInfoJSON: `{"public_key":"868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31","period":30,"genesis_time":1595431050,"hash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce","groupHash":"176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a"}`, }, - DrandQuicknet: { + buildconstants.DrandQuicknet: { Servers: []string{ "https://api.drand.sh", "https://api2.drand.sh", @@ -63,7 +47,7 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{ IsChained: false, ChainInfoJSON: `{"public_key":"83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a","period":3,"genesis_time":1692803367,"hash":"52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971","groupHash":"f477d5c89f21a17c863a7f937c6a6d15859414d2be09cd448d4279af331c5d3e","schemeID":"bls-unchained-g1-rfc9380","metadata":{"beaconID":"quicknet"}}`, }, - DrandTestnet: { + buildconstants.DrandTestnet: { Servers: []string{ "https://pl-eu.testnet.drand.sh", "https://pl-us.testnet.drand.sh", @@ -75,7 +59,7 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{ IsChained: true, ChainInfoJSON: `{"public_key":"922a2e93828ff83345bae533f5172669a26c02dc76d6bf59c80892e12ab1455c229211886f35bb56af6d5bea981024df","period":25,"genesis_time":1590445175,"hash":"84b2234fb34e835dccd048255d7ad3194b81af7d978c3bf157e3469592ae4e02","groupHash":"4dd408e5fdff9323c76a9b6f087ba8fdc5a6da907bd9217d9d10f2287d081957"}`, }, - DrandDevnet: { + buildconstants.DrandDevnet: { Servers: []string{ "https://dev1.drand.sh", "https://dev2.drand.sh", @@ -87,8 +71,21 @@ var DrandConfigs = map[DrandEnum]dtypes.DrandConfig{ IsChained: true, ChainInfoJSON: `{"public_key":"8cda589f88914aa728fd183f383980b35789ce81b274e5daee1f338b77d02566ef4d3fb0098af1f844f10f9c803c1827","period":25,"genesis_time":1595348225,"hash":"e73b7dc3c4f6a236378220c0dd6aa110eb16eed26c11259606e07ee122838d4f","groupHash":"567d4785122a5a3e75a9bc9911d7ea807dd85ff76b78dc4ff06b075712898607"}`, }, - DrandIncentinet: { + buildconstants.DrandIncentinet: { IsChained: true, ChainInfoJSON: `{"public_key":"8cad0c72c606ab27d36ee06de1d5b2db1faf92e447025ca37575ab3a8aac2eaae83192f846fc9e158bc738423753d000","period":30,"genesis_time":1595873820,"hash":"80c8b872c714f4c00fdd3daa465d5514049f457f01f85a4caf68cdcd394ba039","groupHash":"d9406aaed487f7af71851b4399448e311f2328923d454e971536c05398ce2d9b"}`, }, } + +func DrandConfigSchedule() dtypes.DrandSchedule { + out := dtypes.DrandSchedule{} + for start, network := range buildconstants.DrandSchedule { + out = append(out, dtypes.DrandPoint{Start: start, Config: DrandConfigs[network]}) + } + + sort.Slice(out, func(i, j int) bool { + return out[i].Start < out[j].Start + }) + + return out +} diff --git a/build/limits.go b/build/limits.go index 93d56577c44..5cf3eda88d1 100644 --- a/build/limits.go +++ b/build/limits.go @@ -1,6 +1,7 @@ package build +import "github.com/filecoin-project/lotus/build/buildconstants" + var ( - DefaultFDLimit uint64 = 16 << 10 - MinerFDLimit uint64 = 100_000 + MinerFDLimit uint64 = buildconstants.MinerFDLimit ) diff --git a/build/openrpc/full.json b/build/openrpc/full.json index e5dd67d09cc..41a4a6054ee 100644 --- a/build/openrpc/full.json +++ b/build/openrpc/full.json @@ -2,7 +2,7 @@ "openrpc": "1.2.6", "info": { "title": "Lotus RPC API", - "version": "1.27.2-dev" + "version": "1.28.1-dev" }, "methods": [ { @@ -37,7 +37,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1307" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1317" } }, { @@ -60,7 +60,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1318" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1328" } }, { @@ -103,7 +103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1329" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1339" } }, { @@ -214,7 +214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1351" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1361" } }, { @@ -454,7 +454,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1362" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1372" } }, { @@ -685,7 +685,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1373" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1383" } }, { @@ -784,7 +784,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1384" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1394" } }, { @@ -816,7 +816,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1395" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1405" } }, { @@ -922,7 +922,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1406" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1416" } }, { @@ -1019,7 +1019,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1417" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1427" } }, { @@ -1078,7 +1078,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1428" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1438" } }, { @@ -1171,7 +1171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1439" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1449" } }, { @@ -1255,7 +1255,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1450" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1460" } }, { @@ -1355,7 +1355,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1461" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1471" } }, { @@ -1411,7 +1411,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1472" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1482" } }, { @@ -1484,7 +1484,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1483" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1493" } }, { @@ -1557,7 +1557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1494" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1504" } }, { @@ -1604,7 +1604,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1505" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1515" } }, { @@ -1636,7 +1636,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1516" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1526" } }, { @@ -1691,7 +1691,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1527" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1537" } }, { @@ -1743,7 +1743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1549" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1559" } }, { @@ -1780,7 +1780,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1560" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1570" } }, { @@ -1827,7 +1827,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1571" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1581" } }, { @@ -1874,7 +1874,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1582" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1592" } }, { @@ -1954,7 +1954,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1593" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1603" } }, { @@ -2006,7 +2006,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1604" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1614" } }, { @@ -2045,7 +2045,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1615" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1625" } }, { @@ -2092,7 +2092,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1626" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1636" } }, { @@ -2147,7 +2147,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1637" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1647" } }, { @@ -2176,7 +2176,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1648" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1658" } }, { @@ -2313,7 +2313,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1659" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1669" } }, { @@ -2342,7 +2342,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1670" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1680" } }, { @@ -2396,7 +2396,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1681" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1691" } }, { @@ -2487,7 +2487,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1692" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1702" } }, { @@ -2515,7 +2515,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1703" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1713" } }, { @@ -2605,7 +2605,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1714" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1724" } }, { @@ -2861,7 +2861,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1725" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1735" } }, { @@ -3106,7 +3106,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1736" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1746" } }, { @@ -3162,7 +3162,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1747" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1757" } }, { @@ -3209,7 +3209,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1758" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1768" } }, { @@ -3307,7 +3307,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1769" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1779" } }, { @@ -3373,7 +3373,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1780" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1790" } }, { @@ -3439,7 +3439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1791" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1801" } }, { @@ -3548,7 +3548,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1802" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1812" } }, { @@ -3606,7 +3606,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1813" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1823" } }, { @@ -3728,7 +3728,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1824" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1834" } }, { @@ -3937,7 +3937,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1835" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1845" } }, { @@ -4137,7 +4137,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1846" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1856" } }, { @@ -4329,7 +4329,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1857" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1867" } }, { @@ -4538,7 +4538,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1868" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1878" } }, { @@ -4629,7 +4629,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1879" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1889" } }, { @@ -4687,7 +4687,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1890" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1900" } }, { @@ -4945,7 +4945,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1901" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1911" } }, { @@ -5220,7 +5220,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1912" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1922" } }, { @@ -5248,7 +5248,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1923" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1933" } }, { @@ -5286,7 +5286,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1934" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1944" } }, { @@ -5394,7 +5394,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1945" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1955" } }, { @@ -5432,7 +5432,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1956" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1966" } }, { @@ -5461,7 +5461,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1967" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1977" } }, { @@ -5524,7 +5524,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1978" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1988" } }, { @@ -5587,7 +5587,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1989" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1999" } }, { @@ -5632,7 +5632,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2000" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2010" } }, { @@ -5754,7 +5754,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2011" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2021" } }, { @@ -5909,7 +5909,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2022" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2032" } }, { @@ -6031,7 +6031,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2033" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2043" } }, { @@ -6085,7 +6085,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2044" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2054" } }, { @@ -6139,7 +6139,526 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2055" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2065" + } + }, + { + "name": "Filecoin.F3GetCertificate", + "description": "```go\nfunc (s *FullNodeStruct) F3GetCertificate(p0 context.Context, p1 uint64) (*certs.FinalityCertificate, error) {\n\tif s.Internal.F3GetCertificate == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.F3GetCertificate(p0, p1)\n}\n```", + "summary": "F3GetCertificate returns a finality certificate at given instance number\n", + "paramStructure": "by-position", + "params": [ + { + "name": "p1", + "description": "uint64", + "summary": "", + "schema": { + "title": "number", + "description": "Number is a number", + "examples": [ + 42 + ], + "type": [ + "number" + ] + }, + "required": true, + "deprecated": false + } + ], + "result": { + "name": "*certs.FinalityCertificate", + "description": "*certs.FinalityCertificate", + "summary": "", + "schema": { + "examples": [ + { + "GPBFTInstance": 0, + "ECChain": null, + "SupplementalData": { + "Commitments": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "PowerTable": null + }, + "Signers": [ + 0 + ], + "Signature": null, + "PowerTableDelta": null + } + ], + "additionalProperties": false, + "properties": { + "ECChain": { + "items": { + "additionalProperties": false, + "properties": { + "Commitments": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "maxItems": 32, + "minItems": 32, + "type": "array" + }, + "Epoch": { + "title": "number", + "type": "number" + }, + "Key": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + }, + "PowerTable": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "GPBFTInstance": { + "title": "number", + "type": "number" + }, + "PowerTableDelta": { + "items": { + "additionalProperties": false, + "properties": { + "ParticipantID": { + "title": "number", + "type": "number" + }, + "PowerDelta": { + "additionalProperties": false, + "type": "object" + }, + "SigningKey": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "Signature": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + }, + "Signers": { + "additionalProperties": false, + "type": "object" + }, + "SupplementalData": { + "additionalProperties": false, + "properties": { + "Commitments": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "maxItems": 32, + "minItems": 32, + "type": "array" + }, + "PowerTable": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + } + }, + "type": "object" + } + }, + "type": [ + "object" + ] + }, + "required": true, + "deprecated": false + }, + "deprecated": false, + "externalDocs": { + "description": "Github remote link", + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2076" + } + }, + { + "name": "Filecoin.F3GetLatestCertificate", + "description": "```go\nfunc (s *FullNodeStruct) F3GetLatestCertificate(p0 context.Context) (*certs.FinalityCertificate, error) {\n\tif s.Internal.F3GetLatestCertificate == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.F3GetLatestCertificate(p0)\n}\n```", + "summary": "F3GetLatestCertificate returns the latest finality certificate\n", + "paramStructure": "by-position", + "params": [], + "result": { + "name": "*certs.FinalityCertificate", + "description": "*certs.FinalityCertificate", + "summary": "", + "schema": { + "examples": [ + { + "GPBFTInstance": 0, + "ECChain": null, + "SupplementalData": { + "Commitments": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "PowerTable": null + }, + "Signers": [ + 0 + ], + "Signature": null, + "PowerTableDelta": null + } + ], + "additionalProperties": false, + "properties": { + "ECChain": { + "items": { + "additionalProperties": false, + "properties": { + "Commitments": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "maxItems": 32, + "minItems": 32, + "type": "array" + }, + "Epoch": { + "title": "number", + "type": "number" + }, + "Key": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + }, + "PowerTable": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "GPBFTInstance": { + "title": "number", + "type": "number" + }, + "PowerTableDelta": { + "items": { + "additionalProperties": false, + "properties": { + "ParticipantID": { + "title": "number", + "type": "number" + }, + "PowerDelta": { + "additionalProperties": false, + "type": "object" + }, + "SigningKey": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + }, + "Signature": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + }, + "Signers": { + "additionalProperties": false, + "type": "object" + }, + "SupplementalData": { + "additionalProperties": false, + "properties": { + "Commitments": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "maxItems": 32, + "minItems": 32, + "type": "array" + }, + "PowerTable": { + "media": { + "binaryEncoding": "base64" + }, + "type": "string" + } + }, + "type": "object" + } + }, + "type": [ + "object" + ] + }, + "required": true, + "deprecated": false + }, + "deprecated": false, + "externalDocs": { + "description": "Github remote link", + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2087" + } + }, + { + "name": "Filecoin.F3GetPowerTable", + "description": "```go\nfunc (s *FullNodeStruct) F3GetPowerTable(p0 context.Context, p1 types.TipSetKey) (gpbft.PowerEntries, error) {\n\tif s.Internal.F3GetPowerTable == nil {\n\t\treturn *new(gpbft.PowerEntries), ErrNotSupported\n\t}\n\treturn s.Internal.F3GetPowerTable(p0, p1)\n}\n```", + "summary": "F3GetPowerTable returns a F3 specific power table for use in standalone F3 nodes.\n", + "paramStructure": "by-position", + "params": [ + { + "name": "p1", + "description": "types.TipSetKey", + "summary": "", + "schema": { + "examples": [ + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ] + ], + "additionalProperties": false, + "type": [ + "object" + ] + }, + "required": true, + "deprecated": false + } + ], + "result": { + "name": "gpbft.PowerEntries", + "description": "gpbft.PowerEntries", + "summary": "", + "schema": { + "examples": [ + [ + { + "ID": 1000, + "Power": 0, + "PubKey": "Bw==" + } + ] + ], + "items": [ + { + "additionalProperties": false, + "properties": { + "ID": { + "title": "number", + "type": "number" + }, + "Power": { + "additionalProperties": false, + "type": "object" + }, + "PubKey": { + "items": { + "description": "Number is a number", + "title": "number", + "type": "number" + }, + "type": "array" + } + }, + "type": [ + "object" + ] + } + ], + "type": [ + "array" + ] + }, + "required": true, + "deprecated": false + }, + "deprecated": false, + "externalDocs": { + "description": "Github remote link", + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2098" + } + }, + { + "name": "Filecoin.F3Participate", + "description": "```go\nfunc (s *FullNodeStruct) F3Participate(p0 context.Context, p1 address.Address, p2 time.Time, p3 time.Time) (bool, error) {\n\tif s.Internal.F3Participate == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.F3Participate(p0, p1, p2, p3)\n}\n```", + "summary": "F3Participate should be called by a storage provider to participate in signing F3 consensus.\nCalling this API gives the lotus node a lease to sign in F3 on behalf of given SP.\nThe lease should be active only on one node. The lease will expire at the newLeaseExpiration.\nTo continue participating in F3 with the given node, call F3Participate again before\nthe newLeaseExpiration time.\nnewLeaseExpiration cannot be further than 5 minutes in the future.\nIt is recommended to call F3Participate every 60 seconds\nwith newLeaseExpiration set 2min into the future.\nThe oldLeaseExpiration has to be set to newLeaseExpiration of the last successful call.\nFor the first call to F3Participate, set the oldLeaseExpiration to zero value/time in the past.\nF3Participate will return true if the lease was accepted.\nThe minerID has to be the ID address of the miner.\n", + "paramStructure": "by-position", + "params": [ + { + "name": "p1", + "description": "address.Address", + "summary": "", + "schema": { + "examples": [ + "f01234" + ], + "additionalProperties": false, + "type": [ + "object" + ] + }, + "required": true, + "deprecated": false + }, + { + "name": "p2", + "description": "time.Time", + "summary": "", + "schema": { + "examples": [ + "0001-01-01T00:00:00Z" + ], + "type": [ + "string" + ], + "format": "date-time" + }, + "required": true, + "deprecated": false + }, + { + "name": "p3", + "description": "time.Time", + "summary": "", + "schema": { + "examples": [ + "0001-01-01T00:00:00Z" + ], + "type": [ + "string" + ], + "format": "date-time" + }, + "required": true, + "deprecated": false + } + ], + "result": { + "name": "bool", + "description": "bool", + "summary": "", + "schema": { + "examples": [ + true + ], + "type": [ + "boolean" + ] + }, + "required": true, + "deprecated": false + }, + "deprecated": false, + "externalDocs": { + "description": "Github remote link", + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2109" } }, { @@ -6194,7 +6713,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2066" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2120" } }, { @@ -6337,7 +6856,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2077" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2131" } }, { @@ -6464,7 +6983,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2088" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2142" } }, { @@ -6566,7 +7085,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2099" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2153" } }, { @@ -6789,7 +7308,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2110" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2164" } }, { @@ -6972,7 +7491,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2121" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2175" } }, { @@ -7052,7 +7571,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2132" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2186" } }, { @@ -7097,7 +7616,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2143" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2197" } }, { @@ -7153,7 +7672,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2154" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2208" } }, { @@ -7233,7 +7752,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2165" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2219" } }, { @@ -7313,7 +7832,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2176" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2230" } }, { @@ -7798,7 +8317,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2187" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2241" } }, { @@ -7992,7 +8511,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2198" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2252" } }, { @@ -8147,7 +8666,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2209" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2263" } }, { @@ -8396,7 +8915,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2220" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2274" } }, { @@ -8551,7 +9070,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2231" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2285" } }, { @@ -8728,7 +9247,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2242" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2296" } }, { @@ -8826,7 +9345,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2253" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2307" } }, { @@ -8991,7 +9510,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2264" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2318" } }, { @@ -9030,7 +9549,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2275" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2329" } }, { @@ -9095,7 +9614,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2286" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2340" } }, { @@ -9141,7 +9660,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2297" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2351" } }, { @@ -9291,7 +9810,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2308" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2362" } }, { @@ -9428,7 +9947,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2319" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2373" } }, { @@ -9659,7 +10178,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2330" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2384" } }, { @@ -9796,7 +10315,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2341" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2395" } }, { @@ -9961,7 +10480,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2352" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2406" } }, { @@ -10038,7 +10557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2363" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2417" } }, { @@ -10233,7 +10752,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2385" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2439" } }, { @@ -10412,7 +10931,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2396" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2450" } }, { @@ -10574,7 +11093,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2407" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2461" } }, { @@ -10722,7 +11241,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2418" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2472" } }, { @@ -10950,7 +11469,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2429" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2483" } }, { @@ -11098,7 +11617,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2440" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2494" } }, { @@ -11310,7 +11829,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2451" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2505" } }, { @@ -11516,7 +12035,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2462" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2516" } }, { @@ -11584,7 +12103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2473" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2527" } }, { @@ -11701,7 +12220,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2484" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2538" } }, { @@ -11792,7 +12311,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2495" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2549" } }, { @@ -11878,7 +12397,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2506" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2560" } }, { @@ -12073,7 +12592,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2517" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2571" } }, { @@ -12235,7 +12754,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2528" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2582" } }, { @@ -12431,7 +12950,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2539" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2593" } }, { @@ -12611,7 +13130,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2550" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2604" } }, { @@ -12774,7 +13293,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2561" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2615" } }, { @@ -12801,7 +13320,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2572" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2626" } }, { @@ -12828,7 +13347,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2583" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2637" } }, { @@ -12927,7 +13446,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2594" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2648" } }, { @@ -12973,7 +13492,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2605" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2659" } }, { @@ -13073,7 +13592,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2616" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2670" } }, { @@ -13189,7 +13708,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2627" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2681" } }, { @@ -13237,7 +13756,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2638" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2692" } }, { @@ -13329,7 +13848,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2649" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2703" } }, { @@ -13444,7 +13963,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2660" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2714" } }, { @@ -13492,7 +14011,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2671" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2725" } }, { @@ -13529,7 +14048,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2682" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2736" } }, { @@ -13801,7 +14320,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2693" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2747" } }, { @@ -13849,7 +14368,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2704" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2758" } }, { @@ -13907,7 +14426,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2715" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2769" } }, { @@ -14112,7 +14631,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2726" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2780" } }, { @@ -14315,7 +14834,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2737" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2791" } }, { @@ -14484,7 +15003,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2748" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2802" } }, { @@ -14688,7 +15207,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2759" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2813" } }, { @@ -14855,7 +15374,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2770" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2824" } }, { @@ -15062,7 +15581,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2781" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2835" } }, { @@ -15130,7 +15649,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2792" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2846" } }, { @@ -15182,7 +15701,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2803" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2857" } }, { @@ -15231,7 +15750,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2814" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2868" } }, { @@ -15322,7 +15841,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2825" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2879" } }, { @@ -15501,7 +16020,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -15541,7 +16060,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -15611,10 +16130,6 @@ "State": { "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -15623,6 +16138,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -15828,7 +16347,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2836" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2890" } }, { @@ -15892,7 +16411,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } } ], @@ -15900,10 +16419,6 @@ ".*": { "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -15912,6 +16427,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -15934,7 +16453,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2847" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2901" } }, { @@ -15986,7 +16505,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2858" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2912" } }, { @@ -16196,7 +16715,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -16236,7 +16755,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -16316,10 +16835,6 @@ "State": { "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -16328,6 +16843,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -16538,7 +17057,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2869" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2923" } }, { @@ -16652,7 +17171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2880" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2934" } }, { @@ -16749,7 +17268,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2891" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2945" } }, { @@ -16849,7 +17368,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2902" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2956" } }, { @@ -16937,7 +17456,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2913" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2967" } }, { @@ -17001,15 +17520,11 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } ], "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -17018,6 +17533,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -17037,7 +17556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2924" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2978" } }, { @@ -17124,7 +17643,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2935" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2989" } }, { @@ -17215,7 +17734,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2946" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3000" } }, { @@ -17340,7 +17859,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2957" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3011" } }, { @@ -17449,7 +17968,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2968" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3022" } }, { @@ -17519,7 +18038,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2979" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3033" } }, { @@ -17622,7 +18141,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2990" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3044" } }, { @@ -17683,7 +18202,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3001" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3055" } }, { @@ -17813,7 +18332,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3012" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3066" } }, { @@ -17920,7 +18439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3023" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3077" } }, { @@ -18134,7 +18653,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3034" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3088" } }, { @@ -18211,7 +18730,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3045" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3099" } }, { @@ -18288,7 +18807,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3056" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3110" } }, { @@ -18397,7 +18916,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3067" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3121" } }, { @@ -18506,7 +19025,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3078" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3132" } }, { @@ -18567,7 +19086,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3089" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3143" } }, { @@ -18677,7 +19196,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3100" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3154" } }, { @@ -18738,7 +19257,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3111" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3165" } }, { @@ -18806,7 +19325,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3122" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3176" } }, { @@ -18874,7 +19393,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3133" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3187" } }, { @@ -18955,7 +19474,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3144" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3198" } }, { @@ -19109,7 +19628,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3155" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3209" } }, { @@ -19181,7 +19700,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3166" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3220" } }, { @@ -19345,7 +19864,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3177" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3231" } }, { @@ -19510,7 +20029,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3188" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3242" } }, { @@ -19580,7 +20099,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3199" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3253" } }, { @@ -19648,7 +20167,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3210" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3264" } }, { @@ -19741,7 +20260,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3221" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3275" } }, { @@ -19812,7 +20331,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3232" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3286" } }, { @@ -20013,7 +20532,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3243" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3297" } }, { @@ -20145,7 +20664,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3254" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3308" } }, { @@ -20282,7 +20801,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3265" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3319" } }, { @@ -20393,7 +20912,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3276" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3330" } }, { @@ -20525,7 +21044,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3287" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3341" } }, { @@ -20656,7 +21175,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3298" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3352" } }, { @@ -20727,7 +21246,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3309" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3363" } }, { @@ -20811,7 +21330,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3320" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3374" } }, { @@ -20897,7 +21416,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3331" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3385" } }, { @@ -21080,7 +21599,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3342" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3396" } }, { @@ -21107,7 +21626,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3353" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3407" } }, { @@ -21160,7 +21679,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3364" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3418" } }, { @@ -21248,7 +21767,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3375" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3429" } }, { @@ -21372,7 +21891,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -21412,7 +21931,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -21482,10 +22001,6 @@ "State": { "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -21494,6 +22009,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -21699,7 +22218,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3386" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3440" } }, { @@ -21866,7 +22385,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3397" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3451" } }, { @@ -21964,7 +22483,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3408" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3462" } }, { @@ -22137,7 +22656,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3419" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3473" } }, { @@ -22235,7 +22754,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3430" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3484" } }, { @@ -22386,7 +22905,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3441" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3495" } }, { @@ -22471,7 +22990,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3452" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3506" } }, { @@ -22539,7 +23058,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3463" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3517" } }, { @@ -22591,7 +23110,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3474" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3528" } }, { @@ -22659,7 +23178,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3485" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3539" } }, { @@ -22820,7 +23339,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3496" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3550" } }, { @@ -22867,7 +23386,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3518" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3572" } }, { @@ -22914,7 +23433,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3529" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3583" } }, { @@ -22957,7 +23476,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3551" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3605" } }, { @@ -23053,7 +23572,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3562" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3616" } }, { @@ -23319,7 +23838,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3573" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3627" } }, { @@ -23342,7 +23861,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3584" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3638" } }, { @@ -23385,7 +23904,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3595" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3649" } }, { @@ -23436,7 +23955,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3606" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3660" } }, { @@ -23481,7 +24000,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3617" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3671" } }, { @@ -23509,7 +24028,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3628" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3682" } }, { @@ -23549,7 +24068,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3639" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3693" } }, { @@ -23608,7 +24127,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3650" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3704" } }, { @@ -23652,7 +24171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3661" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3715" } }, { @@ -23711,7 +24230,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3672" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3726" } }, { @@ -23748,7 +24267,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3683" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3737" } }, { @@ -23792,7 +24311,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3694" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3748" } }, { @@ -23832,7 +24351,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3705" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3759" } }, { @@ -23907,7 +24426,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3716" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3770" } }, { @@ -24115,7 +24634,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3727" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3781" } }, { @@ -24159,7 +24678,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3738" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3792" } }, { @@ -24249,7 +24768,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3749" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3803" } }, { @@ -24276,7 +24795,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3760" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3814" } } ] diff --git a/build/openrpc/gateway.json b/build/openrpc/gateway.json index da9cc2d57ec..f49577bb940 100644 --- a/build/openrpc/gateway.json +++ b/build/openrpc/gateway.json @@ -2,7 +2,7 @@ "openrpc": "1.2.6", "info": { "title": "Lotus RPC API", - "version": "1.27.2-dev" + "version": "1.28.1-dev" }, "methods": [ { @@ -242,7 +242,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3771" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3825" } }, { @@ -473,7 +473,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3782" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3836" } }, { @@ -572,7 +572,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3793" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3847" } }, { @@ -604,7 +604,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3804" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3858" } }, { @@ -710,7 +710,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3815" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3869" } }, { @@ -803,7 +803,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3826" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3880" } }, { @@ -887,7 +887,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3837" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3891" } }, { @@ -987,7 +987,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3848" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3902" } }, { @@ -1043,7 +1043,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3859" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3913" } }, { @@ -1116,7 +1116,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3870" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3924" } }, { @@ -1189,7 +1189,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3881" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3935" } }, { @@ -1236,7 +1236,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3892" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3946" } }, { @@ -1268,7 +1268,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3903" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3957" } }, { @@ -1305,7 +1305,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3925" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3979" } }, { @@ -1352,7 +1352,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3936" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3990" } }, { @@ -1392,7 +1392,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3947" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4001" } }, { @@ -1439,7 +1439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3958" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4012" } }, { @@ -1494,7 +1494,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3969" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4023" } }, { @@ -1523,7 +1523,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3980" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4034" } }, { @@ -1660,7 +1660,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3991" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4045" } }, { @@ -1689,7 +1689,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4002" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4056" } }, { @@ -1743,7 +1743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4013" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4067" } }, { @@ -1834,7 +1834,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4024" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4078" } }, { @@ -1862,7 +1862,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4035" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4089" } }, { @@ -1952,7 +1952,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4046" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4100" } }, { @@ -2208,7 +2208,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4057" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4111" } }, { @@ -2453,7 +2453,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4068" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4122" } }, { @@ -2509,7 +2509,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4079" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4133" } }, { @@ -2556,7 +2556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4090" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4144" } }, { @@ -2654,7 +2654,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4101" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4155" } }, { @@ -2720,7 +2720,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4112" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4166" } }, { @@ -2786,7 +2786,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4123" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4177" } }, { @@ -2895,7 +2895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4134" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4188" } }, { @@ -2953,7 +2953,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4145" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4199" } }, { @@ -3075,7 +3075,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4156" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4210" } }, { @@ -3267,7 +3267,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4167" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4221" } }, { @@ -3476,7 +3476,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4178" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4232" } }, { @@ -3567,7 +3567,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4189" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4243" } }, { @@ -3625,7 +3625,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4200" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4254" } }, { @@ -3883,7 +3883,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4211" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4265" } }, { @@ -4158,7 +4158,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4222" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4276" } }, { @@ -4186,7 +4186,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4233" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4287" } }, { @@ -4224,7 +4224,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4244" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4298" } }, { @@ -4332,7 +4332,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4255" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4309" } }, { @@ -4370,7 +4370,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4266" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4320" } }, { @@ -4399,7 +4399,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4277" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4331" } }, { @@ -4462,7 +4462,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4288" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4342" } }, { @@ -4525,7 +4525,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4299" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4353" } }, { @@ -4570,7 +4570,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4310" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4364" } }, { @@ -4692,7 +4692,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4321" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4375" } }, { @@ -4847,7 +4847,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4332" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4386" } }, { @@ -4969,7 +4969,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4343" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4397" } }, { @@ -5023,7 +5023,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4354" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4408" } }, { @@ -5077,7 +5077,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4365" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4419" } }, { @@ -5132,7 +5132,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4376" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4430" } }, { @@ -5234,7 +5234,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4387" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4441" } }, { @@ -5457,7 +5457,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4398" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4452" } }, { @@ -5640,7 +5640,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4409" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4463" } }, { @@ -5834,7 +5834,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4420" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4474" } }, { @@ -5880,7 +5880,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4431" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4485" } }, { @@ -6030,7 +6030,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4442" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4496" } }, { @@ -6167,7 +6167,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4453" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4507" } }, { @@ -6235,7 +6235,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4464" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4518" } }, { @@ -6352,7 +6352,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4475" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4529" } }, { @@ -6443,7 +6443,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4486" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4540" } }, { @@ -6529,7 +6529,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4497" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4551" } }, { @@ -6556,7 +6556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4508" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4562" } }, { @@ -6583,7 +6583,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4519" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4573" } }, { @@ -6651,7 +6651,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4530" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4584" } }, { @@ -6830,7 +6830,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -6870,7 +6870,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -6940,10 +6940,6 @@ "State": { "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -6952,6 +6948,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -7157,7 +7157,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4541" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4595" } }, { @@ -7254,7 +7254,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4552" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4606" } }, { @@ -7354,7 +7354,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4563" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4617" } }, { @@ -7418,15 +7418,11 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } ], "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -7435,6 +7431,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -7454,7 +7454,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4574" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4628" } }, { @@ -7579,7 +7579,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4585" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4639" } }, { @@ -7688,7 +7688,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4596" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4650" } }, { @@ -7791,7 +7791,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4607" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4661" } }, { @@ -7921,7 +7921,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4618" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4672" } }, { @@ -8028,7 +8028,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4629" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4683" } }, { @@ -8089,7 +8089,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4640" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4694" } }, { @@ -8157,7 +8157,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4651" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4705" } }, { @@ -8238,7 +8238,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4662" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4716" } }, { @@ -8402,7 +8402,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4673" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4727" } }, { @@ -8495,7 +8495,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4684" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4738" } }, { @@ -8696,7 +8696,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4695" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4749" } }, { @@ -8807,7 +8807,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4706" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4760" } }, { @@ -8938,7 +8938,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4717" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4771" } }, { @@ -9024,7 +9024,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4728" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4782" } }, { @@ -9051,7 +9051,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4739" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4793" } }, { @@ -9104,7 +9104,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4750" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4804" } }, { @@ -9192,7 +9192,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4761" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4815" } }, { @@ -9316,7 +9316,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -9356,7 +9356,7 @@ }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -9426,10 +9426,6 @@ "State": { "additionalProperties": false, "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, "Balance": { "additionalProperties": false, "type": "object" @@ -9438,6 +9434,10 @@ "title": "Content Identifier", "type": "string" }, + "DelegatedAddress": { + "additionalProperties": false, + "type": "object" + }, "Head": { "title": "Content Identifier", "type": "string" @@ -9643,7 +9643,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4772" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4826" } }, { @@ -9810,7 +9810,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4783" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4837" } }, { @@ -9983,7 +9983,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4794" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4848" } }, { @@ -10051,7 +10051,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4805" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4859" } }, { @@ -10119,7 +10119,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4816" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4870" } }, { @@ -10280,7 +10280,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4827" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4881" } }, { @@ -10325,7 +10325,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4849" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4903" } }, { @@ -10370,7 +10370,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4860" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4914" } }, { @@ -10397,7 +10397,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4871" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4925" } } ] diff --git a/build/openrpc/miner.json b/build/openrpc/miner.json index 31cb403d560..9edb8e74b2f 100644 --- a/build/openrpc/miner.json +++ b/build/openrpc/miner.json @@ -2,7 +2,7 @@ "openrpc": "1.2.6", "info": { "title": "Lotus RPC API", - "version": "1.27.2-dev" + "version": "1.28.1-dev" }, "methods": [ { @@ -30,7 +30,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5157" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5211" } }, { @@ -109,7 +109,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5168" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5222" } }, { @@ -155,7 +155,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5179" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5233" } }, { @@ -203,7 +203,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5190" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5244" } }, { @@ -251,7 +251,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5201" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5255" } }, { @@ -354,7 +354,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5212" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5266" } }, { @@ -428,7 +428,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5223" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5277" } }, { @@ -591,7 +591,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5234" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5288" } }, { @@ -742,7 +742,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5245" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5299" } }, { @@ -781,7 +781,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5256" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5310" } }, { @@ -913,7 +913,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5267" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5321" } }, { @@ -945,7 +945,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5278" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5332" } }, { @@ -986,7 +986,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5289" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5343" } }, { @@ -1054,7 +1054,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5300" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5354" } }, { @@ -1185,7 +1185,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5311" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5365" } }, { @@ -1316,7 +1316,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5322" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5376" } }, { @@ -1416,7 +1416,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5333" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5387" } }, { @@ -1516,7 +1516,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5344" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5398" } }, { @@ -1616,7 +1616,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5355" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5409" } }, { @@ -1716,7 +1716,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5366" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5420" } }, { @@ -1816,7 +1816,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5377" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5431" } }, { @@ -1916,7 +1916,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5388" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5442" } }, { @@ -2040,7 +2040,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5399" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5453" } }, { @@ -2164,7 +2164,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5410" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5464" } }, { @@ -2279,7 +2279,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5421" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5475" } }, { @@ -2379,7 +2379,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5432" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5486" } }, { @@ -2512,7 +2512,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5443" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5497" } }, { @@ -2636,7 +2636,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5454" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5508" } }, { @@ -2760,7 +2760,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5465" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5519" } }, { @@ -2884,7 +2884,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5476" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5530" } }, { @@ -3017,7 +3017,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5487" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5541" } }, { @@ -3117,7 +3117,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5498" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5552" } }, { @@ -3157,7 +3157,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5509" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5563" } }, { @@ -3229,7 +3229,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5520" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5574" } }, { @@ -3279,7 +3279,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5531" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5585" } }, { @@ -3323,7 +3323,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5542" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5596" } }, { @@ -3364,7 +3364,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5553" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5607" } }, { @@ -3608,7 +3608,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5564" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5618" } }, { @@ -3682,7 +3682,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5575" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5629" } }, { @@ -3732,7 +3732,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5586" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5640" } }, { @@ -3761,7 +3761,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5597" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5651" } }, { @@ -3790,7 +3790,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5608" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5662" } }, { @@ -3846,7 +3846,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5619" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5673" } }, { @@ -3869,7 +3869,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5630" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5684" } }, { @@ -3929,7 +3929,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5641" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5695" } }, { @@ -3968,7 +3968,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5652" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5706" } }, { @@ -4008,7 +4008,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5663" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5717" } }, { @@ -4081,7 +4081,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5674" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5728" } }, { @@ -4145,7 +4145,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5685" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5739" } }, { @@ -4208,7 +4208,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5696" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5750" } }, { @@ -4258,7 +4258,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5707" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5761" } }, { @@ -4817,7 +4817,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5718" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5772" } }, { @@ -4858,7 +4858,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5729" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5783" } }, { @@ -4899,7 +4899,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5740" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5794" } }, { @@ -4940,7 +4940,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5751" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5805" } }, { @@ -4981,7 +4981,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5762" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5816" } }, { @@ -5022,7 +5022,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5773" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5827" } }, { @@ -5053,7 +5053,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5784" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5838" } }, { @@ -5103,7 +5103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5795" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5849" } }, { @@ -5144,7 +5144,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5806" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5860" } }, { @@ -5183,7 +5183,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5817" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5871" } }, { @@ -5247,7 +5247,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5828" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5882" } }, { @@ -5305,7 +5305,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5839" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5893" } }, { @@ -5752,7 +5752,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5850" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5904" } }, { @@ -5788,7 +5788,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5861" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5915" } }, { @@ -5931,7 +5931,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5872" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5926" } }, { @@ -5987,7 +5987,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5883" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5937" } }, { @@ -6026,7 +6026,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5894" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5948" } }, { @@ -6203,7 +6203,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5905" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5959" } }, { @@ -6255,7 +6255,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5916" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5970" } }, { @@ -6447,7 +6447,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5927" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5981" } }, { @@ -6547,7 +6547,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5938" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5992" } }, { @@ -6601,7 +6601,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5949" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6003" } }, { @@ -6640,7 +6640,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5960" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6014" } }, { @@ -6725,7 +6725,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5971" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6025" } }, { @@ -6919,7 +6919,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5982" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6036" } }, { @@ -7017,7 +7017,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5993" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6047" } }, { @@ -7149,7 +7149,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6004" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6058" } }, { @@ -7203,7 +7203,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6015" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6069" } }, { @@ -7237,7 +7237,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6026" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6080" } }, { @@ -7324,7 +7324,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6037" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6091" } }, { @@ -7378,7 +7378,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6048" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6102" } }, { @@ -7478,7 +7478,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6059" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6113" } }, { @@ -7555,7 +7555,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6070" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6124" } }, { @@ -7646,7 +7646,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6081" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6135" } }, { @@ -7685,7 +7685,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6092" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6146" } }, { @@ -7801,7 +7801,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6103" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6157" } }, { @@ -9901,7 +9901,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6114" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6168" } } ] diff --git a/build/openrpc/worker.json b/build/openrpc/worker.json index 9f0bc1cccbf..2748893e648 100644 --- a/build/openrpc/worker.json +++ b/build/openrpc/worker.json @@ -2,7 +2,7 @@ "openrpc": "1.2.6", "info": { "title": "Lotus RPC API", - "version": "1.27.2-dev" + "version": "1.28.1-dev" }, "methods": [ { @@ -161,7 +161,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6202" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6256" } }, { @@ -252,7 +252,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6213" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6267" } }, { @@ -420,7 +420,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6224" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6278" } }, { @@ -447,7 +447,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6235" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6289" } }, { @@ -597,7 +597,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6246" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6300" } }, { @@ -700,7 +700,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6257" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6311" } }, { @@ -803,7 +803,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6268" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6322" } }, { @@ -925,7 +925,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6279" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6333" } }, { @@ -1135,7 +1135,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6290" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6344" } }, { @@ -1306,7 +1306,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6301" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6355" } }, { @@ -3350,7 +3350,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6312" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6366" } }, { @@ -3470,7 +3470,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6323" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6377" } }, { @@ -3531,7 +3531,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6334" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6388" } }, { @@ -3569,7 +3569,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6345" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6399" } }, { @@ -3729,7 +3729,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6356" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6410" } }, { @@ -3913,7 +3913,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6367" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6421" } }, { @@ -4054,7 +4054,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6378" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6432" } }, { @@ -4107,7 +4107,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6389" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6443" } }, { @@ -4250,7 +4250,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6400" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6454" } }, { @@ -4474,7 +4474,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6411" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6465" } }, { @@ -4601,7 +4601,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6422" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6476" } }, { @@ -4768,7 +4768,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6433" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6487" } }, { @@ -4895,7 +4895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6444" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6498" } }, { @@ -4933,7 +4933,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6455" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6509" } }, { @@ -4972,7 +4972,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6466" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6520" } }, { @@ -4995,7 +4995,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6477" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6531" } }, { @@ -5034,7 +5034,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6488" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6542" } }, { @@ -5057,7 +5057,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6499" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6553" } }, { @@ -5096,7 +5096,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6510" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6564" } }, { @@ -5130,7 +5130,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6521" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6575" } }, { @@ -5184,7 +5184,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6532" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6586" } }, { @@ -5223,7 +5223,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6543" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6597" } }, { @@ -5262,7 +5262,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6554" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6608" } }, { @@ -5297,7 +5297,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6565" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6619" } }, { @@ -5477,7 +5477,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6576" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6630" } }, { @@ -5506,7 +5506,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6587" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6641" } }, { @@ -5529,7 +5529,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6598" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6652" } } ] diff --git a/build/parameters.go b/build/parameters.go index 9e60f12a6a3..31243e96fcd 100644 --- a/build/parameters.go +++ b/build/parameters.go @@ -1,19 +1,84 @@ package build import ( - _ "embed" + "github.com/filecoin-project/go-state-types/abi" + actorstypes "github.com/filecoin-project/go-state-types/actors" + + "github.com/filecoin-project/lotus/build/buildconstants" + proofparams "github.com/filecoin-project/lotus/build/proof-params" + "github.com/filecoin-project/lotus/chain/actors/policy" ) -//go:embed proof-params/parameters.json -var params []byte +var ParametersJSON = proofparams.ParametersJSON +var SrsJSON = proofparams.SrsJSON + +// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical. +var BundleOverrides map[actorstypes.Version]string + +var BootstrappersFile = buildconstants.BootstrappersFile // Deprecated: Use buildconstants.BootstrappersFile instead + +var GenesisFile = buildconstants.GenesisFile // Deprecated: Use buildconstants.GenesisFile instead + +var NetworkBundle = buildconstants.NetworkBundle // Deprecated: Use buildconstants.NetworkBundle instead +var ActorDebugging = buildconstants.ActorDebugging // Deprecated: Use buildconstants.ActorDebugging instead + +var GenesisNetworkVersion = buildconstants.GenesisNetworkVersion // Deprecated: Use buildconstants.GenesisNetworkVersion instead + +var UpgradeBreezeHeight abi.ChainEpoch = buildconstants.UpgradeBreezeHeight // Deprecated: Use buildconstants.UpgradeBreezeHeight instead + +var BreezeGasTampingDuration abi.ChainEpoch = buildconstants.BreezeGasTampingDuration // Deprecated: Use buildconstants.BreezeGasTampingDuration instead + +// upgrade heights +var UpgradeSmokeHeight abi.ChainEpoch = buildconstants.UpgradeSmokeHeight // Deprecated: Use buildconstants.UpgradeSmokeHeight instead +var UpgradeIgnitionHeight abi.ChainEpoch = buildconstants.UpgradeIgnitionHeight // Deprecated: Use buildconstants.UpgradeIgnitionHeight instead +var UpgradeRefuelHeight abi.ChainEpoch = buildconstants.UpgradeRefuelHeight // Deprecated: Use buildconstants.UpgradeRefuelHeight instead +var UpgradeTapeHeight abi.ChainEpoch = buildconstants.UpgradeTapeHeight // Deprecated: Use buildconstants.UpgradeTapeHeight instead +var UpgradeAssemblyHeight abi.ChainEpoch = buildconstants.UpgradeAssemblyHeight // Deprecated: Use buildconstants.UpgradeAssemblyHeight instead +var UpgradeLiftoffHeight abi.ChainEpoch = buildconstants.UpgradeLiftoffHeight // Deprecated: Use buildconstants.UpgradeLiftoffHeight instead +var UpgradeKumquatHeight abi.ChainEpoch = buildconstants.UpgradeKumquatHeight // Deprecated: Use buildconstants.UpgradeKumquatHeight instead +var UpgradeCalicoHeight abi.ChainEpoch = buildconstants.UpgradeCalicoHeight // Deprecated: Use buildconstants.UpgradeCalicoHeight instead +var UpgradePersianHeight abi.ChainEpoch = buildconstants.UpgradePersianHeight // Deprecated: Use buildconstants.UpgradePersianHeight instead +var UpgradeOrangeHeight abi.ChainEpoch = buildconstants.UpgradeOrangeHeight // Deprecated: Use buildconstants.UpgradeOrangeHeight instead +var UpgradeClausHeight abi.ChainEpoch = buildconstants.UpgradeClausHeight // Deprecated: Use buildconstants.UpgradeClausHeight instead +var UpgradeTrustHeight abi.ChainEpoch = buildconstants.UpgradeTrustHeight // Deprecated: Use buildconstants.UpgradeTrustHeight instead +var UpgradeNorwegianHeight abi.ChainEpoch = buildconstants.UpgradeNorwegianHeight // Deprecated: Use buildconstants.UpgradeNorwegianHeight instead +var UpgradeTurboHeight abi.ChainEpoch = buildconstants.UpgradeTurboHeight // Deprecated: Use buildconstants.UpgradeTurboHeight instead +var UpgradeHyperdriveHeight abi.ChainEpoch = buildconstants.UpgradeHyperdriveHeight // Deprecated: Use buildconstants.UpgradeHyperdriveHeight instead +var UpgradeChocolateHeight abi.ChainEpoch = buildconstants.UpgradeChocolateHeight // Deprecated: Use buildconstants.UpgradeChocolateHeight instead +var UpgradeOhSnapHeight abi.ChainEpoch = buildconstants.UpgradeOhSnapHeight // Deprecated: Use buildconstants.UpgradeOhSnapHeight instead +var UpgradeSkyrHeight abi.ChainEpoch = buildconstants.UpgradeSkyrHeight // Deprecated: Use buildconstants.UpgradeSkyrHeight instead +var UpgradeSharkHeight abi.ChainEpoch = buildconstants.UpgradeSharkHeight // Deprecated: Use buildconstants.UpgradeSharkHeight instead +var UpgradeHyggeHeight abi.ChainEpoch = buildconstants.UpgradeHyggeHeight // Deprecated: Use buildconstants.UpgradeHyggeHeight instead +var UpgradeLightningHeight abi.ChainEpoch = buildconstants.UpgradeLightningHeight // Deprecated: Use buildconstants.UpgradeLightningHeight instead +var UpgradeThunderHeight abi.ChainEpoch = buildconstants.UpgradeThunderHeight // Deprecated: Use buildconstants.UpgradeThunderHeight instead +var UpgradeWatermelonHeight abi.ChainEpoch = buildconstants.UpgradeWatermelonHeight // Deprecated: Use buildconstants.UpgradeWatermelonHeight instead +var UpgradeDragonHeight abi.ChainEpoch = buildconstants.UpgradeDragonHeight // Deprecated: Use buildconstants.UpgradeDragonHeight instead +var UpgradePhoenixHeight abi.ChainEpoch = buildconstants.UpgradePhoenixHeight // Deprecated: Use buildconstants.UpgradePhoenixHeight instead +var UpgradeWaffleHeight abi.ChainEpoch = buildconstants.UpgradeWaffleHeight // Deprecated: Use buildconstants.UpgradeWaffleHeight instead + +// This fix upgrade only ran on calibrationnet +var UpgradeWatermelonFixHeight abi.ChainEpoch = buildconstants.UpgradeWatermelonFixHeight // Deprecated: Use buildconstants.UpgradeWatermelonFixHeight instead + +// This fix upgrade only ran on calibrationnet +var UpgradeWatermelonFix2Height abi.ChainEpoch = buildconstants.UpgradeWatermelonFix2Height // Deprecated: Use buildconstants.UpgradeWatermelonFix2Height instead + +// This fix upgrade only ran on calibrationnet +var UpgradeCalibrationDragonFixHeight abi.ChainEpoch = buildconstants.UpgradeCalibrationDragonFixHeight // Deprecated: Use buildconstants.UpgradeCalibrationDragonFixHeight instead + +var SupportedProofTypes = buildconstants.SupportedProofTypes // Deprecated: Use buildconstants.SupportedProofTypes instead +var ConsensusMinerMinPower = buildconstants.ConsensusMinerMinPower // Deprecated: Use buildconstants.ConsensusMinerMinPower instead +var PreCommitChallengeDelay = buildconstants.PreCommitChallengeDelay // Deprecated: Use buildconstants.PreCommitChallengeDelay instead + +var BlockDelaySecs = buildconstants.BlockDelaySecs // Deprecated: Use buildconstants.BlockDelaySecs instead + +var PropagationDelaySecs = buildconstants.PropagationDelaySecs // Deprecated: Use buildconstants.PropagationDelaySecs instead + +const BootstrapPeerThreshold = buildconstants.BootstrapPeerThreshold // Deprecated: Use buildconstants.BootstrapPeerThreshold instead -//go:embed proof-params/srs-inner-product.json -var srs []byte +// ChainId defines the chain ID used in the Ethereum JSON-RPC endpoint. +// As per https://github.com/ethereum-lists/chains +const Eip155ChainId = buildconstants.Eip155ChainId // Deprecated: Use buildconstants.Eip155ChainId instead -func ParametersJSON() []byte { - return params -} +var WhitelistedBlock = buildconstants.WhitelistedBlock // Deprecated: Use buildconstants.WhitelistedBlock instead -func SrsJSON() []byte { - return srs -} +const Finality = policy.ChainFinality // Deprecated: Use policy.ChainFinality instead diff --git a/build/params_shared_funcs.go b/build/params_shared_funcs.go index d117264ab6f..706bafcb303 100644 --- a/build/params_shared_funcs.go +++ b/build/params_shared_funcs.go @@ -1,11 +1,11 @@ package build import ( - "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/protocol" + "os" - "github.com/filecoin-project/go-address" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/node/modules/dtypes" ) @@ -28,24 +28,16 @@ func DhtProtocolName(netName dtypes.NetworkName) protocol.ID { return protocol.ID("/fil/kad/" + string(netName)) } -func SetAddressNetwork(n address.Network) { - address.CurrentNetwork = n -} +// Deprecated: Use buildconstants.SetAddressNetwork instead. +var SetAddressNetwork = buildconstants.SetAddressNetwork -func MustParseAddress(addr string) address.Address { - ret, err := address.NewFromString(addr) - if err != nil { - panic(err) - } +// Deprecated: Use buildconstants.MustParseAddress instead. +var MustParseAddress = buildconstants.MustParseAddress - return ret -} - -func MustParseCid(c string) cid.Cid { - ret, err := cid.Decode(c) - if err != nil { - panic(err) - } +// Deprecated: Use buildconstants.MustParseCid instead. +var MustParseCid = buildconstants.MustParseCid - return ret +func IsF3Enabled() bool { + const F3DisableEnvKey = "LOTUS_DISABLE_F3" + return buildconstants.F3Enabled && len(os.Getenv(F3DisableEnvKey)) == 0 } diff --git a/build/params_shared_vals.go b/build/params_shared_vals.go index 25cfdd2ea32..ab1bca3bb59 100644 --- a/build/params_shared_vals.go +++ b/build/params_shared_vals.go @@ -1,130 +1,94 @@ -//go:build !testground -// +build !testground - package build import ( "math/big" - "os" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/network" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors/policy" ) // ///// // Storage -const UnixfsChunkSize uint64 = 1 << 20 -const UnixfsLinksPerLevel = 1024 +var UnixfsChunkSize uint64 = buildconstants.UnixfsChunkSize // Deprecated: Use buildconstants.UnixfsChunkSize instead +var UnixfsLinksPerLevel = buildconstants.UnixfsLinksPerLevel // Deprecated: Use buildconstants.UnixfsLinksPerLevel instead // ///// // Consensus / Network -const AllowableClockDriftSecs = uint64(1) - -// Used by tests and some obscure tooling -/* inline-gen template -const TestNetworkVersion = network.Version{{.latestNetworkVersion}} -/* inline-gen start */ -const TestNetworkVersion = network.Version23 - -/* inline-gen end */ +var AllowableClockDriftSecs = buildconstants.AllowableClockDriftSecs // Deprecated: Use buildconstants.AllowableClockDriftSecs instead // Epochs -const ForkLengthThreshold = Finality +const ForkLengthThreshold = Finality // Deprecated: Use Finality instead // Blocks (e) -var BlocksPerEpoch = uint64(builtin2.ExpectedLeadersPerEpoch) +var BlocksPerEpoch = buildconstants.BlocksPerEpoch // Deprecated: Use buildconstants.BlocksPerEpoch instead // Epochs -const Finality = policy.ChainFinality -const MessageConfidence = uint64(5) +var MessageConfidence = buildconstants.MessageConfidence // Deprecated: Use buildconstants.MessageConfidence instead -// constants for Weight calculation -// The ratio of weight contributed by short-term vs long-term factors in a given round -const WRatioNum = int64(1) -const WRatioDen = uint64(2) - -// ///// -// Proofs - -// Epochs -// TODO: unused -const SealRandomnessLookback = policy.SealRandomnessLookback +var WRatioNum = buildconstants.WRatioNum // Deprecated: Use buildconstants.WRatioNum instead +var WRatioDen = buildconstants.WRatioDen // Deprecated: Use buildconstants.WRatioDen instead // ///// // Mining // Epochs -const TicketRandomnessLookback = abi.ChainEpoch(1) - -// ///// -// Address - -const AddressMainnetEnvVar = "_mainnet_" +var TicketRandomnessLookback = buildconstants.TicketRandomnessLookback // Deprecated: Use buildconstants.TicketRandomnessLookback instead // the 'f' prefix doesn't matter -var ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a") - +var ZeroAddress = buildconstants.ZeroAddress // Deprecated: Use buildconstants.ZeroAddress instead // ///// // Devnet settings -var Devnet = true +var Devnet = buildconstants.Devnet // Deprecated: Use buildconstants.Devnet instead -const FilBase = uint64(2_000_000_000) -const FilAllocStorageMining = uint64(1_100_000_000) +var FilBase = buildconstants.FilBase // Deprecated: Use buildconstants.FilBase instead +var FilAllocStorageMining = buildconstants.FilAllocStorageMining // Deprecated: Use buildconstants.FilAllocStorageMining instead -const FilecoinPrecision = uint64(1_000_000_000_000_000_000) -const FilReserved = uint64(300_000_000) +var FilecoinPrecision = buildconstants.FilecoinPrecision // Deprecated: Use buildconstants.FilecoinPrecision instead +var FilReserved = buildconstants.FilReserved // Deprecated: Use buildconstants.FilReserved instead var InitialRewardBalance *big.Int var InitialFilReserved *big.Int -// TODO: Move other important consts here - func init() { InitialRewardBalance = big.NewInt(int64(FilAllocStorageMining)) InitialRewardBalance = InitialRewardBalance.Mul(InitialRewardBalance, big.NewInt(int64(FilecoinPrecision))) InitialFilReserved = big.NewInt(int64(FilReserved)) InitialFilReserved = InitialFilReserved.Mul(InitialFilReserved, big.NewInt(int64(FilecoinPrecision))) - - if os.Getenv("LOTUS_ADDRESS_TYPE") == AddressMainnetEnvVar { - SetAddressNetwork(address.Mainnet) - } } // Sync -const BadBlockCacheSize = 1 << 15 +var BadBlockCacheSize = buildconstants.BadBlockCacheSize // Deprecated: Use buildconstants.BadBlockCacheSize instead -// assuming 4000 messages per round, this lets us not lose any messages across a -// 10 block reorg. -const BlsSignatureCacheSize = 40000 +var BlsSignatureCacheSize = buildconstants.BlsSignatureCacheSize // Deprecated: Use buildconstants.BlsSignatureCacheSize instead -// Size of signature verification cache -// 32k keeps the cache around 10MB in size, max -const VerifSigCacheSize = 32000 +var VerifSigCacheSize = buildconstants.VerifSigCacheSize // Deprecated: Use buildconstants.VerifSigCacheSize instead // /////// // Limits -// TODO: If this is gonna stay, it should move to specs-actors -const BlockMessageLimit = 10000 +var BlockMessageLimit = buildconstants.BlockMessageLimit // Deprecated: Use buildconstants.BlockMessageLimit instead -var BlockGasLimit = int64(10_000_000_000) -var BlockGasTarget = BlockGasLimit / 2 +var BlockGasLimit = buildconstants.BlockGasLimit // Deprecated: Use buildconstants.BlockGasLimit instead +var BlockGasTarget = buildconstants.BlockGasTarget // Deprecated: Use buildconstants.BlockGasTarget instead -const BaseFeeMaxChangeDenom = 8 // 12.5% -const InitialBaseFee = 100e6 -const MinimumBaseFee = 100 -const PackingEfficiencyNum = 4 -const PackingEfficiencyDenom = 5 +var BaseFeeMaxChangeDenom int64 = buildconstants.BaseFeeMaxChangeDenom // Deprecated: Use buildconstants.BaseFeeMaxChangeDenom instead +var InitialBaseFee int64 = buildconstants.InitialBaseFee // Deprecated: Use buildconstants.InitialBaseFee instead +var MinimumBaseFee int64 = buildconstants.MinimumBaseFee // Deprecated: Use buildconstants.MinimumBaseFee instead +var PackingEfficiencyNum int64 = buildconstants.PackingEfficiencyNum // Deprecated: Use buildconstants.PackingEfficiencyNum instead +var PackingEfficiencyDenom int64 = buildconstants.PackingEfficiencyDenom // Deprecated: Use buildconstants.PackingEfficiencyDenom instead -// revive:disable-next-line:exported -// Actor consts -// TODO: pieceSize unused from actors -var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) +var MinDealDuration = buildconstants.MinDealDuration // Deprecated: Use buildconstants.MinDealDuration instead +var MaxDealDuration = buildconstants.MaxDealDuration // Deprecated: Use buildconstants.MaxDealDuration instead + +const TestNetworkVersion = buildconstants.TestNetworkVersion // Deprecated: Use buildconstants.TestNetworkVersion instead + +func init() { + policy.SetSupportedProofTypes(buildconstants.SupportedProofTypes...) + policy.SetConsensusMinerMinPower(buildconstants.ConsensusMinerMinPower) + policy.SetMinVerifiedDealSize(buildconstants.MinVerifiedDealSize) + policy.SetPreCommitChallengeDelay(buildconstants.PreCommitChallengeDelay) +} diff --git a/build/params_testground_vals.go b/build/params_testground_vals.go new file mode 100644 index 00000000000..4503f76dcfb --- /dev/null +++ b/build/params_testground_vals.go @@ -0,0 +1,12 @@ +//go:build testground +// +build testground + +package build + +import ( + "github.com/filecoin-project/lotus/chain/actors/policy" +) + +// Actor consts +// TODO: pieceSize unused from actors +var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) diff --git a/build/proof-params/parameters.go b/build/proof-params/parameters.go new file mode 100644 index 00000000000..1bef20f60f7 --- /dev/null +++ b/build/proof-params/parameters.go @@ -0,0 +1,19 @@ +package proofparams + +import ( + _ "embed" +) + +//go:embed parameters.json +var params []byte + +//go:embed srs-inner-product.json +var srs []byte + +func ParametersJSON() []byte { + return params +} + +func SrsJSON() []byte { + return srs +} diff --git a/build/version.go b/build/version.go index a6af3eae8b7..5ee2bf71d49 100644 --- a/build/version.go +++ b/build/version.go @@ -1,37 +1,37 @@ package build -import "os" +import ( + "os" + + "github.com/filecoin-project/lotus/build/buildconstants" +) type BuildVersion string var CurrentCommit string -var BuildType int - -const ( - BuildDefault = 0 - BuildMainnet = 0x1 - Build2k = 0x2 - BuildDebug = 0x3 - BuildCalibnet = 0x4 - BuildInteropnet = 0x5 - BuildButterflynet = 0x7 -) +var BuildType = buildconstants.BuildType // Deprecated: Use buildconstants.BuildType instead +var BuildMainnet = buildconstants.BuildMainnet // Deprecated: Use buildconstants.BuildMainnet instead +var Build2k = buildconstants.Build2k // Deprecated: Use buildconstants.Build2k instead +var BuildDebug = buildconstants.BuildDebug // Deprecated: Use buildconstants.BuildDebug instead +var BuildCalibnet = buildconstants.BuildCalibnet // Deprecated: Use buildconstants.BuildCalibnet instead +var BuildInteropnet = buildconstants.BuildInteropnet // Deprecated: Use buildconstants.BuildInteropnet instead +var BuildButterflynet = buildconstants.BuildButterflynet // Deprecated: Use buildconstants.BuildButterflynet instead func BuildTypeString() string { switch BuildType { - case BuildDefault: + case buildconstants.BuildDefault: return "" - case BuildMainnet: + case buildconstants.BuildMainnet: return "+mainnet" - case Build2k: + case buildconstants.Build2k: return "+2k" - case BuildDebug: + case buildconstants.BuildDebug: return "+debug" - case BuildCalibnet: + case buildconstants.BuildCalibnet: return "+calibnet" - case BuildInteropnet: + case buildconstants.BuildInteropnet: return "+interopnet" - case BuildButterflynet: + case buildconstants.BuildButterflynet: return "+butterflynet" default: return "+huh?" @@ -39,7 +39,7 @@ func BuildTypeString() string { } // NodeBuildVersion is the local build version of the Lotus daemon -const NodeBuildVersion string = "1.27.2-dev" +const NodeBuildVersion string = "1.28.1-dev" func NodeUserVersion() BuildVersion { if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" { @@ -50,7 +50,7 @@ func NodeUserVersion() BuildVersion { } // MinerBuildVersion is the local build version of the Lotus miner -const MinerBuildVersion = "1.27.2-dev" +const MinerBuildVersion = "1.28.1-dev" func MinerUserVersion() BuildVersion { if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" { diff --git a/chain/beacon/drand/drand_test.go b/chain/beacon/drand/drand_test.go index c35c0da18f5..06ae8ae2c35 100644 --- a/chain/beacon/drand/drand_test.go +++ b/chain/beacon/drand/drand_test.go @@ -15,11 +15,12 @@ import ( "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) func TestPrintGroupInfo(t *testing.T) { - server := build.DrandConfigs[build.DrandTestnet].Servers[0] - chainInfo := build.DrandConfigs[build.DrandTestnet].ChainInfoJSON + server := build.DrandConfigs[buildconstants.DrandTestnet].Servers[0] + chainInfo := build.DrandConfigs[buildconstants.DrandTestnet].ChainInfoJSON drandChain, err := dchain.InfoFromJSON(bytes.NewReader([]byte(chainInfo))) assert.NoError(t, err) @@ -37,7 +38,7 @@ func TestPrintGroupInfo(t *testing.T) { func TestMaxBeaconRoundForEpoch(t *testing.T) { todayTs := uint64(1652222222) - db, err := NewDrandBeacon(todayTs, build.BlockDelaySecs, nil, build.DrandConfigs[build.DrandTestnet]) + db, err := NewDrandBeacon(todayTs, build.BlockDelaySecs, nil, build.DrandConfigs[buildconstants.DrandTestnet]) assert.NoError(t, err) assert.True(t, db.IsChained()) mbr15 := db.MaxBeaconRoundForEpoch(network.Version15, 100) @@ -47,7 +48,7 @@ func TestMaxBeaconRoundForEpoch(t *testing.T) { func TestQuicknetIsChained(t *testing.T) { todayTs := uint64(1652222222) - db, err := NewDrandBeacon(todayTs, build.BlockDelaySecs, nil, build.DrandConfigs[build.DrandQuicknet]) + db, err := NewDrandBeacon(todayTs, build.BlockDelaySecs, nil, build.DrandConfigs[buildconstants.DrandQuicknet]) assert.NoError(t, err) assert.False(t, db.IsChained()) } diff --git a/chain/consensus/common.go b/chain/consensus/common.go index f679b92b682..9f832e69433 100644 --- a/chain/consensus/common.go +++ b/chain/consensus/common.go @@ -24,6 +24,7 @@ import ( "github.com/filecoin-project/lotus/api" bstore "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/stmgr" @@ -168,12 +169,12 @@ func IsValidForSending(nv network.Version, act *types.Actor) bool { // Allow placeholder actors with a delegated address and nonce 0 to send a message. // These will be converted to an EthAccount actor on first send. - if !builtin.IsPlaceholderActor(act.Code) || act.Nonce != 0 || act.Address == nil || act.Address.Protocol() != address.Delegated { + if !builtin.IsPlaceholderActor(act.Code) || act.Nonce != 0 || act.DelegatedAddress == nil || act.DelegatedAddress.Protocol() != address.Delegated { return false } // Only allow such actors to send if their delegated address is in the EAM's namespace. - id, _, err := varint.FromUvarint(act.Address.Payload()) + id, _, err := varint.FromUvarint(act.DelegatedAddress.Payload()) return err == nil && id == builtintypes.EthereumAddressManagerActorID } @@ -225,7 +226,7 @@ func checkBlockMessages(ctx context.Context, sm *stmgr.StateManager, cs *store.C // ValidForBlockInclusion checks if any single message does not exceed BlockGasLimit // So below is overflow safe sumGasLimit += m.GasLimit - if sumGasLimit > build.BlockGasLimit { + if sumGasLimit > buildconstants.BlockGasLimit { return xerrors.Errorf("block gas limit exceeded") } diff --git a/chain/consensus/compute_state.go b/chain/consensus/compute_state.go index a5e82a57ffe..b8fec248aca 100644 --- a/chain/consensus/compute_state.go +++ b/chain/consensus/compute_state.go @@ -27,6 +27,7 @@ import ( "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/cron" "github.com/filecoin-project/lotus/chain/actors/builtin/reward" @@ -129,7 +130,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context, Value: types.NewInt(0), GasFeeCap: types.NewInt(0), GasPremium: types.NewInt(0), - GasLimit: build.BlockGasLimit * 10000, // Make super sure this is never too little + GasLimit: buildconstants.BlockGasLimit * 10000, // Make super sure this is never too little Method: cron.Methods.EpochTick, Params: nil, } diff --git a/chain/consensus/filcns/upgrades.go b/chain/consensus/filcns/upgrades.go index 8ddd71967fe..becd91bc4e2 100644 --- a/chain/consensus/filcns/upgrades.go +++ b/chain/consensus/filcns/upgrades.go @@ -2115,11 +2115,11 @@ func buildUpgradeActorsV12MinerFix(oldBuggyMinerCID, newManifestCID cid.Cid) fun } return actorsOut.SetActor(a, &types.ActorV5{ - Code: newCid, - Head: actor.Head, - Nonce: actor.Nonce, - Balance: actor.Balance, - Address: actor.Address, + Code: newCid, + Head: actor.Head, + Nonce: actor.Nonce, + Balance: actor.Balance, + DelegatedAddress: actor.DelegatedAddress, }) }) if err != nil { @@ -2153,8 +2153,8 @@ func buildUpgradeActorsV12MinerFix(oldBuggyMinerCID, newManifestCID cid.Cid) fun return xerrors.Errorf("mismatched balance for actor %s: %d != %d", a, inActor.Balance, outActor.Balance) } - if inActor.Address != outActor.Address && inActor.Address.String() != outActor.Address.String() { - return xerrors.Errorf("mismatched address for actor %s: %s != %s", a, inActor.Address, outActor.Address) + if inActor.DelegatedAddress != outActor.DelegatedAddress && inActor.DelegatedAddress.String() != outActor.DelegatedAddress.String() { + return xerrors.Errorf("mismatched address for actor %s: %s != %s", a, inActor.DelegatedAddress, outActor.DelegatedAddress) } if inActor.Head != outActor.Head && a != builtin.SystemActorAddr { @@ -2413,11 +2413,11 @@ func upgradeActorsV13VerifregFix(oldBuggyVerifregCID, newManifestCID cid.Cid) fu } return actorsOut.SetActor(a, &types.ActorV5{ - Code: newCid, - Head: actor.Head, - Nonce: actor.Nonce, - Balance: actor.Balance, - Address: actor.Address, + Code: newCid, + Head: actor.Head, + Nonce: actor.Nonce, + Balance: actor.Balance, + DelegatedAddress: actor.DelegatedAddress, }) }) if err != nil { @@ -2451,8 +2451,8 @@ func upgradeActorsV13VerifregFix(oldBuggyVerifregCID, newManifestCID cid.Cid) fu return xerrors.Errorf("mismatched balance for actor %s: %d != %d", a, inActor.Balance, outActor.Balance) } - if inActor.Address != outActor.Address && inActor.Address.String() != outActor.Address.String() { - return xerrors.Errorf("mismatched address for actor %s: %s != %s", a, inActor.Address, outActor.Address) + if inActor.DelegatedAddress != outActor.DelegatedAddress && inActor.DelegatedAddress.String() != outActor.DelegatedAddress.String() { + return xerrors.Errorf("mismatched address for actor %s: %s != %s", a, inActor.DelegatedAddress, outActor.DelegatedAddress) } if inActor.Head != outActor.Head && a != builtin.SystemActorAddr { diff --git a/chain/ethhashlookup/eth_transaction_hash_lookup.go b/chain/ethhashlookup/eth_transaction_hash_lookup.go index d936809128b..2d83ba67653 100644 --- a/chain/ethhashlookup/eth_transaction_hash_lookup.go +++ b/chain/ethhashlookup/eth_transaction_hash_lookup.go @@ -1,6 +1,7 @@ package ethhashlookup import ( + "context" "database/sql" "errors" "strconv" @@ -10,20 +11,12 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/lotus/chain/types/ethtypes" + "github.com/filecoin-project/lotus/lib/sqlite" ) -var ErrNotFound = errors.New("not found") +const DefaultDbFilename = "txhash.db" -var pragmas = []string{ - "PRAGMA synchronous = normal", - "PRAGMA temp_store = memory", - "PRAGMA mmap_size = 30000000000", - "PRAGMA page_size = 32768", - "PRAGMA auto_vacuum = NONE", - "PRAGMA automatic_index = OFF", - "PRAGMA journal_mode = WAL", - "PRAGMA read_uncommitted = ON", -} +var ErrNotFound = errors.New("not found") var ddls = []string{ `CREATE TABLE IF NOT EXISTS eth_tx_hashes ( @@ -33,18 +26,8 @@ var ddls = []string{ )`, `CREATE INDEX IF NOT EXISTS insertion_time_index ON eth_tx_hashes (insertion_time)`, - - // metadata containing version of schema - `CREATE TABLE IF NOT EXISTS _meta ( - version UINT64 NOT NULL UNIQUE - )`, - - // version 1. - `INSERT OR IGNORE INTO _meta (version) VALUES (1)`, } -const schemaVersion = 1 - const ( insertTxHash = `INSERT INTO eth_tx_hashes (hash, cid) @@ -103,50 +86,18 @@ func (ei *EthTxHashLookup) DeleteEntriesOlderThan(days int) (int64, error) { return res.RowsAffected() } -func NewTransactionHashLookup(path string) (*EthTxHashLookup, error) { - db, err := sql.Open("sqlite3", path+"?mode=rwc") +func NewTransactionHashLookup(ctx context.Context, path string) (*EthTxHashLookup, error) { + db, _, err := sqlite.Open(path) if err != nil { - return nil, xerrors.Errorf("open sqlite3 database: %w", err) + return nil, xerrors.Errorf("failed to setup eth transaction hash lookup db: %w", err) } - for _, pragma := range pragmas { - if _, err := db.Exec(pragma); err != nil { - _ = db.Close() - return nil, xerrors.Errorf("exec pragma %q: %w", pragma, err) - } - } - - q, err := db.Query("SELECT name FROM sqlite_master WHERE type='table' AND name='_meta';") - if err == sql.ErrNoRows || !q.Next() { - // empty database, create the schema - for _, ddl := range ddls { - if _, err := db.Exec(ddl); err != nil { - _ = db.Close() - return nil, xerrors.Errorf("exec ddl %q: %w", ddl, err) - } - } - } else if err != nil { + if err := sqlite.InitDb(ctx, "eth transaction hash lookup", db, ddls, []sqlite.MigrationFunc{}); err != nil { _ = db.Close() - return nil, xerrors.Errorf("looking for _meta table: %w", err) - } else { - // Ensure we don't open a database from a different schema version - - row := db.QueryRow("SELECT max(version) FROM _meta") - var version int - err := row.Scan(&version) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("invalid database version: no version found") - } - if version != schemaVersion { - _ = db.Close() - return nil, xerrors.Errorf("invalid database version: got %d, expected %d", version, schemaVersion) - } + return nil, xerrors.Errorf("failed to init eth transaction hash lookup db: %w", err) } - return &EthTxHashLookup{ - db: db, - }, nil + return &EthTxHashLookup{db: db}, nil } func (ei *EthTxHashLookup) Close() error { diff --git a/chain/events/filter/index.go b/chain/events/filter/index.go index fed6c42eb31..cf533cec3e4 100644 --- a/chain/events/filter/index.go +++ b/chain/events/filter/index.go @@ -8,7 +8,6 @@ import ( "sort" "strings" "sync" - "time" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" @@ -20,19 +19,10 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/lib/sqlite" ) -var pragmas = []string{ - "PRAGMA synchronous = normal", - "PRAGMA temp_store = memory", - "PRAGMA mmap_size = 30000000000", - "PRAGMA page_size = 32768", - "PRAGMA auto_vacuum = NONE", - "PRAGMA automatic_index = OFF", - "PRAGMA journal_mode = WAL", - "PRAGMA wal_autocheckpoint = 256", // checkpoint @ 256 pages - "PRAGMA journal_size_limit = 0", // always reset journal and wal files -} +const DefaultDbFilename = "events.db" // Any changes to this schema should be matched for the `lotus-shed indexes backfill-events` command @@ -70,18 +60,6 @@ var ddls = []string{ createIndexEventEntryEventId, createIndexEventsSeenHeight, createIndexEventsSeenTipsetKeyCid, - - // metadata containing version of schema - `CREATE TABLE IF NOT EXISTS _meta ( - version UINT64 NOT NULL UNIQUE - )`, - - `INSERT OR IGNORE INTO _meta (version) VALUES (1)`, - `INSERT OR IGNORE INTO _meta (version) VALUES (2)`, - `INSERT OR IGNORE INTO _meta (version) VALUES (3)`, - `INSERT OR IGNORE INTO _meta (version) VALUES (4)`, - `INSERT OR IGNORE INTO _meta (version) VALUES (5)`, - `INSERT OR IGNORE INTO _meta (version) VALUES (6)`, } var ( @@ -89,8 +67,6 @@ var ( ) const ( - schemaVersion = 6 - eventExists = `SELECT MAX(id) FROM event WHERE height=? AND tipset_key=? AND tipset_key_cid=? AND emitter_addr=? AND event_index=? AND message_cid=? AND message_index=?` insertEvent = `INSERT OR IGNORE INTO event(height, tipset_key, tipset_key_cid, emitter_addr, event_index, message_cid, message_index, reverted) VALUES(?, ?, ?, ?, ?, ?, ?, ?)` insertEntry = `INSERT OR IGNORE INTO event_entry(event_id, indexed, flags, key, codec, value) VALUES(?, ?, ?, ?, ?, ?)` @@ -212,436 +188,27 @@ func (ei *EventIndex) initStatements() (err error) { return nil } -func (ei *EventIndex) migrateToVersion2(ctx context.Context, chainStore *store.ChainStore) error { - now := time.Now() - - tx, err := ei.db.BeginTx(ctx, nil) - if err != nil { - return xerrors.Errorf("begin transaction: %w", err) - } - // rollback the transaction (a no-op if the transaction was already committed) - defer func() { _ = tx.Rollback() }() - - // create some temporary indices to help speed up the migration - _, err = tx.ExecContext(ctx, "CREATE INDEX IF NOT EXISTS tmp_height_tipset_key_cid ON event (height,tipset_key_cid)") - if err != nil { - return xerrors.Errorf("create index tmp_height_tipset_key_cid: %w", err) - } - _, err = tx.ExecContext(ctx, "CREATE INDEX IF NOT EXISTS tmp_tipset_key_cid ON event (tipset_key_cid)") - if err != nil { - return xerrors.Errorf("create index tmp_tipset_key_cid: %w", err) - } - - stmtDeleteOffChainEvent, err := tx.PrepareContext(ctx, "DELETE FROM event WHERE tipset_key_cid!=? and height=?") - if err != nil { - return xerrors.Errorf("prepare stmtDeleteOffChainEvent: %w", err) - } - - stmtSelectEvent, err := tx.PrepareContext(ctx, "SELECT id FROM event WHERE tipset_key_cid=? ORDER BY message_index ASC, event_index ASC, id DESC LIMIT 1") - if err != nil { - return xerrors.Errorf("prepare stmtSelectEvent: %w", err) - } - - stmtDeleteEvent, err := tx.PrepareContext(ctx, "DELETE FROM event WHERE tipset_key_cid=? AND id= minHeight.Int64 { - if currTs.Height()%1000 == 0 { - log.Infof("Migrating height %d (remaining %d)", currTs.Height(), int64(currTs.Height())-minHeight.Int64) - } - - tsKey := currTs.Parents() - currTs, err = chainStore.GetTipSetFromKey(ctx, tsKey) - if err != nil { - return xerrors.Errorf("get tipset from key: %w", err) - } - log.Debugf("Migrating height %d", currTs.Height()) - - tsKeyCid, err := currTs.Key().Cid() - if err != nil { - return fmt.Errorf("tipset key cid: %w", err) - } - - // delete all events that are not in the canonical chain - _, err = stmtDeleteOffChainEvent.Exec(tsKeyCid.Bytes(), currTs.Height()) - if err != nil { - return xerrors.Errorf("delete off chain event: %w", err) - } - - // find the first eventId from the last time the tipset was applied - var eventId sql.NullInt64 - err = stmtSelectEvent.QueryRow(tsKeyCid.Bytes()).Scan(&eventId) - if err != nil { - if errors.Is(err, sql.ErrNoRows) { - continue - } - return xerrors.Errorf("select event: %w", err) - } - - // this tipset might not have any events which is ok - if !eventId.Valid { - continue - } - log.Debugf("Deleting all events with id < %d at height %d", eventId.Int64, currTs.Height()) - - res, err := stmtDeleteEvent.Exec(tsKeyCid.Bytes(), eventId.Int64) - if err != nil { - return xerrors.Errorf("delete event: %w", err) - } - - nrRowsAffected, err := res.RowsAffected() - if err != nil { - return xerrors.Errorf("rows affected: %w", err) - } - log.Debugf("deleted %d events from tipset %s", nrRowsAffected, tsKeyCid.String()) - } - - // delete all entries that have an event_id that doesn't exist (since we don't have a foreign - // key constraint that gives us cascading deletes) - res, err := tx.ExecContext(ctx, "DELETE FROM event_entry WHERE event_id NOT IN (SELECT id FROM event)") - if err != nil { - return xerrors.Errorf("delete event_entry: %w", err) - } - - nrRowsAffected, err := res.RowsAffected() - if err != nil { - return xerrors.Errorf("rows affected: %w", err) - } - log.Infof("Cleaned up %d entries that had deleted events\n", nrRowsAffected) - - // drop the temporary indices after the migration - _, err = tx.ExecContext(ctx, "DROP INDEX IF EXISTS tmp_tipset_key_cid") - if err != nil { - return xerrors.Errorf("drop index tmp_tipset_key_cid: %w", err) - } - _, err = tx.ExecContext(ctx, "DROP INDEX IF EXISTS tmp_height_tipset_key_cid") - if err != nil { - return xerrors.Errorf("drop index tmp_height_tipset_key_cid: %w", err) - } - - // original v2 migration introduced an index: - // CREATE INDEX IF NOT EXISTS height_tipset_key ON event (height,tipset_key) - // which has subsequently been removed in v4, so it's omitted here - - // increment the schema version to 2 in _meta table. - _, err = tx.ExecContext(ctx, "INSERT OR IGNORE INTO _meta (version) VALUES (2)") - if err != nil { - return xerrors.Errorf("increment _meta version: %w", err) - } - - err = tx.Commit() - if err != nil { - return xerrors.Errorf("commit transaction: %w", err) - } - - log.Infof("Successfully migrated event index from version 1 to version 2 in %s", time.Since(now)) - - return nil -} - -// migrateToVersion3 migrates the schema from version 2 to version 3 by creating two indices: -// 1) an index on the event.emitter_addr column, and 2) an index on the event_entry.key column. -func (ei *EventIndex) migrateToVersion3(ctx context.Context) error { - now := time.Now() - - tx, err := ei.db.BeginTx(ctx, nil) - if err != nil { - return xerrors.Errorf("begin transaction: %w", err) - } - defer func() { _ = tx.Rollback() }() - - // create index on event.emitter_addr. - _, err = tx.ExecContext(ctx, createIndexEventEmitterAddr) - if err != nil { - return xerrors.Errorf("create index event_emitter_addr: %w", err) - } - - // original v3 migration introduced an index: - // CREATE INDEX IF NOT EXISTS event_entry_key_index ON event_entry (key) - // which has subsequently been removed in v4, so it's omitted here - - // increment the schema version to 3 in _meta table. - _, err = tx.ExecContext(ctx, "INSERT OR IGNORE INTO _meta (version) VALUES (3)") - if err != nil { - return xerrors.Errorf("increment _meta version: %w", err) - } - - err = tx.Commit() - if err != nil { - return xerrors.Errorf("commit transaction: %w", err) - } - log.Infof("Successfully migrated event index from version 2 to version 3 in %s", time.Since(now)) - return nil -} - -// migrateToVersion4 migrates the schema from version 3 to version 4 by adjusting indexes to match -// the query patterns of the event filter. -// -// First it drops indexes introduced in previous migrations: -// 1. the index on the event.height and event.tipset_key columns -// 2. the index on the event_entry.key column -// -// And then creating the following indices: -// 1. an index on the event.tipset_key_cid column -// 2. an index on the event.height column -// 3. an index on the event.reverted column -// 4. an index on the event_entry.indexed and event_entry.key columns -// 5. an index on the event_entry.codec and event_entry.value columns -// 6. an index on the event_entry.event_id column -func (ei *EventIndex) migrateToVersion4(ctx context.Context) error { - now := time.Now() - - tx, err := ei.db.BeginTx(ctx, nil) - if err != nil { - return xerrors.Errorf("begin transaction: %w", err) - } - defer func() { _ = tx.Rollback() }() - - for _, create := range []struct { - desc string - query string - }{ - {"drop index height_tipset_key", "DROP INDEX IF EXISTS height_tipset_key;"}, - {"drop index event_entry_key_index", "DROP INDEX IF EXISTS event_entry_key_index;"}, - {"create index event_tipset_key_cid", createIndexEventTipsetKeyCid}, - {"create index event_height", createIndexEventHeight}, - {"create index event_reverted", createIndexEventReverted}, - {"create index event_entry_indexed_key", createIndexEventEntryIndexedKey}, - {"create index event_entry_codec_value", createIndexEventEntryCodecValue}, - {"create index event_entry_event_id", createIndexEventEntryEventId}, - } { - _, err = tx.ExecContext(ctx, create.query) - if err != nil { - return xerrors.Errorf("%s: %w", create.desc, err) - } - } - - if _, err = tx.Exec("INSERT OR IGNORE INTO _meta (version) VALUES (4)"); err != nil { - return xerrors.Errorf("increment _meta version: %w", err) - } - - err = tx.Commit() - if err != nil { - return xerrors.Errorf("commit transaction: %w", err) - } - - log.Infof("Successfully migrated event index from version 3 to version 4 in %s", time.Since(now)) - return nil -} - -func (ei *EventIndex) migrateToVersion5(ctx context.Context) error { - now := time.Now() - - tx, err := ei.db.BeginTx(ctx, nil) - if err != nil { - return xerrors.Errorf("begin transaction: %w", err) - } - defer func() { _ = tx.Rollback() }() - - stmtEventIndexUpdate, err := tx.PrepareContext(ctx, "UPDATE event SET event_index = (SELECT COUNT(*) FROM event e2 WHERE e2.tipset_key_cid = event.tipset_key_cid AND e2.id <= event.id) - 1") - if err != nil { - return xerrors.Errorf("prepare stmtEventIndexUpdate: %w", err) - } - - _, err = stmtEventIndexUpdate.ExecContext(ctx) - if err != nil { - return xerrors.Errorf("update event index: %w", err) - } - - _, err = tx.ExecContext(ctx, "INSERT OR IGNORE INTO _meta (version) VALUES (5)") - if err != nil { - return xerrors.Errorf("increment _meta version: %w", err) - } - - err = tx.Commit() - if err != nil { - return xerrors.Errorf("commit transaction: %w", err) - } - - log.Infof("Successfully migrated event index from version 4 to version 5 in %s", time.Since(now)) - return nil -} - -func (ei *EventIndex) migrateToVersion6(ctx context.Context) error { - now := time.Now() - - tx, err := ei.db.BeginTx(ctx, nil) - if err != nil { - return xerrors.Errorf("begin transaction: %w", err) - } - defer func() { _ = tx.Rollback() }() - - stmtCreateTableEventsSeen, err := tx.PrepareContext(ctx, createTableEventsSeen) - if err != nil { - return xerrors.Errorf("prepare stmtCreateTableEventsSeen: %w", err) - } - _, err = stmtCreateTableEventsSeen.ExecContext(ctx) - if err != nil { - return xerrors.Errorf("create table events_seen: %w", err) - } - - _, err = tx.ExecContext(ctx, createIndexEventsSeenHeight) - if err != nil { - return xerrors.Errorf("create index events_seen_height: %w", err) - } - _, err = tx.ExecContext(ctx, createIndexEventsSeenTipsetKeyCid) - if err != nil { - return xerrors.Errorf("create index events_seen_tipset_key_cid: %w", err) - } - - // INSERT an entry in the events_seen table for all epochs we do have events for in our DB - _, err = tx.ExecContext(ctx, ` - INSERT OR IGNORE INTO events_seen (height, tipset_key_cid, reverted) - SELECT DISTINCT height, tipset_key_cid, reverted FROM event -`) - if err != nil { - return xerrors.Errorf("insert events into events_seen: %w", err) - } - - _, err = tx.ExecContext(ctx, "INSERT OR IGNORE INTO _meta (version) VALUES (6)") - if err != nil { - return xerrors.Errorf("increment _meta version: %w", err) - } - - err = tx.Commit() - if err != nil { - return xerrors.Errorf("commit transaction: %w", err) - } - - ei.vacuumDBAndCheckpointWAL(ctx) - - log.Infof("Successfully migrated event index from version 5 to version 6 in %s", time.Since(now)) - return nil -} - -func (ei *EventIndex) vacuumDBAndCheckpointWAL(ctx context.Context) { - // During the large migrations, we have likely increased the WAL size a lot, so lets do some - // simple DB administration to free up space (VACUUM followed by truncating the WAL file) - // as this would be a good time to do it when no other writes are happening. - log.Infof("Performing DB vacuum and wal checkpointing to free up space after the migration") - _, err := ei.db.ExecContext(ctx, "VACUUM") - if err != nil { - log.Warnf("error vacuuming database: %s", err) - } - _, err = ei.db.ExecContext(ctx, "PRAGMA wal_checkpoint(TRUNCATE)") - if err != nil { - log.Warnf("error checkpointing wal: %s", err) - } -} - func NewEventIndex(ctx context.Context, path string, chainStore *store.ChainStore) (*EventIndex, error) { - db, err := sql.Open("sqlite3", path+"?mode=rwc") + db, _, err := sqlite.Open(path) if err != nil { - return nil, xerrors.Errorf("open sqlite3 database: %w", err) + return nil, xerrors.Errorf("failed to setup event index db: %w", err) } - for _, pragma := range pragmas { - if _, err := db.Exec(pragma); err != nil { - _ = db.Close() - return nil, xerrors.Errorf("exec pragma %q: %w", pragma, err) - } + err = sqlite.InitDb(ctx, "event index", db, ddls, []sqlite.MigrationFunc{ + migrationVersion2(db, chainStore), + migrationVersion3, + migrationVersion4, + migrationVersion5, + migrationVersion6, + }) + if err != nil { + _ = db.Close() + return nil, xerrors.Errorf("failed to setup event index db: %w", err) } eventIndex := EventIndex{db: db} - q, err := db.QueryContext(ctx, "SELECT name FROM sqlite_master WHERE type='table' AND name='_meta';") - if q != nil { - defer func() { _ = q.Close() }() - } - if errors.Is(err, sql.ErrNoRows) || !q.Next() { - // empty database, create the schema - for _, ddl := range ddls { - if _, err := db.Exec(ddl); err != nil { - _ = db.Close() - return nil, xerrors.Errorf("exec ddl %q: %w", ddl, err) - } - } - } else if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("looking for _meta table: %w", err) - } else { - // check the schema version to see if we need to upgrade the database schema - var version int - err := db.QueryRow("SELECT max(version) FROM _meta").Scan(&version) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("invalid database version: no version found") - } - - if version == 1 { - log.Infof("Upgrading event index from version 1 to version 2") - err = eventIndex.migrateToVersion2(ctx, chainStore) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("could not migrate event index schema from version 1 to version 2: %w", err) - } - version = 2 - } - - if version == 2 { - log.Infof("Upgrading event index from version 2 to version 3") - err = eventIndex.migrateToVersion3(ctx) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("could not migrate event index schema from version 2 to version 3: %w", err) - } - version = 3 - } - - if version == 3 { - log.Infof("Upgrading event index from version 3 to version 4") - err = eventIndex.migrateToVersion4(ctx) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("could not migrate event index schema from version 3 to version 4: %w", err) - } - version = 4 - } - - if version == 4 { - log.Infof("Upgrading event index from version 4 to version 5") - err = eventIndex.migrateToVersion5(ctx) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("could not migrate event index schema from version 4 to version 5: %w", err) - } - version = 5 - } - - if version == 5 { - log.Infof("Upgrading event index from version 5 to version 6") - err = eventIndex.migrateToVersion6(ctx) - if err != nil { - _ = db.Close() - return nil, xerrors.Errorf("could not migrate event index schema from version 5 to version 6: %w", err) - } - version = 6 - } - - if version != schemaVersion { - _ = db.Close() - return nil, xerrors.Errorf("invalid database version: got %d, expected %d", version, schemaVersion) - } - } - - err = eventIndex.initStatements() - if err != nil { + if err = eventIndex.initStatements(); err != nil { _ = db.Close() return nil, xerrors.Errorf("error preparing eventIndex database statements: %w", err) } @@ -698,11 +265,12 @@ func (ei *EventIndex) GetMaxHeightInIndex(ctx context.Context) (uint64, error) { return maxHeight, err } -func (ei *EventIndex) IsHeightProcessed(ctx context.Context, height uint64) (bool, error) { - row := ei.stmtIsHeightProcessed.QueryRowContext(ctx, height) - var exists bool - err := row.Scan(&exists) - return exists, err +func (ei *EventIndex) IsHeightPast(ctx context.Context, height uint64) (bool, error) { + maxHeight, err := ei.GetMaxHeightInIndex(ctx) + if err != nil { + return false, err + } + return height <= maxHeight, nil } func (ei *EventIndex) IsTipsetProcessed(ctx context.Context, tipsetKeyCid []byte) (bool, error) { diff --git a/chain/events/filter/index_migrations.go b/chain/events/filter/index_migrations.go new file mode 100644 index 00000000000..fe8a371a513 --- /dev/null +++ b/chain/events/filter/index_migrations.go @@ -0,0 +1,238 @@ +package filter + +import ( + "context" + "database/sql" + "errors" + "fmt" + + "golang.org/x/xerrors" + + "github.com/filecoin-project/lotus/chain/store" + "github.com/filecoin-project/lotus/lib/sqlite" +) + +func migrationVersion2(db *sql.DB, chainStore *store.ChainStore) sqlite.MigrationFunc { + return func(ctx context.Context, tx *sql.Tx) error { + // create some temporary indices to help speed up the migration + _, err := tx.ExecContext(ctx, "CREATE INDEX IF NOT EXISTS tmp_height_tipset_key_cid ON event (height,tipset_key_cid)") + if err != nil { + return xerrors.Errorf("create index tmp_height_tipset_key_cid: %w", err) + } + _, err = tx.ExecContext(ctx, "CREATE INDEX IF NOT EXISTS tmp_tipset_key_cid ON event (tipset_key_cid)") + if err != nil { + return xerrors.Errorf("create index tmp_tipset_key_cid: %w", err) + } + + stmtDeleteOffChainEvent, err := tx.PrepareContext(ctx, "DELETE FROM event WHERE tipset_key_cid!=? and height=?") + if err != nil { + return xerrors.Errorf("prepare stmtDeleteOffChainEvent: %w", err) + } + + stmtSelectEvent, err := tx.PrepareContext(ctx, "SELECT id FROM event WHERE tipset_key_cid=? ORDER BY message_index ASC, event_index ASC, id DESC LIMIT 1") + if err != nil { + return xerrors.Errorf("prepare stmtSelectEvent: %w", err) + } + + stmtDeleteEvent, err := tx.PrepareContext(ctx, "DELETE FROM event WHERE tipset_key_cid=? AND id= minHeight.Int64 { + if currTs.Height()%1000 == 0 { + log.Infof("Migrating height %d (remaining %d)", currTs.Height(), int64(currTs.Height())-minHeight.Int64) + } + + tsKey := currTs.Parents() + currTs, err = chainStore.GetTipSetFromKey(ctx, tsKey) + if err != nil { + return xerrors.Errorf("get tipset from key: %w", err) + } + log.Debugf("Migrating height %d", currTs.Height()) + + tsKeyCid, err := currTs.Key().Cid() + if err != nil { + return fmt.Errorf("tipset key cid: %w", err) + } + + // delete all events that are not in the canonical chain + _, err = stmtDeleteOffChainEvent.Exec(tsKeyCid.Bytes(), currTs.Height()) + if err != nil { + return xerrors.Errorf("delete off chain event: %w", err) + } + + // find the first eventId from the last time the tipset was applied + var eventId sql.NullInt64 + err = stmtSelectEvent.QueryRow(tsKeyCid.Bytes()).Scan(&eventId) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + continue + } + return xerrors.Errorf("select event: %w", err) + } + + // this tipset might not have any events which is ok + if !eventId.Valid { + continue + } + log.Debugf("Deleting all events with id < %d at height %d", eventId.Int64, currTs.Height()) + + res, err := stmtDeleteEvent.Exec(tsKeyCid.Bytes(), eventId.Int64) + if err != nil { + return xerrors.Errorf("delete event: %w", err) + } + + nrRowsAffected, err := res.RowsAffected() + if err != nil { + return xerrors.Errorf("rows affected: %w", err) + } + log.Debugf("deleted %d events from tipset %s", nrRowsAffected, tsKeyCid.String()) + } + + // delete all entries that have an event_id that doesn't exist (since we don't have a foreign + // key constraint that gives us cascading deletes) + res, err := tx.ExecContext(ctx, "DELETE FROM event_entry WHERE event_id NOT IN (SELECT id FROM event)") + if err != nil { + return xerrors.Errorf("delete event_entry: %w", err) + } + + nrRowsAffected, err := res.RowsAffected() + if err != nil { + return xerrors.Errorf("rows affected: %w", err) + } + log.Infof("Cleaned up %d entries that had deleted events\n", nrRowsAffected) + + // drop the temporary indices after the migration + _, err = tx.ExecContext(ctx, "DROP INDEX IF EXISTS tmp_tipset_key_cid") + if err != nil { + return xerrors.Errorf("drop index tmp_tipset_key_cid: %w", err) + } + _, err = tx.ExecContext(ctx, "DROP INDEX IF EXISTS tmp_height_tipset_key_cid") + if err != nil { + return xerrors.Errorf("drop index tmp_height_tipset_key_cid: %w", err) + } + + // original v2 migration introduced an index: + // CREATE INDEX IF NOT EXISTS height_tipset_key ON event (height,tipset_key) + // which has subsequently been removed in v4, so it's omitted here + + return nil + } +} + +// migrationVersion3 migrates the schema from version 2 to version 3 by creating two indices: +// 1) an index on the event.emitter_addr column, and 2) an index on the event_entry.key column. +func migrationVersion3(ctx context.Context, tx *sql.Tx) error { + // create index on event.emitter_addr. + _, err := tx.ExecContext(ctx, createIndexEventEmitterAddr) + if err != nil { + return xerrors.Errorf("create index event_emitter_addr: %w", err) + } + + // original v3 migration introduced an index: + // CREATE INDEX IF NOT EXISTS event_entry_key_index ON event_entry (key) + // which has subsequently been removed in v4, so it's omitted here + + return nil +} + +// migrationVersion4 migrates the schema from version 3 to version 4 by adjusting indexes to match +// the query patterns of the event filter. +// +// First it drops indexes introduced in previous migrations: +// 1. the index on the event.height and event.tipset_key columns +// 2. the index on the event_entry.key column +// +// And then creating the following indices: +// 1. an index on the event.tipset_key_cid column +// 2. an index on the event.height column +// 3. an index on the event.reverted column +// 4. an index on the event_entry.indexed and event_entry.key columns +// 5. an index on the event_entry.codec and event_entry.value columns +// 6. an index on the event_entry.event_id column +func migrationVersion4(ctx context.Context, tx *sql.Tx) error { + for _, create := range []struct { + desc string + query string + }{ + {"drop index height_tipset_key", "DROP INDEX IF EXISTS height_tipset_key;"}, + {"drop index event_entry_key_index", "DROP INDEX IF EXISTS event_entry_key_index;"}, + {"create index event_tipset_key_cid", createIndexEventTipsetKeyCid}, + {"create index event_height", createIndexEventHeight}, + {"create index event_reverted", createIndexEventReverted}, + {"create index event_entry_indexed_key", createIndexEventEntryIndexedKey}, + {"create index event_entry_codec_value", createIndexEventEntryCodecValue}, + {"create index event_entry_event_id", createIndexEventEntryEventId}, + } { + if _, err := tx.ExecContext(ctx, create.query); err != nil { + return xerrors.Errorf("%s: %w", create.desc, err) + } + } + + return nil +} + +// migrationVersion5 migrates the schema from version 4 to version 5 by updating the event_index +// to be 0-indexed within a tipset. +func migrationVersion5(ctx context.Context, tx *sql.Tx) error { + stmtEventIndexUpdate, err := tx.PrepareContext(ctx, "UPDATE event SET event_index = (SELECT COUNT(*) FROM event e2 WHERE e2.tipset_key_cid = event.tipset_key_cid AND e2.id <= event.id) - 1") + if err != nil { + return xerrors.Errorf("prepare stmtEventIndexUpdate: %w", err) + } + + _, err = stmtEventIndexUpdate.ExecContext(ctx) + if err != nil { + return xerrors.Errorf("update event index: %w", err) + } + + return nil +} + +// migrationVersion6 migrates the schema from version 5 to version 6 by creating a new table +// events_seen that tracks the tipsets that have been seen by the event filter and populating it +// with the tipsets that have events in the event table. +func migrationVersion6(ctx context.Context, tx *sql.Tx) error { + stmtCreateTableEventsSeen, err := tx.PrepareContext(ctx, createTableEventsSeen) + if err != nil { + return xerrors.Errorf("prepare stmtCreateTableEventsSeen: %w", err) + } + _, err = stmtCreateTableEventsSeen.ExecContext(ctx) + if err != nil { + return xerrors.Errorf("create table events_seen: %w", err) + } + + _, err = tx.ExecContext(ctx, createIndexEventsSeenHeight) + if err != nil { + return xerrors.Errorf("create index events_seen_height: %w", err) + } + _, err = tx.ExecContext(ctx, createIndexEventsSeenTipsetKeyCid) + if err != nil { + return xerrors.Errorf("create index events_seen_tipset_key_cid: %w", err) + } + + // INSERT an entry in the events_seen table for all epochs we do have events for in our DB + _, err = tx.ExecContext(ctx, ` + INSERT OR IGNORE INTO events_seen (height, tipset_key_cid, reverted) + SELECT DISTINCT height, tipset_key_cid, reverted FROM event +`) + if err != nil { + return xerrors.Errorf("insert events into events_seen: %w", err) + } + + return nil +} diff --git a/chain/events/filter/index_test.go b/chain/events/filter/index_test.go index 10b3eb57779..ad08da5aedb 100644 --- a/chain/events/filter/index_test.go +++ b/chain/events/filter/index_test.go @@ -94,17 +94,17 @@ func TestEventIndexPrefillFilter(t *testing.T) { require.NoError(t, err) require.Equal(t, uint64(14000), mh) - b, err := ei.IsHeightProcessed(context.Background(), 14000) + b, err := ei.IsHeightPast(context.Background(), 14000) require.NoError(t, err) require.True(t, b) - b, err = ei.IsHeightProcessed(context.Background(), 14001) + b, err = ei.IsHeightPast(context.Background(), 14001) require.NoError(t, err) require.False(t, b) - b, err = ei.IsHeightProcessed(context.Background(), 13000) + b, err = ei.IsHeightPast(context.Background(), 13000) require.NoError(t, err) - require.False(t, b) + require.True(t, b) tsKey := events14000.msgTs.Key() tsKeyCid, err := tsKey.Cid() diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go index 8ec657479f7..69abfd223eb 100644 --- a/chain/gen/genesis/genesis.go +++ b/chain/gen/genesis/genesis.go @@ -378,11 +378,16 @@ func MakeAccountActor(ctx context.Context, cst cbor.IpldStore, av actorstypes.Ve return nil, xerrors.Errorf("failed to get account actor code ID for actors version %d", av) } + var delegatedAddr *address.Address + if addr.Protocol() == address.Delegated { + delegatedAddr = &addr + } + act := &types.Actor{ - Code: actcid, - Head: statecid, - Balance: bal, - Address: &addr, + Code: actcid, + Head: statecid, + Balance: bal, + DelegatedAddress: delegatedAddr, } return act, nil diff --git a/chain/gen/genesis/genesis_eth.go b/chain/gen/genesis/genesis_eth.go index d5aa2f0b51b..a484d3e6851 100644 --- a/chain/gen/genesis/genesis_eth.go +++ b/chain/gen/genesis/genesis_eth.go @@ -48,7 +48,6 @@ func SetupEAM(_ context.Context, nst *state.StateTree, nv network.Version) error Code: codecid, Head: vm.EmptyObjectCid, Balance: big.Zero(), - Address: &builtin.EthereumAddressManagerActorAddr, // so that it can create ETH0 } return nst.SetActor(builtin.EthereumAddressManagerActorAddr, header) } @@ -60,12 +59,16 @@ func MakeEthNullAddressActor(av actorstypes.Version, addr address.Address) (*typ return nil, xerrors.Errorf("failed to get EthAccount actor code ID for actors version %d", av) } + if addr.Protocol() != address.Delegated { + return nil, xerrors.Errorf("eth accounts must have f4 addresses, %s is not an f4 address", addr) + } + act := &types.Actor{ - Code: actcid, - Head: vm.EmptyObjectCid, - Nonce: 0, - Balance: big.Zero(), - Address: &addr, + Code: actcid, + Head: vm.EmptyObjectCid, + Nonce: 0, + Balance: big.Zero(), + DelegatedAddress: &addr, } return act, nil diff --git a/chain/index/msgindex.go b/chain/index/msgindex.go index e9e81ae2cf5..fa4eca29784 100644 --- a/chain/index/msgindex.go +++ b/chain/index/msgindex.go @@ -3,10 +3,7 @@ package index import ( "context" "database/sql" - "errors" - "io/fs" "os" - "path" "sync" "time" @@ -19,34 +16,20 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/lib/sqlite" ) +const DefaultDbFilename = "msgindex.db" + var log = logging.Logger("msgindex") -var dbName = "msgindex.db" -var dbDefs = []string{ +var ddls = []string{ `CREATE TABLE IF NOT EXISTS messages ( cid VARCHAR(80) PRIMARY KEY ON CONFLICT REPLACE, tipset_cid VARCHAR(80) NOT NULL, epoch INTEGER NOT NULL )`, - `CREATE INDEX IF NOT EXISTS tipset_cids ON messages (tipset_cid) - `, - `CREATE TABLE IF NOT EXISTS _meta ( - version UINT64 NOT NULL UNIQUE - )`, - `INSERT OR IGNORE INTO _meta (version) VALUES (1)`, -} - -var dbPragmas = []string{ - "PRAGMA synchronous = normal", - "PRAGMA temp_store = memory", - "PRAGMA mmap_size = 30000000000", - "PRAGMA page_size = 32768", - "PRAGMA auto_vacuum = NONE", - "PRAGMA automatic_index = OFF", - "PRAGMA journal_mode = WAL", - "PRAGMA read_uncommitted = ON", + `CREATE INDEX IF NOT EXISTS tipset_cids ON messages (tipset_cid)`, } const ( @@ -105,39 +88,15 @@ type headChange struct { app []*types.TipSet } -func NewMsgIndex(lctx context.Context, basePath string, cs ChainStore) (MsgIndex, error) { - var ( - dbPath string - exists bool - err error - ) - - err = os.MkdirAll(basePath, 0755) - if err != nil { - return nil, xerrors.Errorf("error creating msgindex base directory: %w", err) - } - - dbPath = path.Join(basePath, dbName) - _, err = os.Stat(dbPath) - switch { - case err == nil: - exists = true - - case errors.Is(err, fs.ErrNotExist): - - case err != nil: - return nil, xerrors.Errorf("error stating msgindex database: %w", err) - } - - db, err := sql.Open("sqlite3", dbPath) +func NewMsgIndex(lctx context.Context, path string, cs ChainStore) (MsgIndex, error) { + db, exists, err := sqlite.Open(path) if err != nil { - // TODO [nice to have]: automatically delete corrupt databases - // but for now we can just error and let the operator delete. - return nil, xerrors.Errorf("error opening msgindex database: %w", err) + return nil, xerrors.Errorf("failed to setup message index db: %w", err) } - if err := prepareDB(db); err != nil { - return nil, xerrors.Errorf("error creating msgindex database: %w", err) + if err = sqlite.InitDb(lctx, "message index", db, ddls, []sqlite.MigrationFunc{}); err != nil { + _ = db.Close() + return nil, xerrors.Errorf("failed to init message index db: %w", err) } // TODO we may consider populating the index when first creating the db @@ -179,24 +138,17 @@ func NewMsgIndex(lctx context.Context, basePath string, cs ChainStore) (MsgIndex return msgIndex, nil } -func PopulateAfterSnapshot(lctx context.Context, basePath string, cs ChainStore) error { - err := os.MkdirAll(basePath, 0755) - if err != nil { - return xerrors.Errorf("error creating msgindex base directory: %w", err) - } - - dbPath := path.Join(basePath, dbName) - +func PopulateAfterSnapshot(lctx context.Context, path string, cs ChainStore) error { // if a database already exists, we try to delete it and create a new one - if _, err := os.Stat(dbPath); err == nil { - if err = os.Remove(dbPath); err != nil { - return xerrors.Errorf("msgindex already exists at %s and can't be deleted", dbPath) + if _, err := os.Stat(path); err == nil { + if err = os.Remove(path); err != nil { + return xerrors.Errorf("msgindex already exists at %s and can't be deleted", path) } } - db, err := sql.Open("sqlite3", dbPath) + db, _, err := sqlite.Open(path) if err != nil { - return xerrors.Errorf("error opening msgindex database: %w", err) + return xerrors.Errorf("failed to setup message index db: %w", err) } defer func() { if err := db.Close(); err != nil { @@ -204,7 +156,8 @@ func PopulateAfterSnapshot(lctx context.Context, basePath string, cs ChainStore) } }() - if err := prepareDB(db); err != nil { + if err := sqlite.InitDb(lctx, "message index", db, ddls, []sqlite.MigrationFunc{}); err != nil { + _ = db.Close() return xerrors.Errorf("error creating msgindex database: %w", err) } @@ -266,23 +219,6 @@ func PopulateAfterSnapshot(lctx context.Context, basePath string, cs ChainStore) return nil } -// init utilities -func prepareDB(db *sql.DB) error { - for _, stmt := range dbDefs { - if _, err := db.Exec(stmt); err != nil { - return xerrors.Errorf("error executing sql statement '%s': %w", stmt, err) - } - } - - for _, stmt := range dbPragmas { - if _, err := db.Exec(stmt); err != nil { - return xerrors.Errorf("error executing sql statement '%s': %w", stmt, err) - } - } - - return nil -} - func reconcileIndex(db *sql.DB, cs ChainStore) error { // Invariant: after reconciliation, every tipset in the index is in the current chain; ie either // the chain head or reachable by walking the chain. diff --git a/chain/index/msgindex_test.go b/chain/index/msgindex_test.go index bf4bc6190e8..2cf707b0fed 100644 --- a/chain/index/msgindex_test.go +++ b/chain/index/msgindex_test.go @@ -30,7 +30,7 @@ func TestBasicMsgIndex(t *testing.T) { tmp := t.TempDir() t.Cleanup(func() { _ = os.RemoveAll(tmp) }) - msgIndex, err := NewMsgIndex(context.Background(), tmp, cs) + msgIndex, err := NewMsgIndex(context.Background(), tmp+"/msgindex.db", cs) require.NoError(t, err) defer msgIndex.Close() //nolint @@ -58,7 +58,7 @@ func TestReorgMsgIndex(t *testing.T) { tmp := t.TempDir() t.Cleanup(func() { _ = os.RemoveAll(tmp) }) - msgIndex, err := NewMsgIndex(context.Background(), tmp, cs) + msgIndex, err := NewMsgIndex(context.Background(), tmp+"/msgindex.db", cs) require.NoError(t, err) defer msgIndex.Close() //nolint @@ -103,7 +103,7 @@ func TestReconcileMsgIndex(t *testing.T) { tmp := t.TempDir() t.Cleanup(func() { _ = os.RemoveAll(tmp) }) - msgIndex, err := NewMsgIndex(context.Background(), tmp, cs) + msgIndex, err := NewMsgIndex(context.Background(), tmp+"/msgindex.db", cs) require.NoError(t, err) for i := 0; i < 10; i++ { @@ -130,7 +130,7 @@ func TestReconcileMsgIndex(t *testing.T) { require.NoError(t, err) // reopen to reconcile - msgIndex, err = NewMsgIndex(context.Background(), tmp, cs) + msgIndex, err = NewMsgIndex(context.Background(), tmp+"/msgindex.db", cs) require.NoError(t, err) defer msgIndex.Close() //nolint diff --git a/chain/lf3/ec.go b/chain/lf3/ec.go new file mode 100644 index 00000000000..98ffe332ef9 --- /dev/null +++ b/chain/lf3/ec.go @@ -0,0 +1,215 @@ +package lf3 + +import ( + "context" + "sort" + "time" + + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-f3/ec" + "github.com/filecoin-project/go-f3/gpbft" + "github.com/filecoin-project/go-state-types/abi" + + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/filecoin-project/lotus/chain/actors/builtin/power" + "github.com/filecoin-project/lotus/chain/stmgr" + "github.com/filecoin-project/lotus/chain/store" + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/vm" +) + +type ecWrapper struct { + ChainStore *store.ChainStore + StateManager *stmgr.StateManager +} + +type f3TipSet types.TipSet + +func (ts *f3TipSet) cast() *types.TipSet { + return (*types.TipSet)(ts) +} + +func (ts *f3TipSet) Key() gpbft.TipSetKey { + return ts.cast().Key().Bytes() +} + +func (ts *f3TipSet) Beacon() []byte { + entries := ts.cast().Blocks()[0].BeaconEntries + if len(entries) == 0 { + // This should never happen in practice, but set beacon to a non-nil + // 32byte slice to force the message builder to generate a + // ticket. Otherwise, messages that require ticket, i.e. CONVERGE will fail + // validation due to the absence of ticket. This is a convoluted way of doing it. + return make([]byte, 32) + } + return entries[len(entries)-1].Data +} + +func (ts *f3TipSet) Epoch() int64 { + return int64(ts.cast().Height()) +} + +func (ts *f3TipSet) Timestamp() time.Time { + return time.Unix(int64(ts.cast().Blocks()[0].Timestamp), 0) +} + +func wrapTS(ts *types.TipSet) ec.TipSet { + if ts == nil { + return nil + } + return (*f3TipSet)(ts) +} + +// GetTipsetByEpoch should return a tipset before the one requested if the requested +// tipset does not exist due to null epochs +func (ec *ecWrapper) GetTipsetByEpoch(ctx context.Context, epoch int64) (ec.TipSet, error) { + ts, err := ec.ChainStore.GetTipsetByHeight(ctx, abi.ChainEpoch(epoch), nil, true) + if err != nil { + return nil, xerrors.Errorf("getting tipset by height: %w", err) + } + return wrapTS(ts), nil +} + +func (ec *ecWrapper) GetTipset(ctx context.Context, tsk gpbft.TipSetKey) (ec.TipSet, error) { + tskLotus, err := types.TipSetKeyFromBytes(tsk) + if err != nil { + return nil, xerrors.Errorf("decoding tsk: %w", err) + } + + ts, err := ec.ChainStore.GetTipSetFromKey(ctx, tskLotus) + if err != nil { + return nil, xerrors.Errorf("getting tipset by key: %w", err) + } + + return wrapTS(ts), nil +} + +func (ec *ecWrapper) GetHead(_ context.Context) (ec.TipSet, error) { + return wrapTS(ec.ChainStore.GetHeaviestTipSet()), nil +} + +func (ec *ecWrapper) GetParent(ctx context.Context, tsF3 ec.TipSet) (ec.TipSet, error) { + var ts *types.TipSet + if tsW, ok := tsF3.(*f3TipSet); ok { + ts = tsW.cast() + } else { + // There are only two implementations of ec.TipSet: f3TipSet, and one in fake EC + // backend. + // + // TODO: Revisit the type check here and remove as needed once testing + // is over and fake EC backend goes away. + tskLotus, err := types.TipSetKeyFromBytes(tsF3.Key()) + if err != nil { + return nil, xerrors.Errorf("decoding tsk: %w", err) + } + ts, err = ec.ChainStore.GetTipSetFromKey(ctx, tskLotus) + if err != nil { + return nil, xerrors.Errorf("getting tipset by key for get parent: %w", err) + } + } + parentTs, err := ec.ChainStore.GetTipSetFromKey(ctx, ts.Parents()) + if err != nil { + return nil, xerrors.Errorf("getting parent tipset: %w", err) + } + return wrapTS(parentTs), nil +} + +func (ec *ecWrapper) GetPowerTable(ctx context.Context, tskF3 gpbft.TipSetKey) (gpbft.PowerEntries, error) { + tsk, err := types.TipSetKeyFromBytes(tskF3) + if err != nil { + return nil, xerrors.Errorf("decoding tsk: %w", err) + } + return ec.getPowerTableLotusTSK(ctx, tsk) +} + +func (ec *ecWrapper) getPowerTableLotusTSK(ctx context.Context, tsk types.TipSetKey) (gpbft.PowerEntries, error) { + ts, err := ec.ChainStore.GetTipSetFromKey(ctx, tsk) + if err != nil { + return nil, xerrors.Errorf("getting tipset by key for get parent: %w", err) + } + + state, err := ec.StateManager.ParentState(ts) + if err != nil { + return nil, xerrors.Errorf("loading the state tree: %w", err) + } + powerAct, err := state.GetActor(power.Address) + if err != nil { + return nil, xerrors.Errorf("getting the power actor: %w", err) + } + + powerState, err := power.Load(ec.ChainStore.ActorStore(ctx), powerAct) + if err != nil { + return nil, xerrors.Errorf("loading power actor state: %w", err) + } + + var powerEntries gpbft.PowerEntries + err = powerState.ForEachClaim(func(minerAddr address.Address, claim power.Claim) error { + if claim.QualityAdjPower.Sign() <= 0 { + return nil + } + + // TODO: optimize + ok, err := powerState.MinerNominalPowerMeetsConsensusMinimum(minerAddr) + if err != nil { + return xerrors.Errorf("checking consensus minimums: %w", err) + } + if !ok { + return nil + } + + id, err := address.IDFromAddress(minerAddr) + if err != nil { + return xerrors.Errorf("transforming address to ID: %w", err) + } + + pe := gpbft.PowerEntry{ + ID: gpbft.ActorID(id), + Power: claim.QualityAdjPower.Int, + } + + act, err := state.GetActor(minerAddr) + if err != nil { + return xerrors.Errorf("(get sset) failed to load miner actor: %w", err) + } + mstate, err := miner.Load(ec.ChainStore.ActorStore(ctx), act) + if err != nil { + return xerrors.Errorf("(get sset) failed to load miner actor state: %w", err) + } + + info, err := mstate.Info() + if err != nil { + return xerrors.Errorf("failed to load actor info: %w", err) + } + // check fee debt + if debt, err := mstate.FeeDebt(); err != nil { + return err + } else if !debt.IsZero() { + // fee debt don't add the miner to power table + return nil + } + // check consensus faults + if ts.Height() <= info.ConsensusFaultElapsed { + return nil + } + + waddr, err := vm.ResolveToDeterministicAddr(state, ec.ChainStore.ActorStore(ctx), info.Worker) + if err != nil { + return xerrors.Errorf("resolve miner worker address: %w", err) + } + + if waddr.Protocol() != address.BLS { + return xerrors.Errorf("wrong type of worker address") + } + pe.PubKey = gpbft.PubKey(waddr.Payload()) + powerEntries = append(powerEntries, pe) + return nil + }) + if err != nil { + return nil, xerrors.Errorf("collecting the power table: %w", err) + } + + sort.Sort(powerEntries) + return powerEntries, nil +} diff --git a/chain/lf3/f3.go b/chain/lf3/f3.go new file mode 100644 index 00000000000..59fa803fa39 --- /dev/null +++ b/chain/lf3/f3.go @@ -0,0 +1,170 @@ +package lf3 + +import ( + "context" + "errors" + "time" + + "github.com/ipfs/go-datastore" + "github.com/ipfs/go-datastore/namespace" + logging "github.com/ipfs/go-log/v2" + pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/libp2p/go-libp2p/core/host" + "go.uber.org/fx" + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-f3" + "github.com/filecoin-project/go-f3/blssig" + "github.com/filecoin-project/go-f3/certs" + "github.com/filecoin-project/go-f3/gpbft" + "github.com/filecoin-project/go-f3/manifest" + + "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/chain/stmgr" + "github.com/filecoin-project/lotus/chain/store" + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/node/modules/dtypes" + "github.com/filecoin-project/lotus/node/modules/helpers" +) + +type F3 struct { + inner *f3.F3 + ec *ecWrapper + + signer gpbft.Signer + newLeases chan leaseRequest +} + +type F3Params struct { + fx.In + + NetworkName dtypes.NetworkName + ManifestProvider manifest.ManifestProvider + PubSub *pubsub.PubSub + Host host.Host + ChainStore *store.ChainStore + StateManager *stmgr.StateManager + Datastore dtypes.MetadataDS + Wallet api.Wallet +} + +var log = logging.Logger("f3") + +func New(mctx helpers.MetricsCtx, lc fx.Lifecycle, params F3Params) (*F3, error) { + + ds := namespace.Wrap(params.Datastore, datastore.NewKey("/f3")) + ec := &ecWrapper{ + ChainStore: params.ChainStore, + StateManager: params.StateManager, + } + verif := blssig.VerifierWithKeyOnG1() + + module, err := f3.New(mctx, params.ManifestProvider, ds, + params.Host, params.PubSub, verif, ec) + + if err != nil { + return nil, xerrors.Errorf("creating F3: %w", err) + } + + fff := &F3{ + inner: module, + ec: ec, + signer: &signer{params.Wallet}, + newLeases: make(chan leaseRequest, 4), // some buffer to avoid blocking + } + + lCtx, cancel := context.WithCancel(mctx) + lc.Append(fx.StartStopHook( + func() { + err := fff.inner.Start(lCtx) + if err != nil { + log.Errorf("running f3: %+v", err) + return + } + go fff.runSigningLoop(lCtx) + }, cancel)) + + return fff, nil +} + +type leaseRequest struct { + minerID uint64 + newExpiration time.Time + oldExpiration time.Time + resultCh chan<- bool +} + +func (fff *F3) runSigningLoop(ctx context.Context) { + participateOnce := func(ctx context.Context, mb *gpbft.MessageBuilder, minerID uint64) error { + signatureBuilder, err := mb.PrepareSigningInputs(gpbft.ActorID(minerID)) + if errors.Is(err, gpbft.ErrNoPower) { + // we don't have any power in F3, continue + log.Debug("no power to participate in F3: %+v", err) + return nil + } + if err != nil { + return xerrors.Errorf("preparing signing inputs: %+v", err) + } + // if worker keys were stored not in the node, the signatureBuilder can be send there + // the sign can be called where the keys are stored and then + // {signatureBuilder, payloadSig, vrfSig} can be sent back to lotus for broadcast + payloadSig, vrfSig, err := signatureBuilder.Sign(ctx, fff.signer) + if err != nil { + return xerrors.Errorf("signing message: %+v", err) + } + log.Debugf("miner with id %d is sending message in F3", minerID) + fff.inner.Broadcast(ctx, signatureBuilder, payloadSig, vrfSig) + return nil + } + + leaseMngr := new(leaseManager) + msgCh := fff.inner.MessagesToSign() + +loop: + for ctx.Err() == nil { + select { + case <-ctx.Done(): + return + case l := <-fff.newLeases: + // resultCh has only one user and is buffered + l.resultCh <- leaseMngr.UpsertDefensive(l.minerID, l.newExpiration, l.oldExpiration) + close(l.resultCh) + case mb, ok := <-msgCh: + if !ok { + continue loop + } + + for _, minerID := range leaseMngr.Active() { + err := participateOnce(ctx, mb, minerID) + if err != nil { + log.Errorf("while participating for miner f0%d: %+v", minerID, err) + } + } + } + } +} + +// Participate notifies participation loop about a new lease +// Returns true if lease was accepted +func (fff *F3) Participate(ctx context.Context, minerID uint64, newLeaseExpiration, oldLeaseExpiration time.Time) bool { + resultCh := make(chan bool, 1) //buffer the channel to for sure avoid blocking + request := leaseRequest{minerID: minerID, newExpiration: newLeaseExpiration, resultCh: resultCh} + select { + case fff.newLeases <- request: + return <-resultCh + case <-ctx.Done(): + return false + } +} + +func (fff *F3) GetCert(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) { + return fff.inner.GetCert(ctx, instance) +} + +func (fff *F3) GetLatestCert(ctx context.Context) (*certs.FinalityCertificate, error) { + return fff.inner.GetLatestCert(ctx) +} + +func (fff *F3) GetPowerTable(ctx context.Context, tsk types.TipSetKey) (gpbft.PowerEntries, error) { + return fff.ec.getPowerTableLotusTSK(ctx, tsk) +} diff --git a/chain/lf3/leasemanager.go b/chain/lf3/leasemanager.go new file mode 100644 index 00000000000..24c75933aa8 --- /dev/null +++ b/chain/lf3/leasemanager.go @@ -0,0 +1,73 @@ +package lf3 + +import ( + "time" + + "github.com/raulk/clock" +) + +type leaseManager struct { + // clock for testing + clock clock.Clock + leases map[uint64]time.Time +} + +// Upsert inserts or updates a lease for given id to the expiration time. +func (lm *leaseManager) Upsert(id uint64, expiration time.Time) { + if lm.leases == nil { + lm.leases = make(map[uint64]time.Time) + } + lm.leases[id] = expiration +} + +// UpsertDefensive inserts or updates a lease for the given id to the expiration time either if: +// - old expiration is in the past +// - old expiration matches the one in leaseManager +// returns true if update has happened +func (lm *leaseManager) UpsertDefensive(id uint64, newExpiration time.Time, oldExpiration time.Time) bool { + clk := lm.clk() + if lm.leases == nil { + lm.leases = make(map[uint64]time.Time) + } + // if the old lease is expired just insert a new one + if clk.Until(oldExpiration) < 0 { + lm.Upsert(id, newExpiration) + return true + } + + // old lease is not expired + exp, ok := lm.leases[id] + if !ok { + // we don't know about it, don't start a new lease + return false + } + if exp != oldExpiration { + // the lease we know about does not match and because the old lease is not expired + // we should not allow for new lease + return false + } + // we know about the lease, update it + lm.Upsert(id, newExpiration) + return true +} + +func (lm *leaseManager) clk() clock.Clock { + if lm.clock != nil { + return lm.clock + } + return clock.New() +} + +// Active returns active leases and cleans up the inactive ones under the hood. +func (lm *leaseManager) Active() []uint64 { + clk := lm.clk() + var res []uint64 + for id, exp := range lm.leases { + if clk.Until(exp) <= 0 { + delete(lm.leases, id) + continue + } + res = append(res, id) + } + return res +} diff --git a/chain/lf3/leasemanager_test.go b/chain/lf3/leasemanager_test.go new file mode 100644 index 00000000000..3adaccebe3a --- /dev/null +++ b/chain/lf3/leasemanager_test.go @@ -0,0 +1,93 @@ +package lf3 + +import ( + "testing" + "time" + + "github.com/raulk/clock" + "github.com/stretchr/testify/assert" +) + +func TestLeaseManager_Upsert(t *testing.T) { + lm := &leaseManager{ + clock: clock.NewMock(), + } + + // Test inserting a new lease + expiration := lm.clock.Now().Add(1 * time.Hour) + lm.Upsert(1, expiration) + assert.Equal(t, 1, len(lm.leases)) + assert.Equal(t, expiration, lm.leases[1]) + + // Test updating an existing lease + newExpiration := lm.clock.Now().Add(2 * time.Hour) + lm.Upsert(1, newExpiration) + assert.Equal(t, 1, len(lm.leases)) + assert.Equal(t, newExpiration, lm.leases[1]) +} + +func TestLeaseManager_Active(t *testing.T) { + mockClock := clock.NewMock() + lm := &leaseManager{ + clock: mockClock, + } + + // Add some leases + expiration1 := mockClock.Now().Add(1 * time.Hour) + expiration2 := mockClock.Now().Add(2 * time.Hour) + expiration3 := mockClock.Now().Add(-1 * time.Hour) // Already expired + + lm.Upsert(1, expiration1) + lm.Upsert(2, expiration2) + lm.Upsert(3, expiration3) + + // Check active leases before advancing the clock + activeLeases := lm.Active() + assert.ElementsMatch(t, []uint64{1, 2}, activeLeases) + + // Advance the clock and check active leases again + mockClock.Add(1 * time.Hour) + activeLeases = lm.Active() + assert.ElementsMatch(t, []uint64{2}, activeLeases) + + mockClock.Add(1 * time.Hour) + activeLeases = lm.Active() + assert.Empty(t, activeLeases) +} + +func TestLeaseManager_UpsertDefensive(t *testing.T) { + mockClock := clock.NewMock() + lm := &leaseManager{ + clock: mockClock, + } + + // Test inserting a new lease when oldExpiration is in the past + oldExpiration := mockClock.Now().Add(-1 * time.Hour) + newExpiration := mockClock.Now().Add(1 * time.Hour) + updated := lm.UpsertDefensive(1, newExpiration, oldExpiration) + assert.True(t, updated) + assert.Equal(t, newExpiration, lm.leases[1]) + + // Test updating an existing lease when oldExpiration matches + oldExpiration = newExpiration + newExpiration = mockClock.Now().Add(2 * time.Hour) + updated = lm.UpsertDefensive(1, newExpiration, oldExpiration) + assert.True(t, updated) + assert.Equal(t, newExpiration, lm.leases[1]) + + // Test not updating a lease when oldExpiration does not match + oldExpiration = mockClock.Now().Add(3 * time.Hour) // Different from the current lease expiration + newExpiration = mockClock.Now().Add(4 * time.Hour) + updated = lm.UpsertDefensive(1, newExpiration, oldExpiration) + assert.False(t, updated) + assert.NotEqual(t, newExpiration, lm.leases[1]) + + // Test not updating a lease when it is not known + unknownID := uint64(2) + oldExpiration = mockClock.Now().Add(1 * time.Hour) + newExpiration = mockClock.Now().Add(2 * time.Hour) + updated = lm.UpsertDefensive(unknownID, newExpiration, oldExpiration) + assert.False(t, updated) + _, exists := lm.leases[unknownID] + assert.False(t, exists) +} diff --git a/chain/lf3/manifest.go b/chain/lf3/manifest.go new file mode 100644 index 00000000000..da09173d687 --- /dev/null +++ b/chain/lf3/manifest.go @@ -0,0 +1,40 @@ +package lf3 + +import ( + "time" + + pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/libp2p/go-libp2p/core/peer" + + "github.com/filecoin-project/go-f3/gpbft" + "github.com/filecoin-project/go-f3/manifest" + + "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" + "github.com/filecoin-project/lotus/chain/stmgr" + "github.com/filecoin-project/lotus/chain/store" + "github.com/filecoin-project/lotus/node/modules/dtypes" +) + +func NewManifestProvider(nn dtypes.NetworkName, cs *store.ChainStore, sm *stmgr.StateManager, ps *pubsub.PubSub) manifest.ManifestProvider { + m := manifest.LocalDevnetManifest() + m.NetworkName = gpbft.NetworkName(nn) + m.ECDelayMultiplier = 2. + m.ECPeriod = time.Duration(build.BlockDelaySecs) * time.Second + m.BootstrapEpoch = int64(buildconstants.F3BootstrapEpoch) + m.ECFinality = int64(build.Finality) + m.CommiteeLookback = 5 + + ec := &ecWrapper{ + ChainStore: cs, + StateManager: sm, + } + + switch manifestServerID, err := peer.Decode(buildconstants.ManifestServerID); { + case err != nil: + log.Warnw("Cannot decode F3 manifest sever identity; falling back on static manifest provider", "err", err) + return manifest.NewStaticManifestProvider(m) + default: + return manifest.NewDynamicManifestProvider(m, ps, ec, manifestServerID) + } +} diff --git a/chain/lf3/signer.go b/chain/lf3/signer.go new file mode 100644 index 00000000000..3f4d517a471 --- /dev/null +++ b/chain/lf3/signer.go @@ -0,0 +1,32 @@ +package lf3 + +import ( + "context" + + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-f3/gpbft" + + "github.com/filecoin-project/lotus/api" +) + +var _ gpbft.Signer = (*signer)(nil) + +type signer struct { + wallet api.Wallet +} + +// Sign signs a message with the private key corresponding to a public key. +// The the key must be known by the wallet and be of BLS type. +func (s *signer) Sign(ctx context.Context, sender gpbft.PubKey, msg []byte) ([]byte, error) { + addr, err := address.NewBLSAddress(sender) + if err != nil { + return nil, xerrors.Errorf("converting pubkey to address: %w", err) + } + sig, err := s.wallet.WalletSign(ctx, addr, msg, api.MsgMeta{Type: api.MTUnknown}) + if err != nil { + return nil, xerrors.Errorf("error while signing: %w", err) + } + return sig.Data, nil +} diff --git a/chain/messagepool/repub.go b/chain/messagepool/repub.go index a87d5e08a84..04f83f42300 100644 --- a/chain/messagepool/repub.go +++ b/chain/messagepool/repub.go @@ -11,6 +11,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/messagepool/gasguess" "github.com/filecoin-project/lotus/chain/types" ) @@ -81,7 +82,7 @@ func (mp *MessagePool) republishPendingMessages(ctx context.Context) error { return chains[i].Before(chains[j]) }) - gasLimit := build.BlockGasLimit + gasLimit := buildconstants.BlockGasLimit minGas := int64(gasguess.MinGas) var msgs []*types.SignedMessage loop: diff --git a/chain/messagepool/selection.go b/chain/messagepool/selection.go index 0d0ed3cbab2..cfe68ed63ba 100644 --- a/chain/messagepool/selection.go +++ b/chain/messagepool/selection.go @@ -15,12 +15,13 @@ import ( "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/messagepool/gasguess" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" ) -var bigBlockGasLimit = big.NewInt(build.BlockGasLimit) +var bigBlockGasLimit = big.NewInt(buildconstants.BlockGasLimit) const MaxBlocks = 15 @@ -268,7 +269,7 @@ func (mp *MessagePool) selectMessagesOptimal(ctx context.Context, curTs, ts *typ nextChain := 0 partitions := make([][]*msgChain, MaxBlocks) for i := 0; i < MaxBlocks && nextChain < len(chains); i++ { - gasLimit := build.BlockGasLimit + gasLimit := buildconstants.BlockGasLimit msgLimit := build.BlockMessageLimit for nextChain < len(chains) { chain := chains[nextChain] @@ -600,7 +601,7 @@ func (mp *MessagePool) selectPriorityMessages(ctx context.Context, pending map[a mpCfg := mp.getConfig() result := &selectedMessages{ msgs: make([]*types.SignedMessage, 0, mpCfg.SizeLimitLow), - gasLimit: build.BlockGasLimit, + gasLimit: buildconstants.BlockGasLimit, blsLimit: cbg.MaxLength, secpLimit: cbg.MaxLength, } @@ -762,7 +763,7 @@ func (*MessagePool) getGasReward(msg *types.SignedMessage, baseFee types.BigInt) } func (*MessagePool) getGasPerf(gasReward *big.Int, gasLimit int64) float64 { - // gasPerf = gasReward * build.BlockGasLimit / gasLimit + // gasPerf = gasReward * buildconstants.BlockGasLimit / gasLimit a := new(big.Rat).SetInt(new(big.Int).Mul(gasReward, bigBlockGasLimit)) b := big.NewRat(1, gasLimit) c := new(big.Rat).Mul(a, b) @@ -822,7 +823,7 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6 } gasLimit += m.Message.GasLimit - if gasLimit > build.BlockGasLimit { + if gasLimit > buildconstants.BlockGasLimit { break } diff --git a/chain/messagepool/selection_test.go b/chain/messagepool/selection_test.go index 5b46fadfbc6..9379675a672 100644 --- a/chain/messagepool/selection_test.go +++ b/chain/messagepool/selection_test.go @@ -26,6 +26,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/consensus/filcns" "github.com/filecoin-project/lotus/chain/messagepool/gasguess" "github.com/filecoin-project/lotus/chain/types" @@ -267,7 +268,7 @@ func TestMessageChains(t *testing.T) { // test6: one more message than what can fit in a block according to gas limit, with increasing // gasPerf; it should create a single chain with the max messages - maxMessages := int(build.BlockGasLimit / gasLimit) + maxMessages := int(buildconstants.BlockGasLimit / gasLimit) nMessages := maxMessages + 1 mset = make(map[uint64]*types.SignedMessage) @@ -571,7 +572,7 @@ func TestMessageSelectionTrimmingGas(t *testing.T) { tma.setBalance(a2, 1) // in FIL // make many small chains for the two actors - nMessages := int((build.BlockGasLimit / gasLimit) + 1) + nMessages := int((buildconstants.BlockGasLimit / gasLimit) + 1) for i := 0; i < nMessages; i++ { bias := (nMessages - i) / 3 m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(1+i%3+bias)) @@ -585,7 +586,7 @@ func TestMessageSelectionTrimmingGas(t *testing.T) { t.Fatal(err) } - expected := int(build.BlockGasLimit / gasLimit) + expected := int(buildconstants.BlockGasLimit / gasLimit) if len(msgs) != expected { t.Fatalf("expected %d messages, but got %d", expected, len(msgs)) } @@ -594,7 +595,7 @@ func TestMessageSelectionTrimmingGas(t *testing.T) { for _, m := range msgs { mGasLimit += m.Message.GasLimit } - if mGasLimit > build.BlockGasLimit { + if mGasLimit > buildconstants.BlockGasLimit { t.Fatal("selected messages gas limit exceeds block gas limit!") } @@ -641,7 +642,7 @@ func TestMessageSelectionTrimmingMsgsBasic(t *testing.T) { for _, m := range msgs { mGasLimit += m.Message.GasLimit } - if mGasLimit > build.BlockGasLimit { + if mGasLimit > buildconstants.BlockGasLimit { t.Fatal("selected messages gas limit exceeds block gas limit!") } @@ -700,7 +701,7 @@ func TestMessageSelectionTrimmingMsgsTwoSendersBasic(t *testing.T) { counts[m.Signature.Type]++ } - if mGasLimit > build.BlockGasLimit { + if mGasLimit > buildconstants.BlockGasLimit { t.Fatal("selected messages gas limit exceeds block gas limit!") } @@ -781,7 +782,7 @@ func TestMessageSelectionTrimmingMsgsTwoSendersAdvanced(t *testing.T) { counts[m.Signature.Type]++ } - if mGasLimit > build.BlockGasLimit { + if mGasLimit > buildconstants.BlockGasLimit { t.Fatal("selected messages gas limit exceeds block gas limit!") } @@ -912,7 +913,7 @@ func TestPriorityMessageSelection2(t *testing.T) { mp.cfg.PriorityAddrs = []address.Address{a1} - nMessages := int(2 * build.BlockGasLimit / gasLimit) + nMessages := int(2 * buildconstants.BlockGasLimit / gasLimit) for i := 0; i < nMessages; i++ { bias := (nMessages - i) / 3 m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(1+i%3+bias)) @@ -926,7 +927,7 @@ func TestPriorityMessageSelection2(t *testing.T) { t.Fatal(err) } - expectedMsgs := int(build.BlockGasLimit / gasLimit) + expectedMsgs := int(buildconstants.BlockGasLimit / gasLimit) if len(msgs) != expectedMsgs { t.Fatalf("expected %d messages but got %d", expectedMsgs, len(msgs)) } @@ -1077,7 +1078,7 @@ func TestOptimalMessageSelection1(t *testing.T) { tma.setBalance(a1, 1) // in FIL tma.setBalance(a2, 1) // in FIL - nMessages := int(10 * build.BlockGasLimit / gasLimit) + nMessages := int(10 * buildconstants.BlockGasLimit / gasLimit) for i := 0; i < nMessages; i++ { bias := (nMessages - i) / 3 m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(1+i%3+bias)) @@ -1089,7 +1090,7 @@ func TestOptimalMessageSelection1(t *testing.T) { t.Fatal(err) } - expectedMsgs := int(build.BlockGasLimit / gasLimit) + expectedMsgs := int(buildconstants.BlockGasLimit / gasLimit) if len(msgs) != expectedMsgs { t.Fatalf("expected %d messages, but got %d", expectedMsgs, len(msgs)) } @@ -1146,7 +1147,7 @@ func TestOptimalMessageSelection2(t *testing.T) { tma.setBalance(a1, 1) // in FIL tma.setBalance(a2, 1) // in FIL - nMessages := int(5 * build.BlockGasLimit / gasLimit) + nMessages := int(5 * buildconstants.BlockGasLimit / gasLimit) for i := 0; i < nMessages; i++ { bias := (nMessages - i) / 3 m := makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(200000+i%3+bias)) @@ -1160,7 +1161,7 @@ func TestOptimalMessageSelection2(t *testing.T) { t.Fatal(err) } - expectedMsgs := int(build.BlockGasLimit / gasLimit) + expectedMsgs := int(buildconstants.BlockGasLimit / gasLimit) if len(msgs) != expectedMsgs { t.Fatalf("expected %d messages, but got %d", expectedMsgs, len(msgs)) } @@ -1227,7 +1228,7 @@ func TestOptimalMessageSelection3(t *testing.T) { tma.setBalance(a, 1) // in FIL } - nMessages := int(build.BlockGasLimit/gasLimit) + 1 + nMessages := int(buildconstants.BlockGasLimit/gasLimit) + 1 for i := 0; i < nMessages; i++ { for j := 0; j < nActors; j++ { premium := 500000 + 10000*(nActors-j) + (nMessages+2-i)/(30*nActors) + i%3 @@ -1241,7 +1242,7 @@ func TestOptimalMessageSelection3(t *testing.T) { t.Fatal(err) } - expectedMsgs := int(build.BlockGasLimit / gasLimit) + expectedMsgs := int(buildconstants.BlockGasLimit / gasLimit) if len(msgs) != expectedMsgs { t.Fatalf("expected %d messages, but got %d", expectedMsgs, len(msgs)) } @@ -1308,7 +1309,7 @@ func testCompetitiveMessageSelection(t *testing.T, rng *rand.Rand, getPremium fu tma.setBalance(a, 1) // in FIL } - nMessages := 10 * int(build.BlockGasLimit/gasLimit) + nMessages := 10 * int(buildconstants.BlockGasLimit/gasLimit) t.Log("nMessages", nMessages) nonces := make([]uint64, nActors) for i := 0; i < nMessages; i++ { @@ -1598,7 +1599,7 @@ readLoop: mp, tma := makeTestMpool() - block := tma.nextBlockWithHeight(build.UpgradeBreezeHeight + 10) + block := tma.nextBlockWithHeight(uint64(build.UpgradeBreezeHeight + 10)) ts := mock.TipSet(block) tma.applyBlock(t, block) @@ -1618,7 +1619,7 @@ readLoop: } // do message selection and check block packing - minGasLimit := int64(0.9 * float64(build.BlockGasLimit)) + minGasLimit := int64(0.9 * float64(buildconstants.BlockGasLimit)) // greedy first selected, err := mp.SelectMessages(context.Background(), ts, 1.0) @@ -1794,7 +1795,7 @@ readLoop: } // do message selection and check block packing - minGasLimit := int64(0.9 * float64(build.BlockGasLimit)) + minGasLimit := int64(0.9 * float64(buildconstants.BlockGasLimit)) // greedy first start := time.Now() diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index 7f2a57a6112..fe88630e55a 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -18,7 +18,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/blockstore" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/rand" "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/types" @@ -44,7 +44,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types. msg = &msgCopy if msg.GasLimit == 0 { - msg.GasLimit = build.BlockGasLimit + msg.GasLimit = buildconstants.BlockGasLimit } if msg.GasFeeCap == types.EmptyInt { msg.GasFeeCap = types.NewInt(0) diff --git a/chain/store/basefee.go b/chain/store/basefee.go index 3b6af5c0716..e5c8049efa0 100644 --- a/chain/store/basefee.go +++ b/chain/store/basefee.go @@ -10,11 +10,12 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" ) func ComputeNextBaseFee(baseFee types.BigInt, gasLimitUsed int64, noOfBlocks int, epoch abi.ChainEpoch) types.BigInt { - // deta := gasLimitUsed/noOfBlocks - build.BlockGasTarget + // deta := gasLimitUsed/noOfBlocks - buildconstants.BlockGasTarget // change := baseFee * deta / BlockGasTarget // nextBaseFee = baseFee + change // nextBaseFee = max(nextBaseFee, build.MinimumBaseFee) @@ -22,22 +23,22 @@ func ComputeNextBaseFee(baseFee types.BigInt, gasLimitUsed int64, noOfBlocks int var delta int64 if epoch > build.UpgradeSmokeHeight { delta = gasLimitUsed / int64(noOfBlocks) - delta -= build.BlockGasTarget + delta -= buildconstants.BlockGasTarget } else { delta = build.PackingEfficiencyDenom * gasLimitUsed / (int64(noOfBlocks) * build.PackingEfficiencyNum) - delta -= build.BlockGasTarget + delta -= buildconstants.BlockGasTarget } // cap change at 12.5% (BaseFeeMaxChangeDenom) by capping delta - if delta > build.BlockGasTarget { - delta = build.BlockGasTarget + if delta > buildconstants.BlockGasTarget { + delta = buildconstants.BlockGasTarget } - if delta < -build.BlockGasTarget { - delta = -build.BlockGasTarget + if delta < -buildconstants.BlockGasTarget { + delta = -buildconstants.BlockGasTarget } change := big.Mul(baseFee, big.NewInt(delta)) - change = big.Div(change, big.NewInt(build.BlockGasTarget)) + change = big.Div(change, big.NewInt(buildconstants.BlockGasTarget)) change = big.Div(change, big.NewInt(build.BaseFeeMaxChangeDenom)) nextBaseFee := big.Add(baseFee, change) diff --git a/chain/store/basefee_test.go b/chain/store/basefee_test.go index 8dd61f709e0..fa22f7d042c 100644 --- a/chain/store/basefee_test.go +++ b/chain/store/basefee_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" ) @@ -22,10 +23,10 @@ func TestBaseFee(t *testing.T) { }{ {100e6, 0, 1, 87.5e6, 87.5e6}, {100e6, 0, 5, 87.5e6, 87.5e6}, - {100e6, build.BlockGasTarget, 1, 103.125e6, 100e6}, - {100e6, build.BlockGasTarget * 2, 2, 103.125e6, 100e6}, - {100e6, build.BlockGasLimit * 2, 2, 112.5e6, 112.5e6}, - {100e6, (build.BlockGasLimit * 15) / 10, 2, 110937500, 106.250e6}, + {100e6, buildconstants.BlockGasTarget, 1, 103.125e6, 100e6}, + {100e6, buildconstants.BlockGasTarget * 2, 2, 103.125e6, 100e6}, + {100e6, buildconstants.BlockGasLimit * 2, 2, 112.5e6, 112.5e6}, + {100e6, (buildconstants.BlockGasLimit * 15) / 10, 2, 110937500, 106.250e6}, } for _, test := range tests { diff --git a/chain/types/actor.go b/chain/types/actor.go index 8ba61161739..aeb687d330e 100644 --- a/chain/types/actor.go +++ b/chain/types/actor.go @@ -26,8 +26,8 @@ type ActorV5 struct { Head cid.Cid Nonce uint64 Balance BigInt - // Deterministic Address. - Address *address.Address + // The f4 address of the actor, if any. + DelegatedAddress *address.Address } type Actor = ActorV5 diff --git a/chain/types/bigint.go b/chain/types/bigint.go index 72ef5212862..ca274b7e11f 100644 --- a/chain/types/bigint.go +++ b/chain/types/bigint.go @@ -6,12 +6,12 @@ import ( big2 "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) const BigIntMaxSerializedLen = 128 // is this big enough? or too big? -var TotalFilecoinInt = FromFil(build.FilBase) +var TotalFilecoinInt = FromFil(buildconstants.FilBase) var EmptyInt = BigInt{} @@ -22,7 +22,7 @@ func NewInt(i uint64) BigInt { } func FromFil(i uint64) BigInt { - return BigMul(NewInt(i), NewInt(build.FilecoinPrecision)) + return BigMul(NewInt(i), NewInt(buildconstants.FilecoinPrecision)) } func BigFromBytes(b []byte) BigInt { diff --git a/chain/types/cbor_gen.go b/chain/types/cbor_gen.go index dde703ceed5..4c13597d075 100644 --- a/chain/types/cbor_gen.go +++ b/chain/types/cbor_gen.go @@ -1232,8 +1232,8 @@ func (t *ActorV5) MarshalCBOR(w io.Writer) error { return err } - // t.Address (address.Address) (struct) - if err := t.Address.MarshalCBOR(cw); err != nil { + // t.DelegatedAddress (address.Address) (struct) + if err := t.DelegatedAddress.MarshalCBOR(cw); err != nil { return err } return nil @@ -1309,7 +1309,7 @@ func (t *ActorV5) UnmarshalCBOR(r io.Reader) (err error) { } } - // t.Address (address.Address) (struct) + // t.DelegatedAddress (address.Address) (struct) { @@ -1321,9 +1321,9 @@ func (t *ActorV5) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - t.Address = new(address.Address) - if err := t.Address.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Address pointer: %w", err) + t.DelegatedAddress = new(address.Address) + if err := t.DelegatedAddress.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.DelegatedAddress pointer: %w", err) } } diff --git a/chain/types/electionproof.go b/chain/types/electionproof.go index f3168becb8f..1d447e4cfcf 100644 --- a/chain/types/electionproof.go +++ b/chain/types/electionproof.go @@ -5,7 +5,7 @@ import ( "github.com/minio/blake2b-simd" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) type ElectionProof struct { @@ -100,14 +100,14 @@ func polyval(p []*big.Int, x *big.Int) *big.Int { // computes lambda in Q.256 func lambda(power, totalPower *big.Int) *big.Int { - blocksPerEpoch := NewInt(build.BlocksPerEpoch) + blocksPerEpoch := NewInt(buildconstants.BlocksPerEpoch) lam := new(big.Int).Mul(power, blocksPerEpoch.Int) // Q.0 lam = lam.Lsh(lam, precision) // Q.256 lam = lam.Div(lam /* Q.256 */, totalPower /* Q.0 */) // Q.256 return lam } -var MaxWinCount = 3 * int64(build.BlocksPerEpoch) +var MaxWinCount = 3 * int64(buildconstants.BlocksPerEpoch) type poiss struct { lam *big.Int diff --git a/chain/types/ethtypes/eth_types.go b/chain/types/ethtypes/eth_types.go index 251d8d501e9..c0e1f98d721 100644 --- a/chain/types/ethtypes/eth_types.go +++ b/chain/types/ethtypes/eth_types.go @@ -22,7 +22,7 @@ import ( "github.com/filecoin-project/go-state-types/big" builtintypes "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/lib/must" ) @@ -188,8 +188,6 @@ type EthBlock struct { const EthBloomSize = 2048 var ( - EmptyEthBloom = [EthBloomSize / 8]byte{} - FullEthBloom = [EthBloomSize / 8]byte{} EmptyEthHash = EthHash{} EmptyUncleHash = must.One(ParseEthHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")) // Keccak-256 of an RLP of an empty array EmptyRootHash = must.One(ParseEthHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")) // Keccak-256 hash of the RLP of null @@ -197,10 +195,17 @@ var ( EmptyEthNonce = [8]byte{0, 0, 0, 0, 0, 0, 0, 0} ) -func init() { - for i := range FullEthBloom { - FullEthBloom[i] = 0xff +func NewEmptyEthBloom() []byte { + eb := [EthBloomSize / 8]byte{} + return eb[:] +} + +func NewFullEthBloom() []byte { + fb := [EthBloomSize / 8]byte{} + for i := range fb { + fb[i] = 0xff } + return fb[:] } func NewEthBlock(hasTransactions bool, tipsetLen int) EthBlock { @@ -210,11 +215,11 @@ func NewEthBlock(hasTransactions bool, tipsetLen int) EthBlock { TransactionsRoot: EmptyRootHash, // TransactionsRoot set to a hardcoded value which is used by some clients to determine if has no transactions. ReceiptsRoot: EmptyEthHash, Difficulty: EmptyEthInt, - LogsBloom: FullEthBloom[:], + LogsBloom: NewFullEthBloom(), Extradata: []byte{}, MixHash: EmptyEthHash, Nonce: EmptyEthNonce, - GasLimit: EthUint64(build.BlockGasLimit * int64(tipsetLen)), + GasLimit: EthUint64(buildconstants.BlockGasLimit * int64(tipsetLen)), Uncles: []EthHash{}, Transactions: []interface{}{}, } diff --git a/chain/types/fil.go b/chain/types/fil.go index 227e9442fbd..3d87545ef6c 100644 --- a/chain/types/fil.go +++ b/chain/types/fil.go @@ -8,7 +8,7 @@ import ( "github.com/invopop/jsonschema" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) type FIL BigInt @@ -21,7 +21,7 @@ func (f FIL) String() string { } func (f FIL) Unitless() string { - r := new(big.Rat).SetFrac(f.Int, big.NewInt(int64(build.FilecoinPrecision))) + r := new(big.Rat).SetFrac(f.Int, big.NewInt(int64(buildconstants.FilecoinPrecision))) if r.Sign() == 0 { return "0" } @@ -117,7 +117,7 @@ func ParseFIL(s string) (FIL, error) { } if !attofil { - r = r.Mul(r, big.NewRat(int64(build.FilecoinPrecision), 1)) + r = r.Mul(r, big.NewRat(int64(buildconstants.FilecoinPrecision), 1)) } if !r.IsInt() { diff --git a/chain/types/message.go b/chain/types/message.go index 473289ead45..2f3606dbe47 100644 --- a/chain/types/message.go +++ b/chain/types/message.go @@ -14,7 +14,7 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/network" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) const MessageVersion = 0 @@ -155,7 +155,7 @@ func (m *Message) ValidForBlockInclusion(minGas int64, version network.Version) return xerrors.New("'To' address cannot be empty") } - if m.To == build.ZeroAddress && version >= network.Version7 { + if m.To == buildconstants.ZeroAddress && version >= network.Version7 { return xerrors.New("invalid 'To' address") } @@ -203,8 +203,8 @@ func (m *Message) ValidForBlockInclusion(minGas int64, version network.Version) return xerrors.New("'GasFeeCap' less than 'GasPremium'") } - if m.GasLimit > build.BlockGasLimit { - return xerrors.Errorf("'GasLimit' field cannot be greater than a block's gas limit (%d > %d)", m.GasLimit, build.BlockGasLimit) + if m.GasLimit > buildconstants.BlockGasLimit { + return xerrors.Errorf("'GasLimit' field cannot be greater than a block's gas limit (%d > %d)", m.GasLimit, buildconstants.BlockGasLimit) } if m.GasLimit <= 0 { diff --git a/chain/types/mock/chain.go b/chain/types/mock/chain.go index dcbcd85362c..e4e80890bce 100644 --- a/chain/types/mock/chain.go +++ b/chain/types/mock/chain.go @@ -12,7 +12,7 @@ import ( "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" ) @@ -58,7 +58,7 @@ func MkBlock(parents *types.TipSet, weightInc uint64, ticketNonce uint64) *types if parents != nil { pcids = parents.Cids() height = parents.Height() + 1 - timestamp = parents.MinTimestamp() + build.BlockDelaySecs + timestamp = parents.MinTimestamp() + buildconstants.BlockDelaySecs weight = types.BigAdd(parents.Blocks()[0].ParentWeight, weight) } @@ -79,7 +79,7 @@ func MkBlock(parents *types.TipSet, weightInc uint64, ticketNonce uint64) *types Timestamp: timestamp, ParentStateRoot: pstateRoot, BlockSig: &crypto.Signature{Type: crypto.SigTypeBLS, Data: []byte("boo! im a signature")}, - ParentBaseFee: types.NewInt(uint64(build.MinimumBaseFee)), + ParentBaseFee: types.NewInt(uint64(buildconstants.MinimumBaseFee)), } } diff --git a/chain/types_test.go b/chain/types_test.go index 0fb3992146e..692c932a575 100644 --- a/chain/types_test.go +++ b/chain/types_test.go @@ -8,7 +8,7 @@ import ( "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" ) @@ -43,7 +43,7 @@ func TestSignedMessageJsonRoundtrip(t *testing.T) { func TestAddressType(t *testing.T) { //stm: @CHAIN_TYPES_ADDRESS_PREFIX_001 - build.SetAddressNetwork(address.Testnet) + buildconstants.SetAddressNetwork(address.Testnet) addr, err := makeRandomAddress() if err != nil { t.Fatal(err) @@ -53,7 +53,7 @@ func TestAddressType(t *testing.T) { t.Fatalf("address should start with %s", address.TestnetPrefix) } - build.SetAddressNetwork(address.Mainnet) + buildconstants.SetAddressNetwork(address.Mainnet) addr, err = makeRandomAddress() if err != nil { t.Fatal(err) diff --git a/chain/vm/gas.go b/chain/vm/gas.go index cb0c5def94d..4bd63bf9c08 100644 --- a/chain/vm/gas.go +++ b/chain/vm/gas.go @@ -135,7 +135,7 @@ var Prices = map[abi.ChainEpoch]Pricelist{ verifyPostDiscount: true, verifyConsensusFault: 495422, }, - abi.ChainEpoch(build.UpgradeCalicoHeight): &pricelistV0{ + build.UpgradeCalicoHeight: &pricelistV0{ computeGasMulti: 1, storageGasMulti: 1300, diff --git a/chain/vm/mkactor.go b/chain/vm/mkactor.go index b33085c0594..3a0ee66996c 100644 --- a/chain/vm/mkactor.go +++ b/chain/vm/mkactor.go @@ -89,7 +89,7 @@ func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, add func makeAccountActor(ver actorstypes.Version, addr address.Address) (*types.Actor, aerrors.ActorError) { switch addr.Protocol() { case address.BLS, address.SECP256K1: - return newAccountActor(ver, addr), nil + return newAccountActor(ver), nil case address.ID: return nil, aerrors.Newf(exitcode.SysErrInvalidReceiver, "no actor with given ID: %s", addr) case address.Actor: @@ -99,7 +99,7 @@ func makeAccountActor(ver actorstypes.Version, addr address.Address) (*types.Act } } -func newAccountActor(ver actorstypes.Version, addr address.Address) *types.Actor { +func newAccountActor(ver actorstypes.Version) *types.Actor { // TODO: ActorsUpgrade use a global actor registry? var code cid.Cid switch ver { @@ -124,7 +124,6 @@ func newAccountActor(ver actorstypes.Version, addr address.Address) *types.Actor Code: code, Balance: types.NewInt(0), Head: EmptyObjectCid, - Address: &addr, } return nact diff --git a/chain/vm/vm.go b/chain/vm/vm.go index f8a0c389216..f6f93a0d3da 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -59,9 +59,9 @@ func ResolveToDeterministicAddr(state types.StateTree, cst cbor.IpldStore, addr } if state.Version() >= types.StateTreeVersion5 { - if act.Address != nil { + if act.DelegatedAddress != nil { // If there _is_ an f4 address, return it as "key" address - return *act.Address, nil + return *act.DelegatedAddress, nil } } diff --git a/cli/chain.go b/cli/chain.go index c0d54fd6382..d9f6dc0bd96 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -37,6 +37,7 @@ import ( lapi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/consensus" "github.com/filecoin-project/lotus/chain/types" @@ -631,7 +632,7 @@ var ChainListCmd = &cli.Command{ tss = otss for i, ts := range tss { pbf := ts.Blocks()[0].ParentBaseFee - afmt.Printf("%d: %d blocks (baseFee: %s -> maxFee: %s)\n", ts.Height(), len(ts.Blocks()), ts.Blocks()[0].ParentBaseFee, types.FIL(types.BigMul(pbf, types.NewInt(uint64(build.BlockGasLimit))))) + afmt.Printf("%d: %d blocks (baseFee: %s -> maxFee: %s)\n", ts.Height(), len(ts.Blocks()), ts.Blocks()[0].ParentBaseFee, types.FIL(types.BigMul(pbf, types.NewInt(uint64(buildconstants.BlockGasLimit))))) for _, b := range ts.Blocks() { msgs, err := api.ChainGetBlockMessages(ctx, b.Cid()) @@ -657,7 +658,7 @@ var ChainListCmd = &cli.Command{ avgpremium = big.Div(psum, big.NewInt(int64(lenmsgs))) } - afmt.Printf("\t%s: \t%d msgs, gasLimit: %d / %d (%0.2f%%), avgPremium: %s\n", b.Miner, len(msgs.BlsMessages)+len(msgs.SecpkMessages), limitSum, build.BlockGasLimit, 100*float64(limitSum)/float64(build.BlockGasLimit), avgpremium) + afmt.Printf("\t%s: \t%d msgs, gasLimit: %d / %d (%0.2f%%), avgPremium: %s\n", b.Miner, len(msgs.BlsMessages)+len(msgs.SecpkMessages), limitSum, buildconstants.BlockGasLimit, 100*float64(limitSum)/float64(buildconstants.BlockGasLimit), avgpremium) } if i < len(tss)-1 { msgs, err := api.ChainGetParentMessages(ctx, tss[i+1].Blocks()[0].Cid()) @@ -680,7 +681,7 @@ var ChainListCmd = &cli.Command{ } gasEfficiency := 100 * float64(gasUsed) / float64(limitSum) - gasCapacity := 100 * float64(limitSum) / float64(build.BlockGasLimit) + gasCapacity := 100 * float64(limitSum) / float64(buildconstants.BlockGasLimit) afmt.Printf("\ttipset: \t%d msgs, %d (%0.2f%%) / %d (%0.2f%%)\n", len(msgs), gasUsed, gasEfficiency, limitSum, gasCapacity) } diff --git a/cli/compstate.html.template b/cli/compstate.html.template new file mode 100644 index 00000000000..7ad14e9a8a1 --- /dev/null +++ b/cli/compstate.html.template @@ -0,0 +1,73 @@ + + + + + + +
Tipset: {{.TipSet.Key}}
+
Epoch: {{.TipSet.Height}}
+
State CID: {{.Comp.Root}}
+
Calls
+ {{range .Comp.Trace}} + {{template "message" (Call .ExecutionTrace false .MsgCid.String)}} + {{end}} + + \ No newline at end of file diff --git a/cli/compstatemsg.html.template b/cli/compstatemsg.html.template new file mode 100644 index 00000000000..b04b088dfbd --- /dev/null +++ b/cli/compstatemsg.html.template @@ -0,0 +1,67 @@ +
+ {{$code := GetCode .Msg.To}} +
+ + {{if not .Subcall}} +

+ {{else}} +

+ {{end}} + {{- CodeStr $code}}:{{GetMethod ($code) (.Msg.Method)}} + {{if not .Subcall}} +

+ {{else}} + + {{end}} +
+
+ +
{{.Msg.From}} -> {{.Msg.To}} ({{ToFil .Msg.Value}}), M{{.Msg.Method}}
+ {{if not .Subcall}}
Msg CID: {{.Hash}}
{{end}} + {{if gt (len .Msg.Params) 0}} +
{{JsonParams ($code) (.Msg.Method) (.Msg.Params) | html}}
+ {{end}} +
Exit: {{.MsgRct.ExitCode}}{{if gt (len .MsgRct.Return) 0}}, Return{{end}}
+ {{if gt (len .MsgRct.Return) 0}} +
{{JsonReturn ($code) (.Msg.Method) (.MsgRct.Return) | html}}
+ {{end}} + + {{if ne .MsgRct.ExitCode 0}} +
Exit:
{{.MsgRct.ExitCode}}
+ {{end}} + +
+Gas Trace + + + + {{define "gasC" -}} + + {{- end}} + + {{range .GasCharges}} + + + {{template "gasC" .}} + + + {{end}} + {{with sumGas .GasCharges}} + + + {{template "gasC" .}} + + + {{end}} +
NameTotal/Compute/StorageTime Taken
{{.TotalGas}}/{{.ComputeGas}}/{{.StorageGas}}
{{.Name}}{{if PrintTiming}}{{.TimeTaken}}{{end}}
Sum{{if PrintTiming}}{{.TimeTaken}}{{end}}
+
+ + + {{if gt (len .Subcalls) 0}} +
Subcalls:
+ {{$hash := .Hash}} + {{range $i, $call := .Subcalls}} + {{template "message" (Call $call true (printf "%s-%d" $hash $i))}} + {{end}} + {{end}} +
\ No newline at end of file diff --git a/cli/evm.go b/cli/evm.go index 7eb36f8953b..bc847d2b2d6 100644 --- a/cli/evm.go +++ b/cli/evm.go @@ -471,8 +471,8 @@ func ethAddrFromFilecoinAddress(ctx context.Context, addr address.Address, fnapi if err != nil { return ethtypes.EthAddress{}, addr, err } - if fAct.Address != nil && (*fAct.Address).Protocol() == address.Delegated { - faddr = *fAct.Address + if fAct.DelegatedAddress != nil && (*fAct.DelegatedAddress).Protocol() == address.Delegated { + faddr = *fAct.DelegatedAddress } case address.Delegated: faddr = addr diff --git a/cli/mpool.go b/cli/mpool.go index f38a900fb7b..eb05e3e81e5 100644 --- a/cli/mpool.go +++ b/cli/mpool.go @@ -16,7 +16,7 @@ import ( "github.com/filecoin-project/go-state-types/big" lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/messagepool" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/node/config" @@ -712,7 +712,7 @@ var MpoolGasPerfCmd = &cli.Command{ baseFee := ts.Blocks()[0].ParentBaseFee - bigBlockGasLimit := big.NewInt(build.BlockGasLimit) + bigBlockGasLimit := big.NewInt(buildconstants.BlockGasLimit) getGasReward := func(msg *types.SignedMessage) big.Int { maxPremium := types.BigSub(msg.Message.GasFeeCap, baseFee) @@ -723,7 +723,7 @@ var MpoolGasPerfCmd = &cli.Command{ } getGasPerf := func(gasReward big.Int, gasLimit int64) float64 { - // gasPerf = gasReward * build.BlockGasLimit / gasLimit + // gasPerf = gasReward * buildconstants.BlockGasLimit / gasLimit a := new(stdbig.Rat).SetInt(new(stdbig.Int).Mul(gasReward.Int, bigBlockGasLimit.Int)) b := stdbig.NewRat(1, gasLimit) c := new(stdbig.Rat).Mul(a, b) diff --git a/cli/spcli/actor.go b/cli/spcli/actor.go index d8d35543814..0ff59d6e0a4 100644 --- a/cli/spcli/actor.go +++ b/cli/spcli/actor.go @@ -2,7 +2,6 @@ package spcli import ( "bytes" - "context" "fmt" "strconv" @@ -21,19 +20,16 @@ import ( "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/builtin/v9/miner" "github.com/filecoin-project/go-state-types/network" - power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power" - power6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/power" lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/actors/builtin/power" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/cli/spcli/createminer" cliutil "github.com/filecoin-project/lotus/cli/util" "github.com/filecoin-project/lotus/node/impl" ) @@ -1320,119 +1316,10 @@ var ActorNewMinerCmd = &cli.Command{ } ssize := abi.SectorSize(sectorSizeInt) - _, err = CreateStorageMiner(ctx, full, owner, worker, sender, ssize, cctx.Uint64("confidence")) + _, err = createminer.CreateStorageMiner(ctx, full, owner, worker, sender, ssize, cctx.Uint64("confidence")) if err != nil { return err } return nil }, } - -func CreateStorageMiner(ctx context.Context, fullNode v1api.FullNode, owner, worker, sender address.Address, ssize abi.SectorSize, confidence uint64) (address.Address, error) { - // make sure the sender account exists on chain - _, err := fullNode.StateLookupID(ctx, owner, types.EmptyTSK) - if err != nil { - return address.Undef, xerrors.Errorf("sender must exist on chain: %w", err) - } - - // make sure the worker account exists on chain - _, err = fullNode.StateLookupID(ctx, worker, types.EmptyTSK) - if err != nil { - signed, err := fullNode.MpoolPushMessage(ctx, &types.Message{ - From: sender, - To: worker, - Value: types.NewInt(0), - }, nil) - if err != nil { - return address.Undef, xerrors.Errorf("push worker init: %w", err) - } - - fmt.Printf("Initializing worker account %s, message: %s\n", worker, signed.Cid()) - fmt.Println("Waiting for confirmation") - - mw, err := fullNode.StateWaitMsg(ctx, signed.Cid(), confidence, 2000, true) - if err != nil { - return address.Undef, xerrors.Errorf("waiting for worker init: %w", err) - } - if mw.Receipt.ExitCode != 0 { - return address.Undef, xerrors.Errorf("initializing worker account failed: exit code %d", mw.Receipt.ExitCode) - } - } - - // make sure the owner account exists on chain - _, err = fullNode.StateLookupID(ctx, owner, types.EmptyTSK) - if err != nil { - signed, err := fullNode.MpoolPushMessage(ctx, &types.Message{ - From: sender, - To: owner, - Value: types.NewInt(0), - }, nil) - if err != nil { - return address.Undef, xerrors.Errorf("push owner init: %w", err) - } - - fmt.Printf("Initializing owner account %s, message: %s\n", worker, signed.Cid()) - fmt.Println("Waiting for confirmation") - - mw, err := fullNode.StateWaitMsg(ctx, signed.Cid(), confidence, 2000, true) - if err != nil { - return address.Undef, xerrors.Errorf("waiting for owner init: %w", err) - } - if mw.Receipt.ExitCode != 0 { - return address.Undef, xerrors.Errorf("initializing owner account failed: exit code %d", mw.Receipt.ExitCode) - } - } - - // Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works - nv, err := fullNode.StateNetworkVersion(ctx, types.EmptyTSK) - if err != nil { - return address.Undef, xerrors.Errorf("failed to get network version: %w", err) - } - spt, err := lminer.WindowPoStProofTypeFromSectorSize(ssize, nv) - if err != nil { - return address.Undef, xerrors.Errorf("getting post proof type: %w", err) - } - - params, err := actors.SerializeParams(&power6.CreateMinerParams{ - Owner: owner, - Worker: worker, - WindowPoStProofType: spt, - }) - if err != nil { - return address.Undef, err - } - - createStorageMinerMsg := &types.Message{ - To: power.Address, - From: sender, - Value: big.Zero(), - - Method: power.Methods.CreateMiner, - Params: params, - } - - signed, err := fullNode.MpoolPushMessage(ctx, createStorageMinerMsg, nil) - if err != nil { - return address.Undef, xerrors.Errorf("pushing createMiner message: %w", err) - } - - fmt.Printf("Pushed CreateMiner message: %s\n", signed.Cid()) - fmt.Println("Waiting for confirmation") - - mw, err := fullNode.StateWaitMsg(ctx, signed.Cid(), confidence, 2000, true) - if err != nil { - return address.Undef, xerrors.Errorf("waiting for createMiner message: %w", err) - } - - if mw.Receipt.ExitCode != 0 { - return address.Undef, xerrors.Errorf("create miner failed: exit code %d", mw.Receipt.ExitCode) - } - - var retval power2.CreateMinerReturn - if err := retval.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return)); err != nil { - return address.Undef, err - } - - fmt.Printf("New miners address is: %s (%s)\n", retval.IDAddress, retval.RobustAddress) - return retval.IDAddress, nil -} diff --git a/cli/spcli/createminer/create_miner.go b/cli/spcli/createminer/create_miner.go new file mode 100644 index 00000000000..f92369a832e --- /dev/null +++ b/cli/spcli/createminer/create_miner.go @@ -0,0 +1,130 @@ +package createminer + +import ( + "bytes" + "context" + "fmt" + + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" + power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power" + power6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/power" + + "github.com/filecoin-project/lotus/api/v1api" + "github.com/filecoin-project/lotus/chain/actors" + lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/filecoin-project/lotus/chain/actors/builtin/power" + "github.com/filecoin-project/lotus/chain/types" +) + +func CreateStorageMiner(ctx context.Context, fullNode v1api.FullNode, owner, worker, sender address.Address, ssize abi.SectorSize, confidence uint64) (address.Address, error) { + // make sure the sender account exists on chain + _, err := fullNode.StateLookupID(ctx, owner, types.EmptyTSK) + if err != nil { + return address.Undef, xerrors.Errorf("sender must exist on chain: %w", err) + } + + // make sure the worker account exists on chain + _, err = fullNode.StateLookupID(ctx, worker, types.EmptyTSK) + if err != nil { + signed, err := fullNode.MpoolPushMessage(ctx, &types.Message{ + From: sender, + To: worker, + Value: types.NewInt(0), + }, nil) + if err != nil { + return address.Undef, xerrors.Errorf("push worker init: %w", err) + } + + fmt.Printf("Initializing worker account %s, message: %s\n", worker, signed.Cid()) + fmt.Println("Waiting for confirmation") + + mw, err := fullNode.StateWaitMsg(ctx, signed.Cid(), confidence, 2000, true) + if err != nil { + return address.Undef, xerrors.Errorf("waiting for worker init: %w", err) + } + if mw.Receipt.ExitCode != 0 { + return address.Undef, xerrors.Errorf("initializing worker account failed: exit code %d", mw.Receipt.ExitCode) + } + } + + // make sure the owner account exists on chain + _, err = fullNode.StateLookupID(ctx, owner, types.EmptyTSK) + if err != nil { + signed, err := fullNode.MpoolPushMessage(ctx, &types.Message{ + From: sender, + To: owner, + Value: types.NewInt(0), + }, nil) + if err != nil { + return address.Undef, xerrors.Errorf("push owner init: %w", err) + } + + fmt.Printf("Initializing owner account %s, message: %s\n", worker, signed.Cid()) + fmt.Println("Waiting for confirmation") + + mw, err := fullNode.StateWaitMsg(ctx, signed.Cid(), confidence, 2000, true) + if err != nil { + return address.Undef, xerrors.Errorf("waiting for owner init: %w", err) + } + if mw.Receipt.ExitCode != 0 { + return address.Undef, xerrors.Errorf("initializing owner account failed: exit code %d", mw.Receipt.ExitCode) + } + } + + // Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works + nv, err := fullNode.StateNetworkVersion(ctx, types.EmptyTSK) + if err != nil { + return address.Undef, xerrors.Errorf("failed to get network version: %w", err) + } + spt, err := lminer.WindowPoStProofTypeFromSectorSize(ssize, nv) + if err != nil { + return address.Undef, xerrors.Errorf("getting post proof type: %w", err) + } + + params, err := actors.SerializeParams(&power6.CreateMinerParams{ + Owner: owner, + Worker: worker, + WindowPoStProofType: spt, + }) + if err != nil { + return address.Undef, err + } + + createStorageMinerMsg := &types.Message{ + To: power.Address, + From: sender, + Value: big.Zero(), + + Method: power.Methods.CreateMiner, + Params: params, + } + + signed, err := fullNode.MpoolPushMessage(ctx, createStorageMinerMsg, nil) + if err != nil { + return address.Undef, xerrors.Errorf("pushing createMiner message: %w", err) + } + + fmt.Printf("Pushed CreateMiner message: %s\n", signed.Cid()) + fmt.Println("Waiting for confirmation") + + mw, err := fullNode.StateWaitMsg(ctx, signed.Cid(), confidence, 2000, true) + if err != nil { + return address.Undef, xerrors.Errorf("waiting for createMiner message: %w", err) + } + + if mw.Receipt.ExitCode != 0 { + return address.Undef, xerrors.Errorf("create miner failed: exit code %d", mw.Receipt.ExitCode) + } + + var retval power2.CreateMinerReturn + if err := retval.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return)); err != nil { + return address.Undef, err + } + + fmt.Printf("New miners address is: %s (%s)\n", retval.IDAddress, retval.RobustAddress) + return retval.IDAddress, nil +} diff --git a/cli/state.go b/cli/state.go index 343e68b5389..57edf413f7a 100644 --- a/cli/state.go +++ b/cli/state.go @@ -3,6 +3,7 @@ package cli import ( "bytes" "context" + _ "embed" "encoding/base64" "encoding/hex" "encoding/json" @@ -633,8 +634,8 @@ var StateGetActorCmd = &cli.Command{ fmt.Printf("Nonce:\t\t%d\n", a.Nonce) fmt.Printf("Code:\t\t%s (%s)\n", a.Code, strtype) fmt.Printf("Head:\t\t%s\n", a.Head) - if a.Address != nil { - fmt.Printf("Delegated address:\t\t%s\n", a.Address) + if a.DelegatedAddress != nil { + fmt.Printf("Delegated address:\t\t%s\n", a.DelegatedAddress) } return nil @@ -1022,150 +1023,11 @@ func printInternalExecutions(prefix string, trace []types.ExecutionTrace) { } } -var compStateTemplate = ` - - - - - - -
Tipset: {{.TipSet.Key}}
-
Epoch: {{.TipSet.Height}}
-
State CID: {{.Comp.Root}}
-
Calls
- {{range .Comp.Trace}} - {{template "message" (Call .ExecutionTrace false .MsgCid.String)}} - {{end}} - - -` - -var compStateMsg = ` -
- {{$code := GetCode .Msg.To}} -
- - {{if not .Subcall}} -

- {{else}} -

- {{end}} - {{- CodeStr $code}}:{{GetMethod ($code) (.Msg.Method)}} - {{if not .Subcall}} -

- {{else}} - - {{end}} -
-
- -
{{.Msg.From}} -> {{.Msg.To}} ({{ToFil .Msg.Value}}), M{{.Msg.Method}}
- {{if not .Subcall}}
Msg CID: {{.Hash}}
{{end}} - {{if gt (len .Msg.Params) 0}} -
{{JsonParams ($code) (.Msg.Method) (.Msg.Params) | html}}
- {{end}} -
Exit: {{.MsgRct.ExitCode}}{{if gt (len .MsgRct.Return) 0}}, Return{{end}}
- {{if gt (len .MsgRct.Return) 0}} -
{{JsonReturn ($code) (.Msg.Method) (.MsgRct.Return) | html}}
- {{end}} - - {{if ne .MsgRct.ExitCode 0}} -
Exit:
{{.MsgRct.ExitCode}}
- {{end}} - -
-Gas Trace - - - - {{define "gasC" -}} - - {{- end}} - - {{range .GasCharges}} - - - {{template "gasC" .}} - - - {{end}} - {{with sumGas .GasCharges}} - - - {{template "gasC" .}} - - - {{end}} -
NameTotal/Compute/StorageTime Taken
{{.TotalGas}}/{{.ComputeGas}}/{{.StorageGas}}
{{.Name}}{{if PrintTiming}}{{.TimeTaken}}{{end}}
Sum{{if PrintTiming}}{{.TimeTaken}}{{end}}
-
- - - {{if gt (len .Subcalls) 0}} -
Subcalls:
- {{$hash := .Hash}} - {{range $i, $call := .Subcalls}} - {{template "message" (Call $call true (printf "%s-%d" $hash $i))}} - {{end}} - {{end}} -
` +//go:embed compstate.html.template +var compStateTemplate string + +//go:embed compstatemsg.html.template +var compStateMsg string type compStateHTMLIn struct { TipSet *types.TipSet diff --git a/cli/util/epoch.go b/cli/util/epoch.go index 81c92a7e3ed..55d385c8a52 100644 --- a/cli/util/epoch.go +++ b/cli/util/epoch.go @@ -8,18 +8,18 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" ) func EpochTime(curr, e abi.ChainEpoch) string { switch { case curr > e: - return fmt.Sprintf("%d (%s ago)", e, durafmt.Parse(time.Second*time.Duration(int64(build.BlockDelaySecs)*int64(curr-e))).LimitFirstN(2)) + return fmt.Sprintf("%d (%s ago)", e, durafmt.Parse(time.Second*time.Duration(int64(buildconstants.BlockDelaySecs)*int64(curr-e))).LimitFirstN(2)) case curr == e: return fmt.Sprintf("%d (now)", e) case curr < e: - return fmt.Sprintf("%d (in %s)", e, durafmt.Parse(time.Second*time.Duration(int64(build.BlockDelaySecs)*int64(e-curr))).LimitFirstN(2)) + return fmt.Sprintf("%d (in %s)", e, durafmt.Parse(time.Second*time.Duration(int64(buildconstants.BlockDelaySecs)*int64(e-curr))).LimitFirstN(2)) } panic("math broke") @@ -31,15 +31,15 @@ func EpochTime(curr, e abi.ChainEpoch) string { // // Example output: `1944975 (01 Jul 22 08:07 CEST, 10 hours 29 minutes ago)` func EpochTimeTs(curr, e abi.ChainEpoch, ts *types.TipSet) string { - timeStr := time.Unix(int64(ts.MinTimestamp()+(uint64(e-ts.Height())*build.BlockDelaySecs)), 0).Format(time.RFC822) + timeStr := time.Unix(int64(ts.MinTimestamp()+(uint64(e-ts.Height())*buildconstants.BlockDelaySecs)), 0).Format(time.RFC822) switch { case curr > e: - return fmt.Sprintf("%d (%s, %s ago)", e, timeStr, durafmt.Parse(time.Second*time.Duration(int64(build.BlockDelaySecs)*int64(curr-e))).LimitFirstN(2)) + return fmt.Sprintf("%d (%s, %s ago)", e, timeStr, durafmt.Parse(time.Second*time.Duration(int64(buildconstants.BlockDelaySecs)*int64(curr-e))).LimitFirstN(2)) case curr == e: return fmt.Sprintf("%d (%s, now)", e, timeStr) case curr < e: - return fmt.Sprintf("%d (%s, in %s)", e, timeStr, durafmt.Parse(time.Second*time.Duration(int64(build.BlockDelaySecs)*int64(e-curr))).LimitFirstN(2)) + return fmt.Sprintf("%d (%s, in %s)", e, timeStr, durafmt.Parse(time.Second*time.Duration(int64(buildconstants.BlockDelaySecs)*int64(e-curr))).LimitFirstN(2)) } panic("math broke") diff --git a/cmd/lotus-shed/gas-estimation.go b/cmd/lotus-shed/gas-estimation.go index 5dc048f562c..31b5384d5ce 100644 --- a/cmd/lotus-shed/gas-estimation.go +++ b/cmd/lotus-shed/gas-estimation.go @@ -16,6 +16,7 @@ import ( "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/beacon/drand" "github.com/filecoin-project/lotus/chain/consensus" "github.com/filecoin-project/lotus/chain/consensus/filcns" @@ -118,7 +119,7 @@ var gasTraceCmd = &cli.Command{ } // Set to block limit so message will not run out of gas - msg.GasLimit = build.BlockGasLimit + msg.GasLimit = buildconstants.BlockGasLimit err = cs.Load(ctx) if err != nil { diff --git a/cmd/lotus-shed/indexes.go b/cmd/lotus-shed/indexes.go index 334b7f10453..812d8059bb7 100644 --- a/cmd/lotus-shed/indexes.go +++ b/cmd/lotus-shed/indexes.go @@ -146,11 +146,11 @@ var backfillEventsCmd = &cli.Command{ } actor, err := api.StateGetActor(ctx, idAddr, ts.Key()) - if err != nil || actor.Address == nil { + if err != nil || actor.DelegatedAddress == nil { return idAddr, true } - return *actor.Address, true + return *actor.DelegatedAddress, true } isIndexedValue := func(b uint8) bool { diff --git a/cmd/lotus-shed/invariants.go b/cmd/lotus-shed/invariants.go index e3507015a36..ede3ae35b4e 100644 --- a/cmd/lotus-shed/invariants.go +++ b/cmd/lotus-shed/invariants.go @@ -19,6 +19,7 @@ import ( v11 "github.com/filecoin-project/go-state-types/builtin/v11" v12 "github.com/filecoin-project/go-state-types/builtin/v12" v13 "github.com/filecoin-project/go-state-types/builtin/v13" + v14 "github.com/filecoin-project/go-state-types/builtin/v14" v8 "github.com/filecoin-project/go-state-types/builtin/v8" v9 "github.com/filecoin-project/go-state-types/builtin/v9" @@ -192,6 +193,11 @@ var invariantsCmd = &cli.Command{ if err != nil { return xerrors.Errorf("checking state invariants: %w", err) } + case actorstypes.Version14: + messages, err = v14.CheckStateInvariants(actorTree, abi.ChainEpoch(epoch), actorCodeCids) + if err != nil { + return xerrors.Errorf("checking state invariants: %w", err) + } default: return xerrors.Errorf("unsupported actor version: %v", av) } diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index febe833d75e..6350c217c97 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -36,6 +36,7 @@ import ( v13 "github.com/filecoin-project/go-state-types/builtin/v13" market13 "github.com/filecoin-project/go-state-types/builtin/v13/market" adt13 "github.com/filecoin-project/go-state-types/builtin/v13/util/adt" + v14 "github.com/filecoin-project/go-state-types/builtin/v14" market8 "github.com/filecoin-project/go-state-types/builtin/v8/market" adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt" v9 "github.com/filecoin-project/go-state-types/builtin/v9" @@ -291,6 +292,8 @@ func getMigrationFuncsForNetwork(nv network.Version) (UpgradeActorsFunc, PreUpgr return filcns.UpgradeActorsV12, filcns.PreUpgradeActorsV12, checkNv21Invariants, nil case network.Version22: return filcns.UpgradeActorsV13, filcns.PreUpgradeActorsV13, checkNv22Invariants, nil + case network.Version23: + return filcns.UpgradeActorsV14, filcns.PreUpgradeActorsV14, checkNv23Invariants, nil default: return nil, nil, nil, xerrors.Errorf("migration not implemented for nv%d", nv) } @@ -619,6 +622,38 @@ func printMarketActorDiff(ctx context.Context, cst *cbornode.BasicIpldStore, nv return nil } +func checkNv23Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { + + actorStore := store.ActorStore(ctx, bs) + startTime := time.Now() + + // Load the new state root. + var newStateRoot types.StateRoot + if err := actorStore.Get(ctx, newStateRootCid, &newStateRoot); err != nil { + return xerrors.Errorf("failed to decode state root: %w", err) + } + + actorCodeCids, err := actors.GetActorCodeIDs(actorstypes.Version14) + if err != nil { + return err + } + newActorTree, err := builtin.LoadTree(actorStore, newStateRoot.Actors) + if err != nil { + return err + } + messages, err := v14.CheckStateInvariants(newActorTree, epoch, actorCodeCids) + if err != nil { + return xerrors.Errorf("checking state invariants: %w", err) + } + + for _, message := range messages.Messages() { + fmt.Println("got the following error: ", message) + } + + fmt.Println("completed invariant checks, took ", time.Since(startTime)) + + return nil +} func checkNv22Invariants(ctx context.Context, oldStateRootCid cid.Cid, newStateRootCid cid.Cid, bs blockstore.Blockstore, epoch abi.ChainEpoch) error { actorStore := store.ActorStore(ctx, bs) diff --git a/cmd/lotus-shed/mpool.go b/cmd/lotus-shed/mpool.go index 6b210bbc10e..0e24392ae5d 100644 --- a/cmd/lotus-shed/mpool.go +++ b/cmd/lotus-shed/mpool.go @@ -6,7 +6,7 @@ import ( "github.com/urfave/cli/v2" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" ) @@ -79,7 +79,7 @@ var minerSelectMsgsCmd = &cli.Command{ fmt.Printf("Message selection took %s\n", duration) fmt.Printf("Size of the mempool: %d\n", mpoolSize) fmt.Println("selected messages: ", len(msgs)) - fmt.Printf("total gas limit of selected messages: %d / %d (%0.2f%%)\n", totalGas, build.BlockGasLimit, 100*float64(totalGas)/float64(build.BlockGasLimit)) + fmt.Printf("total gas limit of selected messages: %d / %d (%0.2f%%)\n", totalGas, buildconstants.BlockGasLimit, 100*float64(totalGas)/float64(buildconstants.BlockGasLimit)) return nil }, } diff --git a/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go b/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go index 273ab337c1b..58468533a57 100644 --- a/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go +++ b/cmd/lotus-sim/simulation/blockbuilder/blockbuilder.go @@ -12,7 +12,7 @@ import ( actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/network" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/account" @@ -36,7 +36,7 @@ const ( // TODO: This will produce invalid blocks but it will accurately model the amount of gas // we're willing to use per-tipset. // A more correct approach would be to produce 5 blocks. We can do that later. -var targetGas = build.BlockGasTarget * expectedBlocks +var targetGas = buildconstants.BlockGasTarget * expectedBlocks type BlockBuilder struct { ctx context.Context @@ -150,7 +150,7 @@ func (bb *BlockBuilder) PushMessage(msg *types.Message) (*types.MessageReceipt, } msg.GasPremium = abi.NewTokenAmount(0) msg.GasFeeCap = abi.NewTokenAmount(0) - msg.GasLimit = build.BlockGasTarget + msg.GasLimit = buildconstants.BlockGasTarget // We manually snapshot so we can revert nonce changes, etc. on failure. err = st.Snapshot(bb.ctx) diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index ba2936e2a04..9910ffe48f9 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -11,7 +11,6 @@ import ( "fmt" "io" "os" - "path" "path/filepath" "runtime/pprof" "strings" @@ -640,7 +639,11 @@ func ImportChain(ctx context.Context, r repo.Repo, fname string, snapshot bool) } if cfg.Index.EnableMsgIndex { log.Info("populating message index...") - if err := index.PopulateAfterSnapshot(ctx, path.Join(lr.Path(), "sqlite"), cst); err != nil { + basePath, err := lr.SqlitePath() + if err != nil { + return err + } + if err := index.PopulateAfterSnapshot(ctx, filepath.Join(basePath, index.DefaultDbFilename), cst); err != nil { return err } log.Info("populating message index done") diff --git a/cmd/tvx/codenames_test.go b/cmd/tvx/codenames_test.go index 46d8466ecb2..e7476b1243a 100644 --- a/cmd/tvx/codenames_test.go +++ b/cmd/tvx/codenames_test.go @@ -16,11 +16,11 @@ func TestProtocolCodenames(t *testing.T) { t.Fatal("expected genesis codename") } - if height := abi.ChainEpoch(build.UpgradeBreezeHeight + 1); GetProtocolCodename(height) != "breeze" { + if height := build.UpgradeBreezeHeight + 1; GetProtocolCodename(height) != "breeze" { t.Fatal("expected breeze codename") } - if height := build.UpgradeAssemblyHeight + 1; GetProtocolCodename(abi.ChainEpoch(height)) != "actorsv2" { + if height := build.UpgradeAssemblyHeight + 1; GetProtocolCodename(height) != "actorsv2" { t.Fatal("expected actorsv2 codename") } diff --git a/documentation/en/actor-events-api.md b/documentation/en/actor-events-api.md index 801d101b59d..f8f4c6ad000 100644 --- a/documentation/en/actor-events-api.md +++ b/documentation/en/actor-events-api.md @@ -62,7 +62,7 @@ A `flags` field is used to convey metadata or hints about the entry, currently t * A `flag` of `0x02` indicates that the value is suitable for indexing. * A `flag` of `0x03` indicates that both the key and value are suitable for indexing. -Typically events contain entires that use either use `0x01` or `0x03` flags. +Typically events contain entries that use either use `0x01` or `0x03` flags. The structured logging style of composition should be seen in contrast to an alternative representation as a plain map or struct where the keys represent the fields of the event and the values represent the values of those fields. Some entries may duplicate keys, in which case that particular field of the event could be represented as an array. Builtin actor events are sufficiently well defined that translation to such a format is possible, but left up to the user. @@ -75,7 +75,7 @@ Two Lotus APIs are provided that can be used to obtain direct access to events s Both APIs take an `EventFilter` as an argument to determine which events to return. This event filter optionally comprises the following: -- `fromEpoch` determines when to start looking for matching events, either an epoch (in hex form), the string `earliest` or `latest` . A node is not guaranteed to have historical blocks for a particular epoch however `earliest` is intended to provide events from the begining of the available list. +- `fromEpoch` determines when to start looking for matching events, either an epoch (in hex form), the string `earliest` or `latest` . A node is not guaranteed to have historical blocks for a particular epoch however `earliest` is intended to provide events from the beginning of the available list. - `toEpoch` determines when to stop looking for matching events, either an epoch (in hex form), the string `earliest` or `latest`. - `addresses` will match a list of addresses that an event comes *from* (currently just a builtin actor address). - `fields` is a key to value mapping that matches specific event entries. Each field being matched is a property in the `fields` map and the value of that property is an array of maps, where each entry is a possible matching value for that entry. Each possible match contains a `codec` integer (currently just CBOR `0x51` for builtin actor events described in this document) and a `value` bytes blob (Base64 encoded) of the encoded field value (e.g. a Base64 encoded form of a CBOR encoded key string, such as an actor ID or an event ID). Matching first involves finding if an event’s entries contain one of the desired `key`s, then checking that one of the value matchers for that `key` field matches the value. Value matching is performed both on the `codec` and the `value` bytes. If an event’s entry is matched, the entire event is considered a match. This may be used to query for particular event types, such as `allocation`. diff --git a/documentation/en/api-v0-methods.md b/documentation/en/api-v0-methods.md index 22d360ff291..815a74cdd2c 100644 --- a/documentation/en/api-v0-methods.md +++ b/documentation/en/api-v0-methods.md @@ -3819,7 +3819,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -3859,7 +3859,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -3911,7 +3911,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } } ``` @@ -4081,7 +4081,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -4121,7 +4121,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -4232,7 +4232,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } ``` @@ -5550,7 +5550,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -5590,7 +5590,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index b9ba51cb355..ecb9053b248 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -80,6 +80,11 @@ * [EthTraceTransaction](#EthTraceTransaction) * [EthUninstallFilter](#EthUninstallFilter) * [EthUnsubscribe](#EthUnsubscribe) +* [F3](#F3) + * [F3GetCertificate](#F3GetCertificate) + * [F3GetLatestCertificate](#F3GetLatestCertificate) + * [F3GetPowerTable](#F3GetPowerTable) + * [F3Participate](#F3Participate) * [Filecoin](#Filecoin) * [FilecoinAddressToEthAddress](#FilecoinAddressToEthAddress) * [Gas](#Gas) @@ -2162,6 +2167,189 @@ Inputs: Response: `true` +## F3 + + +### F3GetCertificate +F3GetCertificate returns a finality certificate at given instance number + + +Perms: read + +Inputs: +```json +[ + 42 +] +``` + +Response: +```json +{ + "GPBFTInstance": 0, + "ECChain": null, + "SupplementalData": { + "Commitments": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "PowerTable": null + }, + "Signers": [ + 0 + ], + "Signature": null, + "PowerTableDelta": null +} +``` + +### F3GetLatestCertificate +F3GetLatestCertificate returns the latest finality certificate + + +Perms: read + +Inputs: `null` + +Response: +```json +{ + "GPBFTInstance": 0, + "ECChain": null, + "SupplementalData": { + "Commitments": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "PowerTable": null + }, + "Signers": [ + 0 + ], + "Signature": null, + "PowerTableDelta": null +} +``` + +### F3GetPowerTable +F3GetPowerTable returns a F3 specific power table for use in standalone F3 nodes. + + +Perms: read + +Inputs: +```json +[ + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ] +] +``` + +Response: +```json +[ + { + "ID": 1000, + "Power": 0, + "PubKey": "Bw==" + } +] +``` + +### F3Participate +F3Participate should be called by a storage provider to participate in signing F3 consensus. +Calling this API gives the lotus node a lease to sign in F3 on behalf of given SP. +The lease should be active only on one node. The lease will expire at the newLeaseExpiration. +To continue participating in F3 with the given node, call F3Participate again before +the newLeaseExpiration time. +newLeaseExpiration cannot be further than 5 minutes in the future. +It is recommended to call F3Participate every 60 seconds +with newLeaseExpiration set 2min into the future. +The oldLeaseExpiration has to be set to newLeaseExpiration of the last successful call. +For the first call to F3Participate, set the oldLeaseExpiration to zero value/time in the past. +F3Participate will return true if the lease was accepted. +The minerID has to be the ID address of the miner. + + +Perms: sign + +Inputs: +```json +[ + "f01234", + "0001-01-01T00:00:00Z", + "0001-01-01T00:00:00Z" +] +``` + +Response: `true` + ## Filecoin @@ -5423,7 +5611,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -5463,7 +5651,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -5515,7 +5703,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } } ``` @@ -5685,7 +5873,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -5725,7 +5913,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -5887,7 +6075,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } ``` @@ -7306,7 +7494,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ @@ -7346,7 +7534,7 @@ Response: }, "Nonce": 42, "Balance": "0", - "Address": "f01234" + "DelegatedAddress": "f01234" } }, "GasCharges": [ diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 762068adc15..159149fa7f3 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -7,7 +7,7 @@ USAGE: lotus-miner [global options] command [command options] [arguments...] VERSION: - 1.27.2-dev + 1.28.1-dev COMMANDS: init Initialize a lotus miner repo diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 67f1a5d13a5..0fb8db8df09 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -7,7 +7,7 @@ USAGE: lotus-worker [global options] command [command options] [arguments...] VERSION: - 1.27.2-dev + 1.28.1-dev COMMANDS: run Start lotus worker diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 88005a31511..db49907addf 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -7,7 +7,7 @@ USAGE: lotus [global options] command [command options] [arguments...] VERSION: - 1.27.2-dev + 1.28.1-dev COMMANDS: daemon Start a lotus daemon process diff --git a/documentation/misc/Building_a_network_skeleton.md b/documentation/misc/Building_a_network_skeleton.md index 68c1a50dd8d..f071e4a38c5 100644 --- a/documentation/misc/Building_a_network_skeleton.md +++ b/documentation/misc/Building_a_network_skeleton.md @@ -169,7 +169,7 @@ And you're done! These are all the steps necessary to create a network upgrade s - Have a local developer network that starts at the current network version. - Be able to see the Actor CIDs/Actor version for the mock Actor-bundle through `lotus state actor-cids --network-version XX+1` - Have a successful pre-migration. -- Complete the migration at upgrade epoch, with a succesful upgrade. +- Complete the migration at upgrade epoch, with a successful upgrade. - Sync the new network version with the mock actor bundle, and be able to see that you are on a new network version with `lotus state network-version` You can take a look at this [Lotus PR as a reference](https://github.com/filecoin-project/lotus/pull/11964), which added the skeleton for network version 23. diff --git a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md index e55eca0869f..ad24e6720c3 100644 --- a/documentation/misc/RELEASE_ISSUE_TEMPLATE.md +++ b/documentation/misc/RELEASE_ISSUE_TEMPLATE.md @@ -15,6 +15,7 @@ - [ ] Fork a new branch (`release/vX.Y.Z` or `release/miner/vX.Y.Z`) from `master` and make any further release related changes to this branch. If any "non-trivial" changes get added to the release, uncheck all the checkboxes and return to this stage. - [ ] Bump the version in `build/version.go` in the `master` branch to `vX.Y.(Z+1)-dev` (bump from feature release) or `vX.(Y+1).0-dev` (bump from mandatory release). Run make gen and make docsgen-cli before committing changes +- [ ] *Optional:* If preparing a release for a network upgrade, make sure all [Lotus dependecies are updated to the correct versions for the network upgrade](https://github.com/filecoin-project/lotus/blob/master/documentation/misc/Update_Dependencies_Lotus.md) **Prepping an RC**: diff --git a/documentation/misc/Update_Dependencies_Lotus.md b/documentation/misc/Update_Dependencies_Lotus.md new file mode 100644 index 00000000000..71ab5de89b0 --- /dev/null +++ b/documentation/misc/Update_Dependencies_Lotus.md @@ -0,0 +1,53 @@ +# Updating Lotus Dependencies + +This guide will walk through how to update the most common dependencies in Lotus. These are the dependencies this guide currently covers: + +- [Ref-FVM](#updating-ref-fvm) +- [Filecoin-FFI](#updating-filecoin-ffi) +- [Go-State-Types](#updating-go-state-types) +- [Builtin-Actors](#updating-builtin-actors) + +## Updating Ref-FVM + +1. The Ref-FVM dependency is updated through Filecoin-FFI. So, if you need to update Ref-FVM, you would need create a Filecoin-FFI PR similar to this: [PR updating Ref-FVM in Filecoin-FFI](https://github.com/filecoin-project/filecoin-ffi/pull/447) + +2. After the PR has been merged you would need to create a [new Filecoin-FFI release](https://github.com/filecoin-project/filecoin-ffi?tab=readme-ov-file#release-process). + +3. After the Filecoin-FFI release is out, you can follow the process outlined in [Filecoin-FFI](#updating-filecoin-ffi). + +## Updating Filecoin-FFI + +1. In your `lotus` directory, `cd extern/filecoin-ffi`. + +2. `git fetch` to ensure you have the latests changes for *filecoin-ffi*. + +3. `git checkout vX.XX.X` to checkout the version you want to update to. + +4. Then commit the update to your Lotus branch and open a PR for updating Filecoin-FFI. + +👉 Example of a [PR updating Filecoin-FFI](https://github.com/filecoin-project/lotus/pull/11431) + +👉 If you need to create a Filecoin-FFI release, you can follow [the release process](https://github.com/filecoin-project/filecoin-ffi?tab=readme-ov-file#release-process). + +## Updating Go-State-Types + +1. In Lotus´s [go.mod file](https://github.com/filecoin-project/lotus/blob/master/go.mod), search for `go-state-types` and update the version to your wanted version. + +2. Run `go mod tidy`, and commit your changes. + +👉 Example of a [PR updating Go-State-Types](https://github.com/filecoin-project/lotus/pull/11732) + +👉 If you need to create a Go-State-Types release, you can follow the steps to create a [new Go-State-Types release](https://github.com/filecoin-project/go-state-types?tab=readme-ov-file#release-process). + +## Updating Builtin-Actors + +1. In your `lotus` directory, `cd build/actors`. + +2. Run this script `./pack.sh vXX vXX.X.X-rcX` to pull in the builtin-actors bundle into your Lotus repo. + +- `vXX` is the network version you are bundling this builtin-actors for. +- `vXX.X.X-rcX` is the builtin-actors release you are bundling. + +👉 Example of a [PR updating Builtin-Actors bundle](https://github.com/filecoin-project/lotus/pull/11682/) + +👉 If you need to create a Builtin-Actors release, you can follow the steps to create a [new Builtin-Actors release](https://github.com/filecoin-project/builtin-actors/?tab=readme-ov-file#releasing). \ No newline at end of file diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index c97a43ae6c5..e467d2992e3 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit c97a43ae6c51e5e4b413479f3d027b381905e652 +Subproject commit e467d2992e3f9bd09beb71ecf84323b45d2a3511 diff --git a/go.mod b/go.mod index 77cf1182156..9fef0f4c490 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,13 @@ retract v1.14.0 // Accidentally force-pushed tag, use v1.14.1+ instead. retract v1.20.2 // Wrongfully cherry picked PR, use v1.20.2+ instead. -replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi // provided via a git submodule - replace github.com/filecoin-project/test-vectors => ./extern/test-vectors // provided via a git submodule +replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi // provided via a git submodule + require ( contrib.go.opencensus.io/exporter/prometheus v0.4.2 - github.com/BurntSushi/toml v1.3.0 + github.com/BurntSushi/toml v1.3.2 github.com/DataDog/zstd v1.4.5 github.com/GeertJohan/go.rice v1.0.3 github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee @@ -26,14 +26,14 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.4 github.com/docker/go-units v0.5.0 github.com/drand/drand v1.5.11 - github.com/drand/kyber v1.3.0 + github.com/drand/kyber v1.3.1 github.com/dustin/go-humanize v1.0.1 github.com/elastic/go-elasticsearch/v7 v7.14.0 github.com/elastic/go-sysinfo v1.7.0 github.com/elastic/gosigar v0.14.2 github.com/etclabscore/go-openrpc-reflect v0.0.36 github.com/fatih/color v1.15.0 - github.com/filecoin-project/filecoin-ffi v0.30.4-0.20220519234331-bfd1f5f9fe38 + github.com/filecoin-project/filecoin-ffi v1.28.0-rc2 github.com/filecoin-project/go-address v1.1.0 github.com/filecoin-project/go-amt-ipld/v4 v4.3.0 github.com/filecoin-project/go-bitfield v0.2.4 @@ -41,12 +41,13 @@ require ( github.com/filecoin-project/go-commp-utils v0.1.3 github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837 github.com/filecoin-project/go-crypto v0.0.1 + github.com/filecoin-project/go-f3 v0.0.3 github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 github.com/filecoin-project/go-jsonrpc v0.3.2 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.14.0-rc2 + github.com/filecoin-project/go-state-types v0.14.0-rc6 github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 @@ -82,7 +83,6 @@ require ( github.com/ipfs/boxo v0.20.0 github.com/ipfs/go-block-format v0.2.0 github.com/ipfs/go-cid v0.4.1 - github.com/ipfs/go-cidutil v0.1.0 github.com/ipfs/go-datastore v0.6.0 github.com/ipfs/go-ds-badger2 v0.1.3 github.com/ipfs/go-ds-leveldb v0.5.0 @@ -98,11 +98,12 @@ require ( github.com/ipld/go-ipld-prime v0.21.0 github.com/ipni/go-libipni v0.0.8 github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 + github.com/jpillora/backoff v1.0.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/klauspost/compress v1.17.8 github.com/koalacxr/quantile v0.0.1 github.com/libp2p/go-buffer-pool v0.1.0 - github.com/libp2p/go-libp2p v0.34.1 + github.com/libp2p/go-libp2p v0.35.0 github.com/libp2p/go-libp2p-kad-dht v0.25.2 github.com/libp2p/go-libp2p-pubsub v0.11.0 github.com/libp2p/go-libp2p-record v0.2.0 @@ -141,22 +142,22 @@ require ( github.com/zondax/ledger-filecoin-go v0.11.1 github.com/zyedidia/generic v1.2.1 go.opencensus.io v0.24.0 - go.opentelemetry.io/otel v1.26.0 - go.opentelemetry.io/otel/bridge/opencensus v0.39.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/bridge/opencensus v1.28.0 go.opentelemetry.io/otel/exporters/jaeger v1.14.0 - go.opentelemetry.io/otel/sdk v1.26.0 + go.opentelemetry.io/otel/sdk v1.28.0 go.uber.org/atomic v1.11.0 go.uber.org/fx v1.21.1 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.23.0 + golang.org/x/crypto v0.24.0 golang.org/x/mod v0.17.0 - golang.org/x/net v0.25.0 + golang.org/x/net v0.26.0 golang.org/x/sync v0.7.0 - golang.org/x/sys v0.20.0 - golang.org/x/term v0.20.0 + golang.org/x/sys v0.21.0 + golang.org/x/term v0.21.0 golang.org/x/time v0.5.0 - golang.org/x/tools v0.21.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 gopkg.in/cheggaaa/pb.v1 v1.0.28 gotest.tools v2.2.0+incompatible @@ -165,6 +166,7 @@ require ( require ( github.com/GeertJohan/go.incremental v1.0.0 // indirect github.com/Jorropo/jsync v1.0.1 // indirect + github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/StackExchange/wmi v1.2.1 // indirect @@ -176,8 +178,7 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cilium/ebpf v0.9.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/cskr/pubsub v1.0.2 // indirect github.com/daaku/go.zipexe v1.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -197,7 +198,7 @@ require ( github.com/gdamore/encoding v1.0.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.5 // indirect github.com/go-openapi/jsonpointer v0.19.3 // indirect @@ -233,7 +234,7 @@ require ( github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect - github.com/jackc/pgx/v5 v5.4.1 // indirect + github.com/jackc/pgx/v5 v5.6.0 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect @@ -267,6 +268,7 @@ require ( github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect github.com/multiformats/go-multibase v0.2.0 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nikkolasg/hexjson v0.1.0 // indirect github.com/nkovacs/streamquote v1.0.0 // indirect github.com/onsi/ginkgo/v2 v2.17.3 // indirect @@ -293,8 +295,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.53.0 // indirect - github.com/prometheus/procfs v0.15.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/quic-go/qpack v0.4.0 // indirect github.com/quic-go/quic-go v0.44.0 // indirect @@ -307,26 +309,25 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.0.1 // indirect github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect - github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.opentelemetry.io/otel/metric v1.26.0 // indirect - go.opentelemetry.io/otel/sdk/metric v0.39.0 // indirect - go.opentelemetry.io/otel/trace v1.26.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect go.uber.org/dig v1.17.1 // indirect go.uber.org/mock v0.4.0 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/text v0.16.0 // indirect gonum.org/v1/gonum v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect diff --git a/go.sum b/go.sum index e5a5dc9a5ca..3ae4d177a9b 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOv github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.0 h1:Ws8e5YmnrGEHzZEzg0YvK/7COGYtTC5PbaH9oSSbgfA= -github.com/BurntSushi/toml v1.3.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= @@ -58,6 +58,8 @@ github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee h1:8doiS7ib3zi6/K1 github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee/go.mod h1:W0GbEAA4uFNYOGG2cJpmFJ04E6SD1NLELPYZB57/7AY= github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= +github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6 h1:yh2/1fz3ajTaeKskSWxtSBNScdRZfQ/A5nyd9+64T6M= +github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6/go.mod h1:5LOj/fF3Oc/cvJqzDiyfx4XwtBPRWUYEz+V+b13sH5U= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa h1:1PPxEyGdIGVkX/kqMvLJ95a1dGS1Sz7tpNEgehEYYt0= github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa/go.mod h1:WUmMvh9wMtqj1Xhf1hf3kp9RvL+y6odtdYxpyZjb90U= @@ -87,8 +89,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs= -github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/ardanlabs/darwin/v2 v2.0.0 h1:XCisQMgQ5EG+ZvSEcADEo+pyfIMKyWAGnn5o2TgriYE= github.com/ardanlabs/darwin/v2 v2.0.0/go.mod h1:MubZ2e9DAYGaym0mClSOi183NYahrrfKxvSy1HMhoes= @@ -171,10 +171,8 @@ github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 h1:ZFUue+PNxmHlu7pYv+IYMtqlaO/0VwaGEqKepZf9JpA= -github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= @@ -212,8 +210,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drand/drand v1.5.11 h1:7sskUTCsX2lgFiWdGvPh3/P0ZDQKi1lCtI7RQKK010k= github.com/drand/drand v1.5.11/go.mod h1:TvJjCJ/s4Usn4pKRpDC0N1QaCwSt3YC8fRqhZdpOUU0= -github.com/drand/kyber v1.3.0 h1:TVd7+xoRgKQ4Ck1viNLPFy6IWhuZM36Bq6zDXD8Asls= -github.com/drand/kyber v1.3.0/go.mod h1:f+mNHjiGT++CuueBrpeMhFNdKZAsy0tu03bKq9D5LPA= +github.com/drand/kyber v1.3.1 h1:E0p6M3II+loMVwTlAp5zu4+GGZFNiRfq02qZxzw2T+Y= +github.com/drand/kyber v1.3.1/go.mod h1:f+mNHjiGT++CuueBrpeMhFNdKZAsy0tu03bKq9D5LPA= github.com/drand/kyber-bls12381 v0.3.1 h1:KWb8l/zYTP5yrvKTgvhOrk2eNPscbMiUOIeWBnmUxGo= github.com/drand/kyber-bls12381 v0.3.1/go.mod h1:H4y9bLPu7KZA/1efDg+jtJ7emKx+ro3PU7/jWUVt140= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -268,6 +266,8 @@ github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-crypto v0.0.1 h1:AcvpSGGCgjaY8y1az6AMfKQWreF/pWO2JJGLl6gCq6o= github.com/filecoin-project/go-crypto v0.0.1/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= +github.com/filecoin-project/go-f3 v0.0.3 h1:12jodQO47QNL0xnb2O1kbKIq0R+/MYWPK05Lb6MrHmU= +github.com/filecoin-project/go-f3 v0.0.3/go.mod h1:QgyFNiqCoQQFMo+w5o9tC/HqS9UwGZV4B1ssfAdGqtY= 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= @@ -292,8 +292,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS 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.14.0-rc1/go.mod h1:cHpOPup9H1g2T29dKHAjC2sc7/Ef5ypjuW9A3I+e9yY= -github.com/filecoin-project/go-state-types v0.14.0-rc2 h1:jx+iOyy7un1G6ozkvKpIBVFhs6Rg23j6NAoiIjBmGTc= -github.com/filecoin-project/go-state-types v0.14.0-rc2/go.mod h1:cHpOPup9H1g2T29dKHAjC2sc7/Ef5ypjuW9A3I+e9yY= +github.com/filecoin-project/go-state-types v0.14.0-rc6 h1:JifQV4yFd3lUpUBaPMVP6oZeqBk7Djgi94+6ekPSvbA= +github.com/filecoin-project/go-state-types v0.14.0-rc6/go.mod h1:cDbxwjbmVtV+uNi5D/cFtxKlsRqibnQNlz7xQA1EqYg= 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= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= @@ -365,8 +365,8 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= @@ -588,8 +588,6 @@ github.com/ipfs/go-cid v0.2.0/go.mod h1:P+HXFDF4CVhaVayiEb4wkAy7zBHxBwsJyt0Y5U6M github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= -github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= -github.com/ipfs/go-cidutil v0.1.0/go.mod h1:e7OEVBMIv9JaOxt9zaGEmAoSlXW9jdFZ5lP/0PwcfpA= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= @@ -718,8 +716,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.4.1 h1:oKfB/FhuVtit1bBM3zNRRsZ925ZkMN3HXL+LgLUM9lE= -github.com/jackc/pgx/v5 v5.4.1/go.mod h1:q6iHT8uDNXWiFNOlRqJzBTaSH3+2xCXkokxHZC5qWFY= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= @@ -749,6 +747,7 @@ github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= @@ -820,8 +819,8 @@ github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFG github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= -github.com/libp2p/go-libp2p v0.34.1 h1:fxn9vyLo7vJcXQRNvdRbyPjbzuQgi2UiqC8hEbn8a18= -github.com/libp2p/go-libp2p v0.34.1/go.mod h1:snyJQix4ET6Tj+LeI0VPjjxTtdWpeOhYt5lEY0KirkQ= +github.com/libp2p/go-libp2p v0.35.0 h1:1xS1Bkr9X7GtdvV6ntLnDV9xB1kNjHK1lZ0eaO6gnhc= +github.com/libp2p/go-libp2p v0.35.0/go.mod h1:snyJQix4ET6Tj+LeI0VPjjxTtdWpeOhYt5lEY0KirkQ= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= @@ -1010,6 +1009,8 @@ github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= @@ -1138,8 +1139,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1149,8 +1150,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= -github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= github.com/puzpuzpuz/xsync/v2 v2.4.0 h1:5sXAMHrtx1bg9nbRZTOn8T4MkWe5V+o8yKRH02Eznag= @@ -1347,8 +1348,8 @@ github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/ github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 h1:oWgZJmC1DorFZDpfMfWg7xk29yEOZiXmo/wZl+utTI8= github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= +github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= github.com/yugabyte/pgx/v5 v5.5.3-yb-2 h1:SDk2waZb2o6dSLYqk+vq0Ur2jnIv+X2A+P+QPR1UThU= github.com/yugabyte/pgx/v5 v5.5.3-yb-2/go.mod h1:2SxizGfDY7UDCRTtbI/xd98C/oGN7S/3YoGF8l9gx/c= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1380,20 +1381,20 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= -go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= -go.opentelemetry.io/otel/bridge/opencensus v0.39.0 h1:YHivttTaDhbZIHuPlg1sWsy2P5gj57vzqPfkHItgbwQ= -go.opentelemetry.io/otel/bridge/opencensus v0.39.0/go.mod h1:vZ4537pNjFDXEx//WldAR6Ro2LC8wwmFC76njAXwNPE= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/bridge/opencensus v1.28.0 h1:/BcyAV1bUJjSVxoeKwTQL9cS4X1iC6izZ9mheeuVSCU= +go.opentelemetry.io/otel/bridge/opencensus v1.28.0/go.mod h1:FZp2xE+46yAyp3DfLFALze58nY0iIE8zs+mCgkPAzq0= go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= -go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= -go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= -go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= -go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= -go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= -go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK/jk3NiUoAHATVAmiI= -go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= -go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1459,8 +1460,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1560,8 +1561,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1682,8 +1683,8 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1698,8 +1699,8 @@ golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1713,8 +1714,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1776,8 +1777,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1884,8 +1885,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/itests/api_test.go b/itests/api_test.go index e3a41256e34..5d26a12a2e4 100644 --- a/itests/api_test.go +++ b/itests/api_test.go @@ -18,6 +18,7 @@ import ( lapi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/itests/kit" ) @@ -166,10 +167,10 @@ func (ts *apiSuite) testOutOfGasError(t *testing.T) { // the gas estimator API executes the message with gasLimit = BlockGasLimit // Lowering it to 2 will cause it to run out of gas, testing the failure case we want - originalLimit := build.BlockGasLimit - build.BlockGasLimit = 2 + originalLimit := buildconstants.BlockGasLimit + buildconstants.BlockGasLimit = 2 defer func() { - build.BlockGasLimit = originalLimit + buildconstants.BlockGasLimit = originalLimit }() msg := &types.Message{ diff --git a/itests/eth_block_hash_test.go b/itests/eth_block_hash_test.go index e7da435bad6..2e30fe0e641 100644 --- a/itests/eth_block_hash_test.go +++ b/itests/eth_block_hash_test.go @@ -11,7 +11,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/itests/kit" ) @@ -79,7 +79,7 @@ func TestEthBlockHashesCorrect_MultiBlockTipset(t *testing.T) { require.Equal(t, ethBlockA, ethBlockB) numBlocks := len(ts.Blocks()) - expGasLimit := ethtypes.EthUint64(int64(numBlocks) * build.BlockGasLimit) + expGasLimit := ethtypes.EthUint64(int64(numBlocks) * buildconstants.BlockGasLimit) require.Equal(t, expGasLimit, ethBlockB.GasLimit) } } diff --git a/itests/eth_filter_test.go b/itests/eth_filter_test.go index 114a4c2550a..1b4366d6eee 100644 --- a/itests/eth_filter_test.go +++ b/itests/eth_filter_test.go @@ -593,7 +593,7 @@ func TestTxReceiptBloom(t *testing.T) { require.NoError(t, err) require.NotNil(t, th) - receipt, err := client.EthGetTransactionReceipt(ctx, *th) + receipt, err := client.EVM().WaitTransaction(ctx, *th) require.NoError(t, err) require.NotNil(t, receipt) require.Len(t, receipt.Logs, 1) @@ -1154,8 +1154,8 @@ func getEthAddress(ctx context.Context, t *testing.T, client *kit.TestFullNode, actor, err := client.StateGetActor(ctx, addr, head.Key()) require.NoError(t, err) - require.NotNil(t, actor.Address) - ethContractAddr, err := ethtypes.EthAddressFromFilecoinAddress(*actor.Address) + require.NotNil(t, actor.DelegatedAddress) + ethContractAddr, err := ethtypes.EthAddressFromFilecoinAddress(*actor.DelegatedAddress) require.NoError(t, err) return ethContractAddr } diff --git a/itests/eth_hash_lookup_test.go b/itests/eth_hash_lookup_test.go index 1610e245826..4f56e05320b 100644 --- a/itests/eth_hash_lookup_test.go +++ b/itests/eth_hash_lookup_test.go @@ -14,6 +14,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/itests/kit" @@ -311,7 +312,7 @@ func TestTransactionHashLookupNonexistentMessage(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - cid := build.MustParseCid("bafk2bzacecapjnxnyw4talwqv5ajbtbkzmzqiosztj5cb3sortyp73ndjl76e") + cid := buildconstants.MustParseCid("bafk2bzacecapjnxnyw4talwqv5ajbtbkzmzqiosztj5cb3sortyp73ndjl76e") // We shouldn't be able to return a hash for this fake cid chainHash, err := client.EthGetTransactionHashByCid(ctx, cid) diff --git a/itests/fevm_test.go b/itests/fevm_test.go index 55f1f14fe69..778461effdc 100644 --- a/itests/fevm_test.go +++ b/itests/fevm_test.go @@ -21,6 +21,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/itests/kit" @@ -215,7 +216,7 @@ func TestFEVMETH0(t *testing.T) { eth0Addr, err := address.NewDelegatedAddress(builtintypes.EthereumAddressManagerActorID, make([]byte, 20)) require.NoError(t, err) - require.Equal(t, *act.Address, eth0Addr) + require.Equal(t, *act.DelegatedAddress, eth0Addr) } // TestFEVMDelegateCall deploys two contracts and makes a delegate call transaction @@ -667,7 +668,7 @@ func TestFEVMRecursiveActorCallEstimate(t *testing.T) { gaslimit, err := client.EthEstimateGas(ctx, gasParams) require.NoError(t, err) - require.LessOrEqual(t, int64(gaslimit), build.BlockGasLimit) + require.LessOrEqual(t, int64(gaslimit), buildconstants.BlockGasLimit) t.Logf("EthEstimateGas GasLimit=%d", gaslimit) diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 5f8f60ccd35..84036deb623 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -35,6 +35,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" @@ -120,15 +121,15 @@ type Ensemble struct { inactive struct { fullnodes []*TestFullNode miners []*TestMiner - unmanagedMiners []*TestUnmanagedMiner workers []*TestWorker + unmanagedMiners []*TestUnmanagedMiner } active struct { fullnodes []*TestFullNode miners []*TestMiner - unmanagedMiners []*TestUnmanagedMiner workers []*TestWorker bms map[*TestMiner]*BlockMiner + unmanagedMiners []*TestUnmanagedMiner } genesis struct { version network.Version @@ -171,7 +172,7 @@ func NewEnsemble(t *testing.T, opts ...EnsembleOpt) *Ensemble { require.NoError(t, build.UseNetworkBundle("testing")) } - build.EquivocationDelaySecs = 0 + buildconstants.EquivocationDelaySecs = 0 return n } @@ -323,11 +324,11 @@ func (n *Ensemble) Miner(minerNode *TestMiner, full *TestFullNode, opts ...NodeO return n } -func (n *Ensemble) UnmanagedMiner(full *TestFullNode, opts ...NodeOpt) (*TestUnmanagedMiner, *Ensemble) { +func (n *Ensemble) UnmanagedMiner(ctx context.Context, full *TestFullNode, opts ...NodeOpt) (*TestUnmanagedMiner, *Ensemble) { actorAddr, err := address.NewIDAddress(genesis2.MinerStart + n.minerCount()) require.NoError(n.t, err) - minerNode := NewTestUnmanagedMiner(n.t, full, actorAddr, n.options.mockProofs, opts...) + minerNode := NewTestUnmanagedMiner(ctx, n.t, full, actorAddr, n.options.mockProofs, opts...) n.AddInactiveUnmanagedMiner(minerNode) return minerNode, n } diff --git a/itests/kit/evm.go b/itests/kit/evm.go index 865d5c2f2b0..f0db5877ee0 100644 --- a/itests/kit/evm.go +++ b/itests/kit/evm.go @@ -29,7 +29,7 @@ import ( "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" @@ -165,7 +165,7 @@ func (e *EVM) InvokeSolidityWithValue(ctx context.Context, sender address.Addres From: sender, Value: value, Method: builtintypes.MethodsEVM.InvokeContract, - GasLimit: build.BlockGasLimit, // note: we hardcode block gas limit due to slightly broken gas estimation - https://github.com/filecoin-project/lotus/issues/10041 + GasLimit: buildconstants.BlockGasLimit, // note: we hardcode block gas limit due to slightly broken gas estimation - https://github.com/filecoin-project/lotus/issues/10041 Params: params, } @@ -332,14 +332,23 @@ func (e *EVM) InvokeContractByFuncNameExpectExit(ctx context.Context, fromAddr a } func (e *EVM) WaitTransaction(ctx context.Context, hash ethtypes.EthHash) (*api.EthTxReceipt, error) { - if mcid, err := e.EthGetMessageCidByTransactionHash(ctx, &hash); err != nil { - return nil, err - } else if mcid == nil { - return nil, xerrors.Errorf("couldn't find message CID for txn hash: %s", hash) - } else { + retries := 3 + var mcid *cid.Cid + var err error + + for retries > 0 { + if mcid, err = e.EthGetMessageCidByTransactionHash(ctx, &hash); err != nil { + return nil, err + } else if mcid == nil { + retries-- + time.Sleep(100 * time.Millisecond) + continue + } + e.WaitMsg(ctx, *mcid) return e.EthGetTransactionReceipt(ctx, hash) } + return nil, xerrors.Errorf("couldn't find message CID for txn hash: %s", hash) } // function signatures are the first 4 bytes of the hash of the function name and types diff --git a/itests/kit/files.go b/itests/kit/files.go index 0fb4cc83979..bbd400b59ff 100644 --- a/itests/kit/files.go +++ b/itests/kit/files.go @@ -1,37 +1,16 @@ package kit import ( - "bufio" "bytes" - "context" "io" "math/rand" "os" "testing" - "github.com/ipfs/boxo/blockservice" - bstore "github.com/ipfs/boxo/blockstore" - chunk "github.com/ipfs/boxo/chunker" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - "github.com/ipfs/boxo/ipld/unixfs/importer/balanced" - ihelper "github.com/ipfs/boxo/ipld/unixfs/importer/helpers" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-cidutil" - ds "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - ipldformat "github.com/ipfs/go-ipld-format" - "github.com/ipld/go-car" "github.com/minio/blake2b-simd" - mh "github.com/multiformats/go-multihash" "github.com/stretchr/testify/require" ) -const unixfsChunkSize int64 = 1 << 10 - -var defaultHashFunction = uint64(mh.BLAKE2B_MIN + 31) - // CreateRandomFile creates a random file with the provided seed and the // provided size. func CreateRandomFile(t *testing.T, rseed, size int) (path string) { @@ -51,92 +30,6 @@ func CreateRandomFile(t *testing.T, rseed, size int) (path string) { return file.Name() } -// CreateRandomFile creates a normal file with the provided seed and the -// provided size and then transforms it to a CARv1 file and returns it. -func CreateRandomCARv1(t *testing.T, rseed, size int, opts ...GeneratedDAGOpts) (carV1FilePath string, origFilePath string) { - ctx := context.Background() - if size == 0 { - size = 1600 - } - - source := io.LimitReader(rand.New(rand.NewSource(int64(rseed))), int64(size)) - - file, err := os.CreateTemp(t.TempDir(), "sourcefile.dat") - require.NoError(t, err) - - n, err := io.Copy(file, source) - require.NoError(t, err) - require.EqualValues(t, n, size) - - // - _, err = file.Seek(0, io.SeekStart) - require.NoError(t, err) - bs := bstore.NewBlockstore(dssync.MutexWrap(ds.NewMapDatastore())) - dagSvc := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - - root := writeUnixfsDAG(ctx, t, file, dagSvc, opts...) - - // create a CARv1 file from the DAG - tmp, err := os.CreateTemp(t.TempDir(), "randcarv1") - require.NoError(t, err) - require.NoError(t, car.WriteCar(ctx, dagSvc, []cid.Cid{root}, tmp)) - _, err = tmp.Seek(0, io.SeekStart) - require.NoError(t, err) - hd, err := car.ReadHeader(bufio.NewReader(tmp)) - require.NoError(t, err) - require.EqualValues(t, 1, hd.Version) - require.Len(t, hd.Roots, 1) - require.NoError(t, tmp.Close()) - - return tmp.Name(), file.Name() -} - -type GeneratedDAGOpts struct { - ChunkSize int64 - Maxlinks int -} - -func writeUnixfsDAG(ctx context.Context, t *testing.T, rd io.Reader, dag ipldformat.DAGService, opts ...GeneratedDAGOpts) cid.Cid { - dagOpts := GeneratedDAGOpts{ - ChunkSize: unixfsChunkSize, - Maxlinks: 1024, - } - if len(opts) > 0 { - dagOpts = opts[0] - } - - rpf := files.NewReaderFile(rd) - - // generate the dag and get the root - // import to UnixFS - prefix, err := merkledag.PrefixForCidVersion(1) - require.NoError(t, err) - prefix.MhType = defaultHashFunction - - bufferedDS := ipldformat.NewBufferedDAG(ctx, dag) - params := ihelper.DagBuilderParams{ - Maxlinks: dagOpts.Maxlinks, - RawLeaves: true, - CidBuilder: cidutil.InlineBuilder{ - Builder: prefix, - Limit: 126, - }, - Dagserv: bufferedDS, - } - - db, err := params.New(chunk.NewSizeSplitter(rpf, dagOpts.ChunkSize)) - require.NoError(t, err) - - nd, err := balanced.Layout(db) - require.NoError(t, err) - require.NotEqualValues(t, cid.Undef, nd.Cid()) - - err = bufferedDS.Commit() - require.NoError(t, err) - require.NoError(t, rpf.Close()) - return nd.Cid() -} - // AssertFilesEqual compares two files by blake2b hash equality and // fails the test if unequal. func AssertFilesEqual(t *testing.T, left, right string) { diff --git a/itests/kit/node_unmanaged.go b/itests/kit/node_unmanaged.go index 5dc3ed379ad..910dbd48edc 100644 --- a/itests/kit/node_unmanaged.go +++ b/itests/kit/node_unmanaged.go @@ -6,16 +6,18 @@ import ( "crypto/rand" "fmt" "io" - "math" "os" "path/filepath" + "sync" "testing" + "time" "github.com/ipfs/go-cid" libp2pcrypto "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" cbg "github.com/whyrusleeping/cbor-gen" + "golang.org/x/sync/errgroup" ffi "github.com/filecoin-project/filecoin-ffi" "github.com/filecoin-project/go-address" @@ -23,6 +25,8 @@ import ( "github.com/filecoin-project/go-state-types/builtin" miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner" "github.com/filecoin-project/go-state-types/crypto" + "github.com/filecoin-project/go-state-types/dline" + "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/lotus/api" @@ -32,9 +36,19 @@ import ( "github.com/filecoin-project/lotus/chain/wallet/key" ) +// TODO: this shouldn't be fixed, we should make a new one for each sector/piece +var fixedPieceCid = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") + +// 32 bytes of 1's: this value essentially ignored in NI-PoRep proofs, but all zeros is not recommended. +// Regardless of what we submit to the chain, actors will replace it with 32 1's anyway but we are +// also doing proof verification call directly when we prepare an aggregate NI proof. +var niPorepInteractiveRandomness = abi.InteractiveSealRandomness([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) + // TestUnmanagedMiner is a miner that's not managed by the storage/infrastructure, all tasks must be manually executed, managed and scheduled by the test or test kit. // Note: `TestUnmanagedMiner` is not thread safe and assumes linear access of it's methods type TestUnmanagedMiner struct { + ctx context.Context + cancelFunc context.CancelFunc t *testing.T options nodeOpts mockProofs bool @@ -44,14 +58,12 @@ type TestUnmanagedMiner struct { sealedSectorDir string currentSectorNum abi.SectorNumber - cacheDirPaths map[abi.SectorNumber]string - unsealedSectorPaths map[abi.SectorNumber]string - sealedSectorPaths map[abi.SectorNumber]string - sealedCids map[abi.SectorNumber]cid.Cid - unsealedCids map[abi.SectorNumber]cid.Cid - sealTickets map[abi.SectorNumber]abi.SealRandomness + committedSectorsLk sync.Mutex + committedSectors map[abi.SectorNumber]sectorInfo - proofType map[abi.SectorNumber]abi.RegisteredSealProof + runningWdPostLoop bool + postsLk sync.Mutex + posts []windowPost ActorAddr address.Address OwnerKey *key.Key @@ -62,27 +74,50 @@ type TestUnmanagedMiner struct { } } -type WindowPostResp struct { - Posted bool +// sectorInfo contains all of the info we need to manage the lifecycle of the sector. These +// properties are private, but could be moved to OnboardedSector if they are useful to calling tests +// or need to be modified by WithModifyNIActivationsBeforeSubmit. +type sectorInfo struct { + sectorNumber abi.SectorNumber + proofType abi.RegisteredSealProof + cacheDirPath string + unsealedSectorPath string + sealedSectorPath string + sealedCid cid.Cid + unsealedCid cid.Cid + sectorProof []byte + pieces []abi.PieceInfo + sealTickets abi.SealRandomness + sealRandomnessEpoch abi.ChainEpoch +} + +type windowPost struct { + Posted []abi.SectorNumber + Epoch abi.ChainEpoch Error error } -func NewTestUnmanagedMiner(t *testing.T, full *TestFullNode, actorAddr address.Address, mockProofs bool, opts ...NodeOpt) *TestUnmanagedMiner { - require.NotNil(t, full, "full node required when instantiating miner") +func NewTestUnmanagedMiner(ctx context.Context, t *testing.T, full *TestFullNode, actorAddr address.Address, mockProofs bool, opts ...NodeOpt) *TestUnmanagedMiner { + req := require.New(t) + + req.NotNil(full, "full node required when instantiating miner") options := DefaultNodeOpts for _, o := range opts { err := o(&options) - require.NoError(t, err) + req.NoError(err) } + actorIdNum, err := address.IDFromAddress(actorAddr) + req.NoError(err) + privkey, _, err := libp2pcrypto.GenerateEd25519Key(rand.Reader) - require.NoError(t, err) + req.NoError(err) - require.NotNil(t, options.ownerKey, "owner key is required for initializing a miner") + req.NotNil(options.ownerKey, "owner key is required for initializing a miner") peerId, err := peer.IDFromPrivateKey(privkey) - require.NoError(t, err) + req.NoError(err) tmpDir := t.TempDir() cacheDir := filepath.Join(tmpDir, fmt.Sprintf("cache-%s", actorAddr)) @@ -93,7 +128,11 @@ func NewTestUnmanagedMiner(t *testing.T, full *TestFullNode, actorAddr address.A _ = os.Mkdir(unsealedSectorDir, 0755) _ = os.Mkdir(sealedSectorDir, 0755) + ctx, cancel := context.WithCancel(ctx) + tm := TestUnmanagedMiner{ + ctx: ctx, + cancelFunc: cancel, t: t, options: options, mockProofs: mockProofs, @@ -101,18 +140,12 @@ func NewTestUnmanagedMiner(t *testing.T, full *TestFullNode, actorAddr address.A unsealedSectorDir: unsealedSectorDir, sealedSectorDir: sealedSectorDir, - unsealedSectorPaths: make(map[abi.SectorNumber]string), - cacheDirPaths: make(map[abi.SectorNumber]string), - sealedSectorPaths: make(map[abi.SectorNumber]string), - sealedCids: make(map[abi.SectorNumber]cid.Cid), - unsealedCids: make(map[abi.SectorNumber]cid.Cid), - sealTickets: make(map[abi.SectorNumber]abi.SealRandomness), + committedSectors: make(map[abi.SectorNumber]sectorInfo), ActorAddr: actorAddr, OwnerKey: options.ownerKey, FullNode: full, - currentSectorNum: 101, - proofType: make(map[abi.SectorNumber]abi.RegisteredSealProof), + currentSectorNum: abi.SectorNumber(actorIdNum * 100), // include the actor id to make them unique across miners and easier to identify in logs } tm.Libp2p.PeerID = peerId tm.Libp2p.PrivKey = privkey @@ -120,187 +153,203 @@ func NewTestUnmanagedMiner(t *testing.T, full *TestFullNode, actorAddr address.A return &tm } -func (tm *TestUnmanagedMiner) AssertNoPower(ctx context.Context) { - p := tm.CurrentPower(ctx) - tm.t.Logf("Miner %s RBP: %v, QaP: %v", tm.ActorAddr, p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) - require.True(tm.t, p.MinerPower.RawBytePower.IsZero()) +func (tm *TestUnmanagedMiner) Stop() { + tm.cancelFunc() + tm.AssertNoWindowPostError() } -func (tm *TestUnmanagedMiner) CurrentPower(ctx context.Context) *api.MinerPower { - head, err := tm.FullNode.ChainHead(ctx) - require.NoError(tm.t, err) - - p, err := tm.FullNode.StateMinerPower(ctx, tm.ActorAddr, head.Key()) - require.NoError(tm.t, err) - - return p +type OnboardOpt func(opts *onboardOpt) error +type onboardOpt struct { + modifyNIActivationsBeforeSubmit func([]miner14.SectorNIActivationInfo) []miner14.SectorNIActivationInfo + requireActivationSuccess bool + expectedExitCodes []exitcode.ExitCode } -func (tm *TestUnmanagedMiner) AssertPower(ctx context.Context, raw uint64, qa uint64) { - req := require.New(tm.t) - p := tm.CurrentPower(ctx) - tm.t.Logf("Miner %s RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), tm.ActorAddr, p.MinerPower.RawBytePower.String()) - req.Equal(raw, p.MinerPower.RawBytePower.Uint64()) - req.Equal(qa, p.MinerPower.QualityAdjPower.Uint64()) +func WithModifyNIActivationsBeforeSubmit(f func([]miner14.SectorNIActivationInfo) []miner14.SectorNIActivationInfo) OnboardOpt { + return func(opts *onboardOpt) error { + opts.modifyNIActivationsBeforeSubmit = f + return nil + } } -func (tm *TestUnmanagedMiner) mkAndSavePiecesToOnboard(_ context.Context, sectorNumber abi.SectorNumber, pt abi.RegisteredSealProof) []abi.PieceInfo { - paddedPieceSize := abi.PaddedPieceSize(tm.options.sectorSize) - unpaddedPieceSize := paddedPieceSize.Unpadded() - - // Generate random bytes for the piece - randomBytes := make([]byte, unpaddedPieceSize) - _, err := io.ReadFull(rand.Reader, randomBytes) - require.NoError(tm.t, err) +func WithRequireActivationSuccess(requireActivationSuccess bool) OnboardOpt { + return func(opts *onboardOpt) error { + opts.requireActivationSuccess = requireActivationSuccess + return nil + } +} - // Create a temporary file for the first piece - pieceFileA := requireTempFile(tm.t, bytes.NewReader(randomBytes), uint64(unpaddedPieceSize)) +func WithExpectedExitCodes(exitCodes []exitcode.ExitCode) OnboardOpt { + return func(opts *onboardOpt) error { + opts.expectedExitCodes = exitCodes + return nil + } +} - // Generate the piece CID from the file - pieceCIDA, err := ffi.GeneratePieceCIDFromFile(pt, pieceFileA, unpaddedPieceSize) - require.NoError(tm.t, err) +// OnboardSectors onboards the specified number of sectors to the miner using the specified proof +// type. If `withPieces` is true and the proof type supports it, the sectors will be onboarded with +// pieces, otherwise they will be CC. +// +// This method is synchronous but each sector is prepared in a separate goroutine to speed up the +// process with real proofs. +func (tm *TestUnmanagedMiner) OnboardSectors( + proofType abi.RegisteredSealProof, + withPieces bool, + count int, + opts ...OnboardOpt, +) []abi.SectorNumber { - // Reset file offset to the beginning after CID generation - _, err = pieceFileA.Seek(0, io.SeekStart) - require.NoError(tm.t, err) + req := require.New(tm.t) - unsealedSectorFile := requireTempFile(tm.t, bytes.NewReader([]byte{}), 0) - defer func() { - _ = unsealedSectorFile.Close() - }() + options := onboardOpt{} + for _, o := range opts { + req.NoError(o(&options)) + } - // Write the piece to the staged sector file without alignment - writtenBytes, pieceCID, err := ffi.WriteWithoutAlignment(pt, pieceFileA, unpaddedPieceSize, unsealedSectorFile) - require.NoError(tm.t, err) - require.EqualValues(tm.t, unpaddedPieceSize, writtenBytes) - require.True(tm.t, pieceCID.Equals(pieceCIDA)) + sectors := make([]sectorInfo, count) - // Create a struct for the piece info - publicPieces := []abi.PieceInfo{{ - Size: paddedPieceSize, - PieceCID: pieceCIDA, - }} + // Wait for the seal randomness to be available (we can only draw seal randomness from + // tipsets that have already achieved finality) + sealRandEpoch, err := tm.waitPreCommitSealRandomness(proofType) + req.NoError(err) - // Create a temporary file for the sealed sector - sealedSectorFile := requireTempFile(tm.t, bytes.NewReader([]byte{}), 0) - defer func() { - _ = sealedSectorFile.Close() - }() + var eg errgroup.Group + + // For each sector, run PC1, PC2, C1 an C2, preparing for ProveCommit. If the proof needs it we + // will also submit a precommit for the sector. + for i := 0; i < count; i++ { + idx := i + + // We hold on to `sector`, adding new properties to it as we go along until we're finished with + // this phase, then add it to `sectors` + sector := tm.nextSector(proofType) + sector.sealRandomnessEpoch = sealRandEpoch + + eg.Go(func() error { + if withPieces { + // Build a sector with non-zero pieces to onboard + if tm.mockProofs { + sector.pieces = []abi.PieceInfo{{ + Size: abi.PaddedPieceSize(tm.options.sectorSize), + PieceCID: fixedPieceCid, + }} + } else { + var err error + sector, err = tm.mkAndSavePiecesToOnboard(sector) + if err != nil { + return fmt.Errorf("failed to create sector with pieces: %w", err) + } + } + } else { + // Build a sector with no pieces (CC) to onboard + if !tm.mockProofs { + sector, err = tm.makeAndSaveCCSector(sector) + if err != nil { + return fmt.Errorf("failed to create CC sector: %w", err) + } + } + } - // Update paths for the sector - tm.sealedSectorPaths[sectorNumber] = sealedSectorFile.Name() - tm.unsealedSectorPaths[sectorNumber] = unsealedSectorFile.Name() - tm.cacheDirPaths[sectorNumber] = filepath.Join(tm.cacheDir, fmt.Sprintf("%d", sectorNumber)) + // Generate a PreCommit for the CC sector if required + sector, err = tm.generatePreCommit(sector, sealRandEpoch) + if err != nil { + return fmt.Errorf("failed to generate PreCommit for sector: %w", err) + } - // Ensure the cache directory exists - _ = os.Mkdir(tm.cacheDirPaths[sectorNumber], 0755) + // Submit the PreCommit to the network if required + //TODO: should do this for all sectors in the batch in one go + err = tm.preCommitSectors(sealRandEpoch, proofType, sector) + if err != nil { + return fmt.Errorf("failed to submit PreCommit for sector: %w", err) + } - return publicPieces -} + // Generate a ProveCommit for the CC sector + sectorProof, err := tm.generateSectorProof(sector) + if err != nil { + return fmt.Errorf("failed to generate ProveCommit for sector: %w", err) + } + sector.sectorProof = sectorProof -func (tm *TestUnmanagedMiner) makeAndSaveCCSector(_ context.Context, sectorNumber abi.SectorNumber) { - requirements := require.New(tm.t) + sectors[idx] = sector + return nil + }) + } - // Create cache directory - cacheDirPath := filepath.Join(tm.cacheDir, fmt.Sprintf("%d", sectorNumber)) - requirements.NoError(os.Mkdir(cacheDirPath, 0755)) - tm.t.Logf("Miner %s: Sector %d: created cache directory at %s", tm.ActorAddr, sectorNumber, cacheDirPath) + if err := eg.Wait(); err != nil { + tm.t.Fatal(err) + } - // Define paths for unsealed and sealed sectors - unsealedSectorPath := filepath.Join(tm.unsealedSectorDir, fmt.Sprintf("%d", sectorNumber)) - sealedSectorPath := filepath.Join(tm.sealedSectorDir, fmt.Sprintf("%d", sectorNumber)) - unsealedSize := abi.PaddedPieceSize(tm.options.sectorSize).Unpadded() + // Submit ProveCommit for all sectors + exitCodes := tm.submitProveCommit(proofType, sectors, options.requireActivationSuccess, options.modifyNIActivationsBeforeSubmit) + + // ProveCommit may have succeeded overall, but some sectors may have failed if RequireActivationSuccess + // was set to false. We need to return the exit codes for each sector so the caller can determine + // which sectors failed. + onboarded := make([]abi.SectorNumber, 0) + for i, sector := range sectors { + // expect them all to pass unless the caller specified otherwise + if options.expectedExitCodes == nil { + req.Equal(exitCodes[i], exitcode.Ok, "sector %d failed with exit code %s", sector.sectorNumber, exitCodes[i]) + } else { + req.Equal(options.expectedExitCodes[i], exitCodes[i], "sector %d failed with exit code %s", sector.sectorNumber, exitCodes[i]) + } - // Write unsealed sector file - requirements.NoError(os.WriteFile(unsealedSectorPath, make([]byte, unsealedSize), 0644)) - tm.t.Logf("Miner %s: Sector %d: wrote unsealed CC sector to %s", tm.ActorAddr, sectorNumber, unsealedSectorPath) + if exitCodes[i].IsSuccess() { + // only save the sector if it was successfully committed + tm.setCommittedSector(sectors[i]) + onboarded = append(onboarded, sector.sectorNumber) + } + } - // Write sealed sector file - requirements.NoError(os.WriteFile(sealedSectorPath, make([]byte, tm.options.sectorSize), 0644)) - tm.t.Logf("Miner %s: Sector %d: wrote sealed CC sector to %s", tm.ActorAddr, sectorNumber, sealedSectorPath) + tm.wdPostLoop() - // Update paths in the struct - tm.unsealedSectorPaths[sectorNumber] = unsealedSectorPath - tm.sealedSectorPaths[sectorNumber] = sealedSectorPath - tm.cacheDirPaths[sectorNumber] = cacheDirPath + return onboarded } -func (tm *TestUnmanagedMiner) mkStagedFileWithPieces(pt abi.RegisteredSealProof) ([]abi.PieceInfo, string) { - paddedPieceSize := abi.PaddedPieceSize(tm.options.sectorSize) - unpaddedPieceSize := paddedPieceSize.Unpadded() - - // Generate random bytes for the piece - randomBytes := make([]byte, unpaddedPieceSize) - _, err := io.ReadFull(rand.Reader, randomBytes) - require.NoError(tm.t, err) - - // Create a temporary file for the first piece - pieceFileA := requireTempFile(tm.t, bytes.NewReader(randomBytes), uint64(unpaddedPieceSize)) - - // Generate the piece CID from the file - pieceCIDA, err := ffi.GeneratePieceCIDFromFile(pt, pieceFileA, unpaddedPieceSize) - require.NoError(tm.t, err) - - // Reset file offset to the beginning after CID generation - _, err = pieceFileA.Seek(0, io.SeekStart) - require.NoError(tm.t, err) - - unsealedSectorFile := requireTempFile(tm.t, bytes.NewReader([]byte{}), 0) - defer func() { - _ = unsealedSectorFile.Close() - }() +// SnapDeal snaps a deal into a sector, generating a new sealed sector and updating the sector's state. +// WindowPoSt should continue to operate after this operation if required. +func (tm *TestUnmanagedMiner) SnapDeal(sectorNumber abi.SectorNumber) []abi.PieceInfo { + req := require.New(tm.t) - // Write the piece to the staged sector file without alignment - writtenBytes, pieceCID, err := ffi.WriteWithoutAlignment(pt, pieceFileA, unpaddedPieceSize, unsealedSectorFile) - require.NoError(tm.t, err) - require.EqualValues(tm.t, unpaddedPieceSize, writtenBytes) - require.True(tm.t, pieceCID.Equals(pieceCIDA)) + tm.log("Snapping a deal into sector %d ...", sectorNumber) - // Create a struct for the piece info - publicPieces := []abi.PieceInfo{{ - Size: paddedPieceSize, - PieceCID: pieceCIDA, - }} - - return publicPieces, unsealedSectorFile.Name() -} + si, err := tm.getCommittedSector(sectorNumber) + req.NoError(err) -func (tm *TestUnmanagedMiner) SnapDeal(ctx context.Context, proofType abi.RegisteredSealProof, sectorNumber abi.SectorNumber) []abi.PieceInfo { - updateProofType := abi.SealProofInfos[proofType].UpdateProof + updateProofType := abi.SealProofInfos[si.proofType].UpdateProof var pieces []abi.PieceInfo var snapProof []byte - var newSealedCid cid.Cid + var newSealedCid, newUnsealedCid cid.Cid if !tm.mockProofs { - // generate sector key var unsealedPath string - pieces, unsealedPath = tm.mkStagedFileWithPieces(proofType) + var err error + pieces, unsealedPath, err = tm.mkStagedFileWithPieces(si.proofType) + req.NoError(err) - s, err := os.Stat(tm.sealedSectorPaths[sectorNumber]) - require.NoError(tm.t, err) + s, err := os.Stat(si.sealedSectorPath) + req.NoError(err) randomBytes := make([]byte, s.Size()) _, err = io.ReadFull(rand.Reader, randomBytes) - require.NoError(tm.t, err) + req.NoError(err) - updatePath := requireTempFile(tm.t, bytes.NewReader(randomBytes), uint64(s.Size())) - require.NoError(tm.t, updatePath.Close()) + updatePath, err := mkTempFile(tm.t, bytes.NewReader(randomBytes), uint64(s.Size())) + req.NoError(err) + req.NoError(updatePath.Close()) updateDir := filepath.Join(tm.t.TempDir(), fmt.Sprintf("update-%d", sectorNumber)) - require.NoError(tm.t, os.MkdirAll(updateDir, 0700)) + req.NoError(os.MkdirAll(updateDir, 0700)) - var newUnsealedCid cid.Cid newSealedCid, newUnsealedCid, err = ffi.SectorUpdate.EncodeInto(updateProofType, updatePath.Name(), updateDir, - tm.sealedSectorPaths[sectorNumber], tm.cacheDirPaths[sectorNumber], unsealedPath, pieces) - require.NoError(tm.t, err) + si.sealedSectorPath, si.cacheDirPath, unsealedPath, pieces) + req.NoError(err) - vp, err := ffi.SectorUpdate.GenerateUpdateVanillaProofs(updateProofType, tm.sealedCids[sectorNumber], - newSealedCid, newUnsealedCid, updatePath.Name(), updateDir, tm.sealedSectorPaths[sectorNumber], - tm.cacheDirPaths[sectorNumber]) - require.NoError(tm.t, err) + vp, err := ffi.SectorUpdate.GenerateUpdateVanillaProofs(updateProofType, si.sealedCid, + newSealedCid, newUnsealedCid, updatePath.Name(), updateDir, si.sealedSectorPath, si.cacheDirPath) + req.NoError(err) - snapProof, err = ffi.SectorUpdate.GenerateUpdateProofWithVanilla(updateProofType, tm.sealedCids[sectorNumber], - newSealedCid, newUnsealedCid, vp) - require.NoError(tm.t, err) + snapProof, err = ffi.SectorUpdate.GenerateUpdateProofWithVanilla(updateProofType, si.sealedCid, newSealedCid, newUnsealedCid, vp) + req.NoError(err) } else { pieces = []abi.PieceInfo{{ Size: abi.PaddedPieceSize(tm.options.sectorSize), @@ -310,9 +359,8 @@ func (tm *TestUnmanagedMiner) SnapDeal(ctx context.Context, proofType abi.Regist newSealedCid = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkieka") } - tm.waitForMutableDeadline(ctx, sectorNumber) + tm.waitForMutableDeadline(sectorNumber) - // submit proof var manifest []miner14.PieceActivationManifest for _, piece := range pieces { manifest = append(manifest, miner14.PieceActivationManifest{ @@ -321,11 +369,13 @@ func (tm *TestUnmanagedMiner) SnapDeal(ctx context.Context, proofType abi.Regist }) } - head, err := tm.FullNode.ChainHead(ctx) - require.NoError(tm.t, err) + head, err := tm.FullNode.ChainHead(tm.ctx) + req.NoError(err) - sl, err := tm.FullNode.StateSectorPartition(ctx, tm.ActorAddr, sectorNumber, head.Key()) - require.NoError(tm.t, err) + sl, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNumber, head.Key()) + req.NoError(err) + + tm.log("Submitting ProveReplicaUpdates3 for sector %d ...", sectorNumber) params := &miner14.ProveReplicaUpdates3Params{ SectorUpdates: []miner14.SectorUpdateManifest{ @@ -342,454 +392,733 @@ func (tm *TestUnmanagedMiner) SnapDeal(ctx context.Context, proofType abi.Regist RequireActivationSuccess: true, RequireNotificationSuccess: false, } - r, err := tm.SubmitMessage(ctx, params, 1, builtin.MethodsMiner.ProveReplicaUpdates3) - require.NoError(tm.t, err) - require.True(tm.t, r.Receipt.ExitCode.IsSuccess()) + r, err := tm.SubmitMessage(params, 1, builtin.MethodsMiner.ProveReplicaUpdates3) + req.NoError(err) + req.True(r.Receipt.ExitCode.IsSuccess()) + + si.pieces = pieces + si.sealedCid = newSealedCid + si.unsealedCid = newUnsealedCid + tm.setCommittedSector(si) return pieces } -func (tm *TestUnmanagedMiner) waitForMutableDeadline(ctx context.Context, sectorNum abi.SectorNumber) { - ts, err := tm.FullNode.ChainHead(ctx) - require.NoError(tm.t, err) - - sl, err := tm.FullNode.StateSectorPartition(ctx, tm.ActorAddr, sectorNum, ts.Key()) - require.NoError(tm.t, err) - - dlinfo, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, ts.Key()) - require.NoError(tm.t, err) +func (tm *TestUnmanagedMiner) log(msg string, args ...interface{}) { + tm.t.Logf(fmt.Sprintf("Miner %s: %s", tm.ActorAddr, msg), args...) +} - sectorDeadlineOpen := sl.Deadline == dlinfo.Index - sectorDeadlineNext := (dlinfo.Index+1)%dlinfo.WPoStPeriodDeadlines == sl.Deadline - immutable := sectorDeadlineOpen || sectorDeadlineNext - - // Sleep for immutable epochs - if immutable { - dlineEpochsRemaining := dlinfo.NextOpen() - ts.Height() - var targetEpoch abi.ChainEpoch - if sectorDeadlineOpen { - // sleep for remainder of deadline - targetEpoch = ts.Height() + dlineEpochsRemaining - } else { - // sleep for remainder of deadline and next one - targetEpoch = ts.Height() + dlineEpochsRemaining + dlinfo.WPoStChallengeWindow - } - _, err := tm.FullNode.WaitTillChainOrError(ctx, HeightAtLeast(targetEpoch+5)) - require.NoError(tm.t, err) +func (tm *TestUnmanagedMiner) getCommittedSector(sectorNumber abi.SectorNumber) (sectorInfo, error) { + tm.committedSectorsLk.Lock() + defer tm.committedSectorsLk.Unlock() + si, ok := tm.committedSectors[sectorNumber] + if !ok { + return sectorInfo{}, fmt.Errorf("sector %d not found", sectorNumber) } + return si, nil +} + +func (tm *TestUnmanagedMiner) setCommittedSector(sectorInfo sectorInfo) { + tm.committedSectorsLk.Lock() + tm.committedSectors[sectorInfo.sectorNumber] = sectorInfo + tm.committedSectorsLk.Unlock() } -func (tm *TestUnmanagedMiner) NextSectorNumber() abi.SectorNumber { - sectorNumber := tm.currentSectorNum +// nextSector creates a new sectorInfo{} with a new unique sector number for this miner, +// but it doesn't persist it to the miner state so we don't accidentally try and wdpost +// a sector that's either not ready or doesn't get committed. +func (tm *TestUnmanagedMiner) nextSector(proofType abi.RegisteredSealProof) sectorInfo { + si := sectorInfo{ + sectorNumber: tm.currentSectorNum, + proofType: proofType, + } tm.currentSectorNum++ - return sectorNumber + return si } -func (tm *TestUnmanagedMiner) PrepareSectorForProveCommit( - ctx context.Context, - proofType abi.RegisteredSealProof, - sectorNumber abi.SectorNumber, - pieces []abi.PieceInfo, -) (seedEpoch abi.ChainEpoch, proveCommit []byte) { +func (tm *TestUnmanagedMiner) mkAndSavePiecesToOnboard(sector sectorInfo) (sectorInfo, error) { + paddedPieceSize := abi.PaddedPieceSize(tm.options.sectorSize) + unpaddedPieceSize := paddedPieceSize.Unpadded() - req := require.New(tm.t) + // Generate random bytes for the piece + randomBytes := make([]byte, unpaddedPieceSize) + if _, err := io.ReadFull(rand.Reader, randomBytes); err != nil { + return sectorInfo{}, err + } - // Wait for the pre-commitseal randomness to be available (we can only draw seal randomness from tipsets that have already achieved finality) - preCommitSealRandEpoch := tm.waitPreCommitSealRandomness(ctx, sectorNumber, proofType) + // Create a temporary file for the first piece + pieceFileA, err := mkTempFile(tm.t, bytes.NewReader(randomBytes), uint64(unpaddedPieceSize)) + if err != nil { + return sectorInfo{}, err + } - // Generate a Pre-Commit for the CC sector -> this persists the proof on the `TestUnmanagedMiner` Miner State - tm.generatePreCommit(ctx, sectorNumber, preCommitSealRandEpoch, proofType, pieces) + // Generate the piece CID from the file + pieceCIDA, err := ffi.GeneratePieceCIDFromFile(sector.proofType, pieceFileA, unpaddedPieceSize) + if err != nil { + return sectorInfo{}, err + } - // --------------------Create pre-commit for the CC sector -> we'll just pre-commit `sector size` worth of 0s for this CC sector + // Reset file offset to the beginning after CID generation + if _, err = pieceFileA.Seek(0, io.SeekStart); err != nil { + return sectorInfo{}, err + } - if !proofType.IsNonInteractive() { - // Submit the Pre-Commit to the network - var uc *cid.Cid - if len(pieces) > 0 { - unsealedCid := tm.unsealedCids[sectorNumber] - uc = &unsealedCid - } - r, err := tm.SubmitMessage(ctx, &miner14.PreCommitSectorBatchParams2{ - Sectors: []miner14.SectorPreCommitInfo{{ - Expiration: 2880 * 300, - SectorNumber: sectorNumber, - SealProof: proofType, - SealedCID: tm.sealedCids[sectorNumber], - SealRandEpoch: preCommitSealRandEpoch, - UnsealedCid: uc, - }}, - }, 1, builtin.MethodsMiner.PreCommitSectorBatch2) - req.NoError(err) - req.True(r.Receipt.ExitCode.IsSuccess()) + unsealedSectorFile, err := mkTempFile(tm.t, bytes.NewReader([]byte{}), 0) + if err != nil { + return sectorInfo{}, err } - // Generate a ProveCommit for the CC sector - var seedRandomness abi.InteractiveSealRandomness - seedEpoch, seedRandomness = tm.proveCommitWaitSeed(ctx, sectorNumber, proofType) + defer func() { + _ = unsealedSectorFile.Close() + }() - proveCommit = []byte{0xde, 0xad, 0xbe, 0xef} // mock prove commit - if !tm.mockProofs { - proveCommit = tm.generateProveCommit(ctx, sectorNumber, proofType, seedRandomness, pieces) + // Write the piece to the staged sector file without alignment + writtenBytes, pieceCID, err := ffi.WriteWithoutAlignment(sector.proofType, pieceFileA, unpaddedPieceSize, unsealedSectorFile) + if err != nil { + return sectorInfo{}, err + } + if unpaddedPieceSize != writtenBytes { + return sectorInfo{}, fmt.Errorf("expected to write %d bytes, wrote %d", unpaddedPieceSize, writtenBytes) + } + if !pieceCID.Equals(pieceCIDA) { + return sectorInfo{}, fmt.Errorf("expected piece CID %s, got %s", pieceCIDA, pieceCID) } - return seedEpoch, proveCommit -} + // Create a struct for the piece info + sector.pieces = []abi.PieceInfo{{ + Size: paddedPieceSize, + PieceCID: pieceCIDA, + }} -func (tm *TestUnmanagedMiner) SubmitProveCommit( - ctx context.Context, - proofType abi.RegisteredSealProof, - sectorNumber abi.SectorNumber, - seedEpoch abi.ChainEpoch, - proveCommit []byte, - pieceManifest []miner14.PieceActivationManifest, -) { + // Create a temporary file for the sealed sector + sealedSectorFile, err := mkTempFile(tm.t, bytes.NewReader([]byte{}), 0) + if err != nil { + return sectorInfo{}, err + } - req := require.New(tm.t) + defer func() { + _ = sealedSectorFile.Close() + }() - if proofType.IsNonInteractive() { - req.Nil(pieceManifest, "piece manifest should be nil for Non-interactive PoRep") - } + // Update paths for the sector + sector.sealedSectorPath = sealedSectorFile.Name() + sector.unsealedSectorPath = unsealedSectorFile.Name() + sector.cacheDirPath = filepath.Join(tm.cacheDir, fmt.Sprintf("%d", sector.sectorNumber)) - // Step 6: Submit the ProveCommit to the network - if proofType.IsNonInteractive() { - tm.t.Log("Submitting ProveCommitSector ...") + // Ensure the cache directory exists + if err = os.Mkdir(sector.cacheDirPath, 0755); err != nil { + return sectorInfo{}, err + } - var provingDeadline uint64 = 7 - if tm.IsImmutableDeadline(ctx, provingDeadline) { - // avoid immutable deadlines - provingDeadline = 5 - } + return sector, nil +} - actorIdNum, err := address.IDFromAddress(tm.ActorAddr) - req.NoError(err) - actorId := abi.ActorID(actorIdNum) +func (tm *TestUnmanagedMiner) makeAndSaveCCSector(sector sectorInfo) (sectorInfo, error) { + // Create cache directory + sector.cacheDirPath = filepath.Join(tm.cacheDir, fmt.Sprintf("%d", sector.sectorNumber)) + if err := os.Mkdir(sector.cacheDirPath, 0755); err != nil { + return sectorInfo{}, err + } + tm.log("Sector %d: created cache directory at %s", sector.sectorNumber, sector.cacheDirPath) - r, err := tm.SubmitMessage(ctx, &miner14.ProveCommitSectorsNIParams{ - Sectors: []miner14.SectorNIActivationInfo{{ - SealingNumber: sectorNumber, - SealerID: actorId, - SealedCID: tm.sealedCids[sectorNumber], - SectorNumber: sectorNumber, - SealRandEpoch: seedEpoch, - Expiration: 2880 * 300, - }}, - AggregateProof: proveCommit, - SealProofType: proofType, - AggregateProofType: abi.RegisteredAggregationProof_SnarkPackV2, - ProvingDeadline: provingDeadline, - RequireActivationSuccess: true, - }, 1, builtin.MethodsMiner.ProveCommitSectorsNI) - req.NoError(err) - req.True(r.Receipt.ExitCode.IsSuccess()) + // Define paths for unsealed and sealed sectors + sector.unsealedSectorPath = filepath.Join(tm.unsealedSectorDir, fmt.Sprintf("%d", sector.sectorNumber)) + sector.sealedSectorPath = filepath.Join(tm.sealedSectorDir, fmt.Sprintf("%d", sector.sectorNumber)) + unsealedSize := abi.PaddedPieceSize(tm.options.sectorSize).Unpadded() - // NI-PoRep lets us determine the deadline, so we can check that it's set correctly - sp, err := tm.FullNode.StateSectorPartition(ctx, tm.ActorAddr, sectorNumber, r.TipSet) - req.NoError(err) - req.Equal(provingDeadline, sp.Deadline) - } else { - tm.t.Log("Submitting ProveCommitSector ...") + // Write unsealed sector file + if err := os.WriteFile(sector.unsealedSectorPath, make([]byte, unsealedSize), 0644); err != nil { + return sectorInfo{}, err + } + tm.log("Sector %d: wrote unsealed CC sector to %s", sector.sectorNumber, sector.unsealedSectorPath) - r, err := tm.SubmitMessage(ctx, &miner14.ProveCommitSectors3Params{ - SectorActivations: []miner14.SectorActivationManifest{{SectorNumber: sectorNumber, Pieces: pieceManifest}}, - SectorProofs: [][]byte{proveCommit}, - RequireActivationSuccess: true, - }, 0, builtin.MethodsMiner.ProveCommitSectors3) - req.NoError(err) - req.True(r.Receipt.ExitCode.IsSuccess()) + // Write sealed sector file + if err := os.WriteFile(sector.sealedSectorPath, make([]byte, tm.options.sectorSize), 0644); err != nil { + return sectorInfo{}, err } + tm.log("Sector %d: wrote sealed CC sector to %s", sector.sectorNumber, sector.sealedSectorPath) + + return sector, nil } -func (tm *TestUnmanagedMiner) OnboardCCSector(ctx context.Context, proofType abi.RegisteredSealProof) (abi.SectorNumber, chan WindowPostResp, context.CancelFunc) { - sectorNumber := tm.NextSectorNumber() +func (tm *TestUnmanagedMiner) mkStagedFileWithPieces(pt abi.RegisteredSealProof) ([]abi.PieceInfo, string, error) { + paddedPieceSize := abi.PaddedPieceSize(tm.options.sectorSize) + unpaddedPieceSize := paddedPieceSize.Unpadded() - if !tm.mockProofs { - // Write empty bytes that we want to seal i.e. create our CC sector - tm.makeAndSaveCCSector(ctx, sectorNumber) + // Generate random bytes for the piece + randomBytes := make([]byte, unpaddedPieceSize) + if _, err := io.ReadFull(rand.Reader, randomBytes); err != nil { + return nil, "", err } - seedEpoch, proveCommit := tm.PrepareSectorForProveCommit(ctx, proofType, sectorNumber, []abi.PieceInfo{}) - - tm.SubmitProveCommit(ctx, proofType, sectorNumber, seedEpoch, proveCommit, nil) + // Create a temporary file for the first piece + pieceFileA, err := mkTempFile(tm.t, bytes.NewReader(randomBytes), uint64(unpaddedPieceSize)) + if err != nil { + return nil, "", err + } - tm.proofType[sectorNumber] = proofType - respCh, cancelFn := tm.wdPostLoop(ctx, sectorNumber, tm.sealedCids[sectorNumber], tm.sealedSectorPaths[sectorNumber], tm.cacheDirPaths[sectorNumber]) + // Generate the piece CID from the file + pieceCIDA, err := ffi.GeneratePieceCIDFromFile(pt, pieceFileA, unpaddedPieceSize) + if err != nil { + return nil, "", err + } - return sectorNumber, respCh, cancelFn -} + // Reset file offset to the beginning after CID generation + if _, err = pieceFileA.Seek(0, io.SeekStart); err != nil { + return nil, "", err + } -func (tm *TestUnmanagedMiner) OnboardSectorWithPieces(ctx context.Context, proofType abi.RegisteredSealProof) (abi.SectorNumber, chan WindowPostResp, context.CancelFunc) { - sectorNumber := tm.NextSectorNumber() + unsealedSectorFile, err := mkTempFile(tm.t, bytes.NewReader([]byte{}), 0) + if err != nil { + return nil, "", err + } + defer func() { + _ = unsealedSectorFile.Close() + }() - // Build a sector with non 0 Pieces that we want to onboard - var pieces []abi.PieceInfo - if !tm.mockProofs { - pieces = tm.mkAndSavePiecesToOnboard(ctx, sectorNumber, proofType) - } else { - pieces = []abi.PieceInfo{{ - Size: abi.PaddedPieceSize(tm.options.sectorSize), - PieceCID: cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha"), - }} + // Write the piece to the staged sector file without alignment + writtenBytes, pieceCID, err := ffi.WriteWithoutAlignment(pt, pieceFileA, unpaddedPieceSize, unsealedSectorFile) + if err != nil { + return nil, "", err + } + if unpaddedPieceSize != writtenBytes { + return nil, "", fmt.Errorf("expected to write %d bytes, wrote %d", unpaddedPieceSize, writtenBytes) + } + if !pieceCID.Equals(pieceCIDA) { + return nil, "", fmt.Errorf("expected piece CID %s, got %s", pieceCIDA, pieceCID) } - _, proveCommit := tm.PrepareSectorForProveCommit(ctx, proofType, sectorNumber, pieces) + // Create a struct for the piece info + publicPieces := []abi.PieceInfo{{ + Size: paddedPieceSize, + PieceCID: pieceCIDA, + }} - // Submit the ProveCommit to the network - tm.t.Log("Submitting ProveCommitSector ...") + return publicPieces, unsealedSectorFile.Name(), nil +} - var manifest []miner14.PieceActivationManifest - for _, piece := range pieces { - manifest = append(manifest, miner14.PieceActivationManifest{ - CID: piece.PieceCID, - Size: piece.Size, - }) - } +// waitForMutableDeadline will wait until we are not in the proving deadline for the given +// sector, or the deadline after the proving deadline. +// For safety, to avoid possible races with the window post loop, we will also avoid the +// deadline before the proving deadline. +func (tm *TestUnmanagedMiner) waitForMutableDeadline(sectorNum abi.SectorNumber) { + req := require.New(tm.t) - tm.SubmitProveCommit(ctx, proofType, sectorNumber, 0, proveCommit, manifest) + ts, err := tm.FullNode.ChainHead(tm.ctx) + req.NoError(err) - tm.proofType[sectorNumber] = proofType - respCh, cancelFn := tm.wdPostLoop(ctx, sectorNumber, tm.sealedCids[sectorNumber], tm.sealedSectorPaths[sectorNumber], tm.cacheDirPaths[sectorNumber]) + sl, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNum, ts.Key()) + req.NoError(err) - return sectorNumber, respCh, cancelFn + dlinfo, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, ts.Key()) + req.NoError(err) + + sectorDeadlineCurrent := sl.Deadline == dlinfo.Index // we are in the proving deadline + sectorDeadlineNext := (dlinfo.Index+1)%dlinfo.WPoStPeriodDeadlines == sl.Deadline // we are in the deadline after the proving deadline + sectorDeadlinePrev := (dlinfo.Index-1+dlinfo.WPoStPeriodDeadlines)%dlinfo.WPoStPeriodDeadlines == sl.Deadline // we are in the deadline before the proving deadline + + if sectorDeadlineCurrent || sectorDeadlineNext || sectorDeadlinePrev { + // We are in a sensitive, or immutable deadline, we need to wait + targetEpoch := dlinfo.NextOpen() // end of current deadline + if sectorDeadlineCurrent { + // we are in the proving deadline, wait until the end of the next one + targetEpoch += dlinfo.WPoStChallengeWindow + } else if sectorDeadlinePrev { + // we are in the deadline before the proving deadline, wait an additional window + targetEpoch += dlinfo.WPoStChallengeWindow * 2 + } + _, err := tm.FullNode.WaitTillChainOrError(tm.ctx, HeightAtLeast(targetEpoch+5)) + req.NoError(err) + } } -// calculateNextPostEpoch calculates the first epoch of the deadline proving window -// that is desired for the given sector for the specified miner. -// This function returns the current epoch and the calculated proving epoch. -func (tm *TestUnmanagedMiner) calculateNextPostEpoch( - ctx context.Context, - sectorNumber abi.SectorNumber, -) (abi.ChainEpoch, abi.ChainEpoch, error) { - // Retrieve the current blockchain head - head, err := tm.FullNode.ChainHead(ctx) - if err != nil { - return 0, 0, fmt.Errorf("failed to get chain head: %w", err) +func (tm *TestUnmanagedMiner) preCommitSectors( + sealRandEpoch abi.ChainEpoch, + proofType abi.RegisteredSealProof, + sector sectorInfo, +) error { + + if proofType.IsNonInteractive() { + return nil } - // Obtain the proving deadline information for the miner - di, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, head.Key()) + // Submit the PreCommit to the network + if sector.proofType != proofType { + return fmt.Errorf("sector proof type does not match PreCommit proof type") + } + sealedCid := sector.sealedCid + var uc *cid.Cid + if len(sector.pieces) > 0 { + unsealedCid := sector.unsealedCid + uc = &unsealedCid + } + spci := []miner14.SectorPreCommitInfo{{ + Expiration: 2880 * 300, + SectorNumber: sector.sectorNumber, + SealProof: proofType, + SealedCID: sealedCid, + SealRandEpoch: sealRandEpoch, + UnsealedCid: uc, + }} + r, err := tm.SubmitMessage(&miner14.PreCommitSectorBatchParams2{Sectors: spci}, 1, builtin.MethodsMiner.PreCommitSectorBatch2) if err != nil { - return 0, 0, fmt.Errorf("failed to get proving deadline: %w", err) + return err + } + tm.log("PreCommitSectorBatch2 submitted at epoch %d: %+v", r.Height, spci[0]) + if !r.Receipt.ExitCode.IsSuccess() { + return fmt.Errorf("PreCommit failed with exit code: %s", r.Receipt.ExitCode) } - tm.t.Logf("Miner %s: WindowPoST(%d): ProvingDeadline: %+v", tm.ActorAddr, sectorNumber, di) + return nil +} + +func (tm *TestUnmanagedMiner) submitProveCommit( + proofType abi.RegisteredSealProof, + sectors []sectorInfo, + requireActivationSuccess bool, + modifyNIActivationsBeforeSubmit func([]miner14.SectorNIActivationInfo) []miner14.SectorNIActivationInfo, +) []exitcode.ExitCode { + + req := require.New(tm.t) + + sectorProofs := make([][]byte, len(sectors)) + for i, sector := range sectors { + sectorProofs[i] = sector.sectorProof + } + + var msgReturn *api.MsgLookup + var provingDeadline uint64 = 7 // for niporep + + // Step 6: Submit the ProveCommit to the network + if proofType.IsNonInteractive() { + if tm.IsImmutableDeadline(provingDeadline) { + // avoid immutable deadlines + provingDeadline = 5 + } + + actorIdNum, err := address.IDFromAddress(tm.ActorAddr) + req.NoError(err) + actorId := abi.ActorID(actorIdNum) + + infos := make([]proof.AggregateSealVerifyInfo, len(sectors)) + activations := make([]miner14.SectorNIActivationInfo, len(sectors)) + for i, sector := range sectors { + req.Nil(sector.pieces, "pieces should be nil for Non-interactive PoRep") + + infos[i] = proof.AggregateSealVerifyInfo{ + Number: sector.sectorNumber, + Randomness: sector.sealTickets, + InteractiveRandomness: niPorepInteractiveRandomness, + SealedCID: sector.sealedCid, + UnsealedCID: sector.unsealedCid, + } + + activations[i] = miner14.SectorNIActivationInfo{ + SealingNumber: sector.sectorNumber, + SealerID: actorId, + SealedCID: sector.sealedCid, + SectorNumber: sector.sectorNumber, + SealRandEpoch: sector.sealRandomnessEpoch, + Expiration: 2880 * 300, + } + } + + var sectorProof []byte + if tm.mockProofs { + sectorProof = []byte{0xde, 0xad, 0xbe, 0xef} + } else { + asvpai := proof.AggregateSealVerifyProofAndInfos{ + Miner: actorId, + SealProof: proofType, + AggregateProof: abi.RegisteredAggregationProof_SnarkPackV2, + Infos: infos, + } + tm.log("Aggregating circuit proofs: %+v", asvpai) + sectorProof, err = ffi.AggregateSealProofs(asvpai, sectorProofs) + req.NoError(err) + + asvpai.Proof = sectorProof + + verified, err := ffi.VerifyAggregateSeals(asvpai) + req.NoError(err) + req.True(verified, "failed to verify aggregated circuit proof") + } - // Fetch the sector partition for the given sector number - sp, err := tm.FullNode.StateSectorPartition(ctx, tm.ActorAddr, sectorNumber, head.Key()) - if err != nil { - return 0, 0, fmt.Errorf("failed to get sector partition: %w", err) - } + if modifyNIActivationsBeforeSubmit != nil { + activations = modifyNIActivationsBeforeSubmit(activations) + } - tm.t.Logf("Miner %s: WindowPoST(%d): SectorPartition: %+v", tm.ActorAddr, sectorNumber, sp) + tm.log("Submitting ProveCommitSectorsNI ...") + msgReturn, err = tm.SubmitMessage(&miner14.ProveCommitSectorsNIParams{ + Sectors: activations, + AggregateProof: sectorProof, + SealProofType: proofType, + AggregateProofType: abi.RegisteredAggregationProof_SnarkPackV2, + ProvingDeadline: provingDeadline, + RequireActivationSuccess: requireActivationSuccess, + }, 1, builtin.MethodsMiner.ProveCommitSectorsNI) + req.NoError(err) + req.True(msgReturn.Receipt.ExitCode.IsSuccess()) + } else { + // else standard porep activations := make([]miner14.SectorActivationManifest, len(sectors)) + activations := make([]miner14.SectorActivationManifest, len(sectors)) + for i, sector := range sectors { + activations[i] = miner14.SectorActivationManifest{SectorNumber: sector.sectorNumber} + if len(sector.pieces) > 0 { + activations[i].Pieces = make([]miner14.PieceActivationManifest, len(sector.pieces)) + for j, piece := range sector.pieces { + activations[i].Pieces[j] = miner14.PieceActivationManifest{ + CID: piece.PieceCID, + Size: piece.Size, + } + } + } + } - // Calculate the start of the period, adjusting if the current deadline has passed - periodStart := di.PeriodStart - // calculate current deadline index because it won't be reliable from state until the first - // challenge window cron tick after first sector onboarded - currentDeadlineIdx := uint64(math.Abs(float64((di.CurrentEpoch - di.PeriodStart) / di.WPoStChallengeWindow))) - if di.PeriodStart < di.CurrentEpoch && sp.Deadline <= currentDeadlineIdx { - // If the deadline has passed in the current proving period, calculate for the next period - // Note that di.Open may be > di.CurrentEpoch if the miner has just been enrolled in cron so - // their deadlines haven't started rolling yet - periodStart += di.WPoStProvingPeriod + tm.log("Submitting ProveCommitSectors3 with activations: %+v", activations) + var err error + msgReturn, err = tm.SubmitMessage(&miner14.ProveCommitSectors3Params{ + SectorActivations: activations, + SectorProofs: sectorProofs, + RequireActivationSuccess: requireActivationSuccess, + }, 0, builtin.MethodsMiner.ProveCommitSectors3) + req.NoError(err) + req.True(msgReturn.Receipt.ExitCode.IsSuccess()) } - // Calculate the exact epoch when proving should occur - provingEpoch := periodStart + di.WPoStChallengeWindow*abi.ChainEpoch(sp.Deadline) - - tm.t.Logf("Miner %s: WindowPoST(%d): next ProvingEpoch: %d", tm.ActorAddr, sectorNumber, provingEpoch) + var returnValue miner14.BatchReturn + req.NoError(returnValue.UnmarshalCBOR(bytes.NewReader(msgReturn.Receipt.Return))) + exitCodes := exitCodesFromBatchReturn(returnValue) + + for i, sector := range sectors { + si, err := tm.FullNode.StateSectorGetInfo(tm.ctx, tm.ActorAddr, sector.sectorNumber, msgReturn.TipSet) + tm.log("SectorOnChainInfo for sector %d w/ exit code %s: %+v", sector.sectorNumber, exitCodes[i], si) + if exitCodes[i].IsSuccess() { + req.NoError(err) + req.Equal(si.SectorNumber, sector.sectorNumber) + // To check the activation epoch, we use Parents() rather than Height-1 to account for null rounds + ts, err := tm.FullNode.ChainGetTipSet(tm.ctx, msgReturn.TipSet) + req.NoError(err) + parent, err := tm.FullNode.ChainGetTipSet(tm.ctx, ts.Parents()) + req.NoError(err) + req.Equal(si.Activation, parent.Height()) + } else { + req.Nil(si, "sector should not be on chain") + } + if proofType.IsNonInteractive() { + // NI-PoRep lets us determine the deadline, so we can check that it's set correctly + sp, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sector.sectorNumber, msgReturn.TipSet) + if exitCodes[i].IsSuccess() { + req.NoError(err) + req.Equal(provingDeadline, sp.Deadline) + } else { + req.ErrorContains(err, fmt.Sprintf("sector %d not due at any deadline", sector.sectorNumber)) + } + } + } - return di.CurrentEpoch, provingEpoch, nil + return exitCodes } -func (tm *TestUnmanagedMiner) wdPostLoop( - pctx context.Context, - sectorNumber abi.SectorNumber, - sealedCid cid.Cid, - sealedPath, - cacheDir string, -) (chan WindowPostResp, context.CancelFunc) { - - ctx, cancelFn := context.WithCancel(pctx) - respCh := make(chan WindowPostResp, 1) +func (tm *TestUnmanagedMiner) wdPostLoop() { + if tm.runningWdPostLoop { + return + } + tm.runningWdPostLoop = true - head, err := tm.FullNode.ChainHead(ctx) + head, err := tm.FullNode.ChainHead(tm.ctx) require.NoError(tm.t, err) // wait one challenge window for cron to do its thing with deadlines, just to be sure so we get // an accurate dline.Info whenever we ask for it - _ = tm.FullNode.WaitTillChain(ctx, HeightAtLeast(head.Height()+miner14.WPoStChallengeWindow+5)) + _ = tm.FullNode.WaitTillChain(tm.ctx, HeightAtLeast(head.Height()+miner14.WPoStChallengeWindow+5)) go func() { - var firstPost bool + var postCount int - writeRespF := func(respErr error) { - var send WindowPostResp - if respErr == nil { - if firstPost { - return // already reported on our first post, no error to report, don't send anything - } - send.Posted = true - firstPost = true + recordPostOrError := func(post windowPost) { + head, err := tm.FullNode.ChainHead(tm.ctx) + if err != nil { + tm.log("WindowPoSt submission failed to get chain head: %s", err) } else { - if ctx.Err() == nil { - tm.t.Logf("Sector %d: WindowPoSt submission failed: %s", sectorNumber, respErr) - } - send.Error = respErr + post.Epoch = head.Height() + } + if post.Error != nil && tm.ctx.Err() == nil { + tm.log("WindowPoSt submission failed for sectors %v at epoch %d: %s", post.Posted, post.Epoch, post.Error) + } else if tm.ctx.Err() == nil { + postCount++ + tm.log("WindowPoSt loop completed post %d at epoch %d for sectors %v", postCount, post.Epoch, post.Posted) } - select { - case respCh <- send: - case <-ctx.Done(): - default: + if tm.ctx.Err() == nil { + tm.postsLk.Lock() + tm.posts = append(tm.posts, post) + tm.postsLk.Unlock() } } - var postCount int - for ctx.Err() == nil { - currentEpoch, nextPost, err := tm.calculateNextPostEpoch(ctx, sectorNumber) - tm.t.Logf("Activating sector %d, next post %d, current epoch %d", sectorNumber, nextPost, currentEpoch) + for tm.ctx.Err() == nil { + postSectors, err := tm.sectorsToPost() if err != nil { - writeRespF(err) + recordPostOrError(windowPost{Error: err}) return } - - nextPost += 5 // add some padding so we're properly into the window - - if nextPost > currentEpoch { - if _, err := tm.FullNode.WaitTillChainOrError(ctx, HeightAtLeast(nextPost)); err != nil { - writeRespF(err) + tm.log("WindowPoST sectors to post in this challenge window: %v", postSectors) + if len(postSectors) > 0 { + // something to post now + if err = tm.submitWindowPost(postSectors); err != nil { + recordPostOrError(windowPost{Error: err}) return } + recordPostOrError(windowPost{Posted: postSectors}) } - err = tm.submitWindowPost(ctx, sectorNumber, sealedCid, sealedPath, cacheDir) - writeRespF(err) // send an error, or first post, or nothing if no error and this isn't the first post - if err != nil { + // skip to next challenge window + if err := tm.waitForNextPostDeadline(); err != nil { + recordPostOrError(windowPost{Error: err}) return } - postCount++ - tm.t.Logf("Sector %d: WindowPoSt #%d submitted", sectorNumber, postCount) } }() +} + +// waitForNextPostDeadline waits until we are within the next challenge window for this miner +func (tm *TestUnmanagedMiner) waitForNextPostDeadline() error { + ctx, cancel := context.WithCancel(tm.ctx) + defer cancel() + + di, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, types.EmptyTSK) + if err != nil { + return fmt.Errorf("waitForNextPostDeadline: failed to get proving deadline: %w", err) + } + currentDeadlineIdx := CurrentDeadlineIndex(di) + nextDeadlineEpoch := di.PeriodStart + di.WPoStChallengeWindow*abi.ChainEpoch(currentDeadlineIdx+1) + + tm.log("Window PoST waiting until next challenge window, currentDeadlineIdx: %d, nextDeadlineEpoch: %d", currentDeadlineIdx, nextDeadlineEpoch) + + heads, err := tm.FullNode.ChainNotify(ctx) + if err != nil { + return err + } + + for chg := range heads { + for _, c := range chg { + if c.Type != "apply" { + continue + } + if ts := c.Val; ts.Height() >= nextDeadlineEpoch+5 { // add some buffer + return nil + } + } + } + + return fmt.Errorf("waitForNextPostDeadline: failed to wait for nextDeadlineEpoch %d", nextDeadlineEpoch) +} + +// sectorsToPost returns the sectors that are due to be posted in the current challenge window +func (tm *TestUnmanagedMiner) sectorsToPost() ([]abi.SectorNumber, error) { + di, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, types.EmptyTSK) + if err != nil { + return nil, fmt.Errorf("failed to get proving deadline: %w", err) + } + + currentDeadlineIdx := CurrentDeadlineIndex(di) + + var allSectors []abi.SectorNumber + var sectorsToPost []abi.SectorNumber + + tm.committedSectorsLk.Lock() + for _, sector := range tm.committedSectors { + allSectors = append(allSectors, sector.sectorNumber) + } + tm.committedSectorsLk.Unlock() + + for _, sectorNumber := range allSectors { + sp, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNumber, types.EmptyTSK) + if err != nil { + return nil, fmt.Errorf("failed to get sector partition: %w", err) + } + if sp.Deadline == currentDeadlineIdx { + sectorsToPost = append(sectorsToPost, sectorNumber) + } + } - return respCh, cancelFn + return sectorsToPost, nil } -func (tm *TestUnmanagedMiner) SubmitPostDispute(ctx context.Context, sectorNumber abi.SectorNumber) error { - tm.t.Logf("Miner %s: Starting dispute submission for sector %d", tm.ActorAddr, sectorNumber) +func (tm *TestUnmanagedMiner) submitPostDispute(sectorNumber abi.SectorNumber) error { + tm.log("Starting dispute submission for sector %d", sectorNumber) - head, err := tm.FullNode.ChainHead(ctx) + head, err := tm.FullNode.ChainHead(tm.ctx) if err != nil { return fmt.Errorf("MinerB(%s): failed to get chain head: %w", tm.ActorAddr, err) } - sp, err := tm.FullNode.StateSectorPartition(ctx, tm.ActorAddr, sectorNumber, head.Key()) + sp, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNumber, head.Key()) if err != nil { return fmt.Errorf("MinerB(%s): failed to get sector partition for sector %d: %w", tm.ActorAddr, sectorNumber, err) } - di, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, head.Key()) + di, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, head.Key()) if err != nil { return fmt.Errorf("MinerB(%s): failed to get proving deadline for sector %d: %w", tm.ActorAddr, sectorNumber, err) } disputeEpoch := di.Close + 5 - tm.t.Logf("Miner %s: Sector %d - Waiting %d epochs until epoch %d to submit dispute", tm.ActorAddr, sectorNumber, disputeEpoch-head.Height(), disputeEpoch) + tm.log("Sector %d - Waiting %d epochs until epoch %d to submit dispute", sectorNumber, disputeEpoch-head.Height(), disputeEpoch) - tm.FullNode.WaitTillChain(ctx, HeightAtLeast(disputeEpoch)) + tm.FullNode.WaitTillChain(tm.ctx, HeightAtLeast(disputeEpoch)) - tm.t.Logf("Miner %s: Sector %d - Disputing WindowedPoSt to confirm validity at epoch %d", tm.ActorAddr, sectorNumber, disputeEpoch) + tm.log("Sector %d - Disputing WindowedPoSt to confirm validity at epoch %d", sectorNumber, disputeEpoch) - _, err = tm.SubmitMessage(ctx, &miner14.DisputeWindowedPoStParams{ + _, err = tm.SubmitMessage(&miner14.DisputeWindowedPoStParams{ Deadline: sp.Deadline, PoStIndex: 0, }, 1, builtin.MethodsMiner.DisputeWindowedPoSt) return err } -func (tm *TestUnmanagedMiner) submitWindowPost(ctx context.Context, sectorNumber abi.SectorNumber, sealedCid cid.Cid, sealedPath, cacheDir string) error { - tm.t.Logf("Miner(%s): WindowPoST(%d): Running WindowPoSt ...\n", tm.ActorAddr, sectorNumber) +func (tm *TestUnmanagedMiner) submitWindowPost(sectorNumbers []abi.SectorNumber) error { + if len(sectorNumbers) == 0 { + return fmt.Errorf("no sectors to submit window post for") + } + + // We are limited to PoSting PoStedPartitionsMax (3) partitions at a time, so we need to group the + // sectors by partition and submit the PoSts in batches of PoStedPartitionsMax. - head, err := tm.FullNode.ChainHead(ctx) + partitionMap := make(map[uint64][]sectorInfo) + + head, err := tm.FullNode.ChainHead(tm.ctx) if err != nil { return fmt.Errorf("Miner(%s): failed to get chain head: %w", tm.ActorAddr, err) } - sp, err := tm.FullNode.StateSectorPartition(ctx, tm.ActorAddr, sectorNumber, head.Key()) + di, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, head.Key()) if err != nil { - return fmt.Errorf("Miner(%s): failed to get sector partition for sector %d: %w", tm.ActorAddr, sectorNumber, err) + return fmt.Errorf("Miner(%s): failed to get proving deadline: %w", tm.ActorAddr, err) } + chainRandomnessEpoch := di.Challenge - di, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, head.Key()) - if err != nil { - return fmt.Errorf("Miner(%s): failed to get proving deadline for sector %d: %w", tm.ActorAddr, sectorNumber, err) - } - tm.t.Logf("Miner(%s): WindowPoST(%d): SectorPartition: %+v, ProvingDeadline: %+v\n", tm.ActorAddr, sectorNumber, sp, di) - if di.Index != sp.Deadline { - return fmt.Errorf("Miner(%s): sector %d is not in the deadline %d, but %d", tm.ActorAddr, sectorNumber, sp.Deadline, di.Index) - } + for _, sectorNumber := range sectorNumbers { + sector, err := tm.getCommittedSector(sectorNumber) + if err != nil { + return fmt.Errorf("Miner(%s): failed to get committed sector %d: %w", tm.ActorAddr, sectorNumber, err) + } - var proofBytes []byte - if tm.mockProofs { - proofBytes = []byte{0xde, 0xad, 0xbe, 0xef} - } else { - proofBytes, err = tm.generateWindowPost(ctx, sectorNumber, sealedCid, sealedPath, cacheDir) + sp, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNumber, head.Key()) if err != nil { - return fmt.Errorf("Miner(%s): failed to generate window post for sector %d: %w", tm.ActorAddr, sectorNumber, err) + return fmt.Errorf("Miner(%s): failed to get sector partition for sector %d: %w", tm.ActorAddr, sectorNumber, err) } - } - tm.t.Logf("Miner(%s): WindowedPoSt(%d) Submitting ...\n", tm.ActorAddr, sectorNumber) + if di.Index != sp.Deadline { + return fmt.Errorf("Miner(%s): sector %d is not in the expected deadline %d, but %d", tm.ActorAddr, sectorNumber, sp.Deadline, di.Index) + } - chainRandomnessEpoch := di.Challenge - chainRandomness, err := tm.FullNode.StateGetRandomnessFromTickets(ctx, crypto.DomainSeparationTag_PoStChainCommit, chainRandomnessEpoch, + if _, ok := partitionMap[sp.Partition]; !ok { + partitionMap[sp.Partition] = make([]sectorInfo, 0) + } + partitionMap[sp.Partition] = append(partitionMap[sp.Partition], sector) + } + + chainRandomness, err := tm.FullNode.StateGetRandomnessFromTickets(tm.ctx, crypto.DomainSeparationTag_PoStChainCommit, chainRandomnessEpoch, nil, head.Key()) if err != nil { - return fmt.Errorf("Miner(%s): failed to get chain randomness for sector %d: %w", tm.ActorAddr, sectorNumber, err) + return fmt.Errorf("Miner(%s): failed to get chain randomness for deadline %d: %w", tm.ActorAddr, di.Index, err) } - minerInfo, err := tm.FullNode.StateMinerInfo(ctx, tm.ActorAddr, head.Key()) + minerInfo, err := tm.FullNode.StateMinerInfo(tm.ctx, tm.ActorAddr, head.Key()) if err != nil { - return fmt.Errorf("Miner(%s): failed to get miner info for sector %d: %w", tm.ActorAddr, sectorNumber, err) + return fmt.Errorf("Miner(%s): failed to get miner info: %w", tm.ActorAddr, err) } - r, err := tm.SubmitMessage(ctx, &miner14.SubmitWindowedPoStParams{ - ChainCommitEpoch: chainRandomnessEpoch, - ChainCommitRand: chainRandomness, - Deadline: sp.Deadline, - Partitions: []miner14.PoStPartition{{Index: sp.Partition}}, - Proofs: []proof.PoStProof{{PoStProof: minerInfo.WindowPoStProofType, ProofBytes: proofBytes}}, - }, 0, builtin.MethodsMiner.SubmitWindowedPoSt) - if err != nil { - return fmt.Errorf("Miner(%s): failed to submit window post for sector %d: %w", tm.ActorAddr, sectorNumber, err) + postMessages := make([]cid.Cid, 0) + + submit := func(partitions []uint64, sectors []sectorInfo) error { + var proofBytes []byte + if tm.mockProofs { + proofBytes = []byte{0xde, 0xad, 0xbe, 0xef} + } else { + proofBytes, err = tm.generateWindowPost(sectors) + if err != nil { + return fmt.Errorf("Miner(%s): failed to generate window post for deadline %d, partitions %v: %w", tm.ActorAddr, di.Index, partitions, err) + } + } + + tm.log("WindowPoST submitting %d sectors for deadline %d, partitions %v", len(sectors), di.Index, partitions) + + pp := make([]miner14.PoStPartition, len(partitions)) + for i, p := range partitions { + pp[i] = miner14.PoStPartition{Index: p} + } + + // Push all our post messages to the mpool and wait for them later. The blockminer might have + // ceased mining while it waits to see our posts in the mpool and if we wait for the first + // message to land but it's waiting for a later sector then we'll deadlock. + mCid, err := tm.mpoolPushMessage(&miner14.SubmitWindowedPoStParams{ + ChainCommitEpoch: chainRandomnessEpoch, + ChainCommitRand: chainRandomness, + Deadline: di.Index, + Partitions: pp, + Proofs: []proof.PoStProof{{PoStProof: minerInfo.WindowPoStProofType, ProofBytes: proofBytes}}, // can only have 1 + }, 0, builtin.MethodsMiner.SubmitWindowedPoSt) + if err != nil { + return fmt.Errorf("Miner(%s): failed to submit PoSt for deadline %d, partitions %v: %w", tm.ActorAddr, di.Index, partitions, err) + } + + postMessages = append(postMessages, mCid) + + return nil } - if !r.Receipt.ExitCode.IsSuccess() { - return fmt.Errorf("Miner(%s): submitting PoSt for sector %d failed: %s", tm.ActorAddr, sectorNumber, r.Receipt.ExitCode) + toSubmitPartitions := make([]uint64, 0) + toSubmitSectors := make([]sectorInfo, 0) + for partition, sectors := range partitionMap { + if len(sectors) == 0 { + continue + } + toSubmitPartitions = append(toSubmitPartitions, partition) + toSubmitSectors = append(toSubmitSectors, sectors...) + if len(toSubmitPartitions) == miner14.PoStedPartitionsMax { + if err := submit(toSubmitPartitions, toSubmitSectors); err != nil { + return err + } + toSubmitPartitions = make([]uint64, 0) + toSubmitSectors = make([]sectorInfo, 0) + } + } + if len(toSubmitPartitions) > 0 { + if err := submit(toSubmitPartitions, toSubmitSectors); err != nil { + return err + } + } + + tm.log("%d WindowPoST messages submitted for %d sectors, waiting for them to land on chain ...", len(postMessages), len(sectorNumbers)) + for _, mCid := range postMessages { + r, err := tm.waitMessage(mCid) + if err != nil { + return fmt.Errorf("Miner(%s): failed to wait for PoSt message %s: %w", tm.ActorAddr, mCid, err) + } + if !r.Receipt.ExitCode.IsSuccess() { + return fmt.Errorf("Miner(%s): PoSt submission failed for deadline %d: %s", tm.ActorAddr, di.Index, r.Receipt.ExitCode) + } } - tm.t.Logf("Miner(%s): WindowedPoSt(%d) Submitted ...\n", tm.ActorAddr, sectorNumber) + tm.log("WindowPoST(%v) submitted for deadline %d", sectorNumbers, di.Index) return nil } -func (tm *TestUnmanagedMiner) generateWindowPost( - ctx context.Context, - sectorNumber abi.SectorNumber, - sealedCid cid.Cid, - sealedPath string, - cacheDir string, -) ([]byte, error) { - head, err := tm.FullNode.ChainHead(ctx) +func (tm *TestUnmanagedMiner) generateWindowPost(sectorInfos []sectorInfo) ([]byte, error) { + head, err := tm.FullNode.ChainHead(tm.ctx) if err != nil { return nil, fmt.Errorf("failed to get chain head: %w", err) } - minerInfo, err := tm.FullNode.StateMinerInfo(ctx, tm.ActorAddr, head.Key()) + minerInfo, err := tm.FullNode.StateMinerInfo(tm.ctx, tm.ActorAddr, head.Key()) if err != nil { return nil, fmt.Errorf("failed to get miner info: %w", err) } - di, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, types.EmptyTSK) + di, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, types.EmptyTSK) if err != nil { return nil, fmt.Errorf("failed to get proving deadline: %w", err) } @@ -799,22 +1128,31 @@ func (tm *TestUnmanagedMiner) generateWindowPost( return nil, fmt.Errorf("failed to marshal miner address: %w", err) } - rand, err := tm.FullNode.StateGetRandomnessFromBeacon(ctx, crypto.DomainSeparationTag_WindowedPoStChallengeSeed, di.Challenge, minerAddrBytes.Bytes(), head.Key()) + rand, err := tm.FullNode.StateGetRandomnessFromBeacon(tm.ctx, crypto.DomainSeparationTag_WindowedPoStChallengeSeed, di.Challenge, minerAddrBytes.Bytes(), head.Key()) if err != nil { return nil, fmt.Errorf("failed to get randomness: %w", err) } postRand := abi.PoStRandomness(rand) postRand[31] &= 0x3f // make fr32 compatible - privateSectorInfo := ffi.PrivateSectorInfo{ - SectorInfo: proof.SectorInfo{ - SealProof: tm.proofType[sectorNumber], - SectorNumber: sectorNumber, - SealedCID: sealedCid, - }, - CacheDirPath: cacheDir, - PoStProofType: minerInfo.WindowPoStProofType, - SealedSectorPath: sealedPath, + privateSectorInfo := make([]ffi.PrivateSectorInfo, len(sectorInfos)) + proofSectorInfo := make([]proof.SectorInfo, len(sectorInfos)) + for i, sector := range sectorInfos { + privateSectorInfo[i] = ffi.PrivateSectorInfo{ + SectorInfo: proof.SectorInfo{ + SealProof: sector.proofType, + SectorNumber: sector.sectorNumber, + SealedCID: sector.sealedCid, + }, + CacheDirPath: sector.cacheDirPath, + PoStProofType: minerInfo.WindowPoStProofType, + SealedSectorPath: sector.sealedSectorPath, + } + proofSectorInfo[i] = proof.SectorInfo{ + SealProof: sector.proofType, + SectorNumber: sector.sectorNumber, + SealedCID: sector.sealedCid, + } } actorIdNum, err := address.IDFromAddress(tm.ActorAddr) @@ -823,7 +1161,7 @@ func (tm *TestUnmanagedMiner) generateWindowPost( } actorId := abi.ActorID(actorIdNum) - windowProofs, faultySectors, err := ffi.GenerateWindowPoSt(actorId, ffi.NewSortedPrivateSectorInfo(privateSectorInfo), postRand) + windowProofs, faultySectors, err := ffi.GenerateWindowPoSt(actorId, ffi.NewSortedPrivateSectorInfo(privateSectorInfo...), postRand) if err != nil { return nil, fmt.Errorf("failed to generate window post: %w", err) } @@ -841,7 +1179,7 @@ func (tm *TestUnmanagedMiner) generateWindowPost( info := proof.WindowPoStVerifyInfo{ Randomness: postRand, Proofs: []proof.PoStProof{{PoStProof: minerInfo.WindowPoStProofType, ProofBytes: proofBytes}}, - ChallengedSectors: []proof.SectorInfo{{SealProof: tm.proofType[sectorNumber], SectorNumber: sectorNumber, SealedCID: sealedCid}}, + ChallengedSectors: proofSectorInfo, Prover: actorId, } @@ -855,208 +1193,239 @@ func (tm *TestUnmanagedMiner) generateWindowPost( return proofBytes, nil } -func (tm *TestUnmanagedMiner) waitPreCommitSealRandomness(ctx context.Context, sectorNumber abi.SectorNumber, proofType abi.RegisteredSealProof) abi.ChainEpoch { + +func (tm *TestUnmanagedMiner) waitPreCommitSealRandomness(proofType abi.RegisteredSealProof) (abi.ChainEpoch, error) { // We want to draw seal randomness from a tipset that has already achieved finality as PreCommits are expensive to re-generate. // Check if we already have an epoch that is already final and wait for such an epoch if we don't have one. - head, err := tm.FullNode.ChainHead(ctx) - require.NoError(tm.t, err) + head, err := tm.FullNode.ChainHead(tm.ctx) + if err != nil { + return 0, err + } + + sealLookback := policy.SealRandomnessLookback if proofType.IsNonInteractive() { - return head.Height() - 1 // no need to wait + // For NI-PoRep there isn't a strict wait, but we should wait enough epochs to be sure to avoid reorgs + sealLookback = 150 } var sealRandEpoch abi.ChainEpoch - if head.Height() > policy.SealRandomnessLookback { - sealRandEpoch = head.Height() - policy.SealRandomnessLookback + if head.Height() > sealLookback { + sealRandEpoch = head.Height() - sealLookback } else { - sealRandEpoch = policy.SealRandomnessLookback - tm.t.Logf("Miner %s waiting for at least epoch %d for seal randomness for sector %d (current epoch %d)...", tm.ActorAddr, sealRandEpoch+5, - sectorNumber, head.Height()) - tm.FullNode.WaitTillChain(ctx, HeightAtLeast(sealRandEpoch+5)) + sealRandEpoch = sealLookback + tm.log("Waiting for at least epoch %d for seal randomness (current epoch %d)...", sealRandEpoch+5, head.Height()) + head = tm.FullNode.WaitTillChain(tm.ctx, HeightAtLeast(sealRandEpoch+5)) } - tm.t.Logf("Miner %s using seal randomness from epoch %d for head %d for sector %d", tm.ActorAddr, sealRandEpoch, head.Height(), sectorNumber) + tm.log("Using seal randomness from epoch %d (now at head %d)", sealRandEpoch, head.Height()) - return sealRandEpoch + return sealRandEpoch, nil } -func (tm *TestUnmanagedMiner) generatePreCommit( - ctx context.Context, - sectorNumber abi.SectorNumber, - sealRandEpoch abi.ChainEpoch, - proofType abi.RegisteredSealProof, - pieceInfo []abi.PieceInfo, -) { - +// generatePreCommit is goroutine safe, only using assertions, no FailNow or other panic inducing methods. +func (tm *TestUnmanagedMiner) generatePreCommit(sector sectorInfo, sealRandEpoch abi.ChainEpoch) (sectorInfo, error) { if tm.mockProofs { - tm.sealedCids[sectorNumber] = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkiekz") - if len(pieceInfo) > 0 { - tm.unsealedCids[sectorNumber] = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") + sector.sealedCid = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkiekz") + if len(sector.pieces) > 0 { + sector.unsealedCid = fixedPieceCid } - return + return sector, nil } - req := require.New(tm.t) - tm.t.Logf("Miner %s: Generating proof type %d PreCommit for sector %d...", tm.ActorAddr, proofType, sectorNumber) + tm.log("Generating proof type %d PreCommit for sector %d...", sector.proofType, sector.sectorNumber) - head, err := tm.FullNode.ChainHead(ctx) - req.NoError(err, "Miner %s: Failed to get chain head for sector %d", tm.ActorAddr, sectorNumber) + head, err := tm.FullNode.ChainHead(tm.ctx) + if err != nil { + return sectorInfo{}, fmt.Errorf("failed to get chain head for sector %d: %w", sector.sectorNumber, err) + } minerAddrBytes := new(bytes.Buffer) - req.NoError(tm.ActorAddr.MarshalCBOR(minerAddrBytes), "Miner %s: Failed to marshal address for sector %d", tm.ActorAddr, sectorNumber) + if err := tm.ActorAddr.MarshalCBOR(minerAddrBytes); err != nil { + return sectorInfo{}, fmt.Errorf("failed to marshal address for sector %d: %w", sector.sectorNumber, err) + } - rand, err := tm.FullNode.StateGetRandomnessFromTickets(ctx, crypto.DomainSeparationTag_SealRandomness, sealRandEpoch, minerAddrBytes.Bytes(), head.Key()) - req.NoError(err, "Miner %s: Failed to get randomness for sector %d", tm.ActorAddr, sectorNumber) + rand, err := tm.FullNode.StateGetRandomnessFromTickets(tm.ctx, crypto.DomainSeparationTag_SealRandomness, sealRandEpoch, minerAddrBytes.Bytes(), head.Key()) + if err != nil { + return sectorInfo{}, fmt.Errorf("failed to get randomness for sector %d: %w", sector.sectorNumber, err) + } sealTickets := abi.SealRandomness(rand) - tm.t.Logf("Miner %s: Running proof type %d SealPreCommitPhase1 for sector %d...", tm.ActorAddr, proofType, sectorNumber) + tm.log("Running proof type %d SealPreCommitPhase1 for sector %d...", sector.proofType, sector.sectorNumber) actorIdNum, err := address.IDFromAddress(tm.ActorAddr) - req.NoError(err, "Miner %s: Failed to get actor ID for sector %d", tm.ActorAddr, sectorNumber) + if err != nil { + return sectorInfo{}, fmt.Errorf("failed to get actor ID for sector %d: %w", sector.sectorNumber, err) + } actorId := abi.ActorID(actorIdNum) pc1, err := ffi.SealPreCommitPhase1( - proofType, - tm.cacheDirPaths[sectorNumber], - tm.unsealedSectorPaths[sectorNumber], - tm.sealedSectorPaths[sectorNumber], - sectorNumber, + sector.proofType, + sector.cacheDirPath, + sector.unsealedSectorPath, + sector.sealedSectorPath, + sector.sectorNumber, actorId, sealTickets, - pieceInfo, + sector.pieces, ) - req.NoError(err, "Miner %s: SealPreCommitPhase1 failed for sector %d", tm.ActorAddr, sectorNumber) - req.NotNil(pc1, "Miner %s: SealPreCommitPhase1 returned nil for sector %d", tm.ActorAddr, sectorNumber) + if err != nil { + return sectorInfo{}, fmt.Errorf("failed to run SealPreCommitPhase1 for sector %d: %w", sector.sectorNumber, err) + } + if pc1 == nil { + return sectorInfo{}, fmt.Errorf("SealPreCommitPhase1 returned nil for sector %d", sector.sectorNumber) + } - tm.t.Logf("Miner %s: Running proof type %d SealPreCommitPhase2 for sector %d...", tm.ActorAddr, proofType, sectorNumber) + tm.log("Running proof type %d SealPreCommitPhase2 for sector %d...", sector.proofType, sector.sectorNumber) sealedCid, unsealedCid, err := ffi.SealPreCommitPhase2( pc1, - tm.cacheDirPaths[sectorNumber], - tm.sealedSectorPaths[sectorNumber], + sector.cacheDirPath, + sector.sealedSectorPath, ) - req.NoError(err, "Miner %s: SealPreCommitPhase2 failed for sector %d", tm.ActorAddr, sectorNumber) + if err != nil { + return sectorInfo{}, fmt.Errorf("failed to run SealPreCommitPhase2 for sector %d: %w", sector.sectorNumber, err) + } - tm.t.Logf("Miner %s: Unsealed CID for sector %d: %s", tm.ActorAddr, sectorNumber, unsealedCid) - tm.t.Logf("Miner %s: Sealed CID for sector %d: %s", tm.ActorAddr, sectorNumber, sealedCid) + tm.log("Unsealed CID for sector %d: %s", sector.sectorNumber, unsealedCid) + tm.log("Sealed CID for sector %d: %s", sector.sectorNumber, sealedCid) - tm.sealTickets[sectorNumber] = sealTickets - tm.sealedCids[sectorNumber] = sealedCid - tm.unsealedCids[sectorNumber] = unsealedCid + sector.sealTickets = sealTickets + sector.sealedCid = sealedCid + sector.unsealedCid = unsealedCid + + return sector, nil } -func (tm *TestUnmanagedMiner) proveCommitWaitSeed(ctx context.Context, sectorNumber abi.SectorNumber, proofType abi.RegisteredSealProof) (abi.ChainEpoch, abi.InteractiveSealRandomness) { +func (tm *TestUnmanagedMiner) proveCommitInteractiveRandomness( + sectorNumber abi.SectorNumber, + proofType abi.RegisteredSealProof, +) abi.InteractiveSealRandomness { + req := require.New(tm.t) - head, err := tm.FullNode.ChainHead(ctx) + + head, err := tm.FullNode.ChainHead(tm.ctx) req.NoError(err) - var seedRandomnessHeight abi.ChainEpoch + var interactiveRandomnessHeight abi.ChainEpoch if proofType.IsNonInteractive() { - seedRandomnessHeight = head.Height() - 1 // no need to wait, it just can't be current epoch - } else { - tm.t.Logf("Miner %s: Fetching pre-commit info for sector %d...", tm.ActorAddr, sectorNumber) - preCommitInfo, err := tm.FullNode.StateSectorPreCommitInfo(ctx, tm.ActorAddr, sectorNumber, head.Key()) - req.NoError(err) - seedRandomnessHeight = preCommitInfo.PreCommitEpoch + policy.GetPreCommitChallengeDelay() + // For NI-PoRep this isn't used, so we don't need to wait + return niPorepInteractiveRandomness + } - tm.t.Logf("Miner %s: Waiting %d epochs for seed randomness at epoch %d (current epoch %d) for sector %d...", tm.ActorAddr, seedRandomnessHeight-head.Height(), seedRandomnessHeight, head.Height(), sectorNumber) - tm.FullNode.WaitTillChain(ctx, HeightAtLeast(seedRandomnessHeight+5)) + tm.log("Fetching PreCommit info for sector %d...", sectorNumber) + preCommitInfo, err := tm.FullNode.StateSectorPreCommitInfo(tm.ctx, tm.ActorAddr, sectorNumber, head.Key()) + req.NoError(err) + interactiveRandomnessHeight = preCommitInfo.PreCommitEpoch + policy.GetPreCommitChallengeDelay() + tm.log("Waiting %d (+5) epochs for interactive randomness at epoch %d (current epoch %d) for sector %d...", interactiveRandomnessHeight-head.Height(), interactiveRandomnessHeight, head.Height(), sectorNumber) - head, err = tm.FullNode.ChainHead(ctx) - req.NoError(err) - } + head = tm.FullNode.WaitTillChain(tm.ctx, HeightAtLeast(interactiveRandomnessHeight+5)) minerAddrBytes := new(bytes.Buffer) req.NoError(tm.ActorAddr.MarshalCBOR(minerAddrBytes)) - tm.t.Logf("Miner %s: Fetching seed randomness for sector %d...", tm.ActorAddr, sectorNumber) - rand, err := tm.FullNode.StateGetRandomnessFromBeacon(ctx, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, seedRandomnessHeight, minerAddrBytes.Bytes(), head.Key()) + tm.log("Fetching interactive randomness for sector %d...", sectorNumber) + rand, err := tm.FullNode.StateGetRandomnessFromBeacon(tm.ctx, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, interactiveRandomnessHeight, minerAddrBytes.Bytes(), head.Key()) req.NoError(err) - seedRandomness := abi.InteractiveSealRandomness(rand) + interactiveRandomness := abi.InteractiveSealRandomness(rand) - tm.t.Logf("Miner %s: Obtained seed randomness for sector %d: %x", tm.ActorAddr, sectorNumber, seedRandomness) - return seedRandomnessHeight, seedRandomness + return interactiveRandomness } -func (tm *TestUnmanagedMiner) generateProveCommit( - _ context.Context, - sectorNumber abi.SectorNumber, - proofType abi.RegisteredSealProof, - seedRandomness abi.InteractiveSealRandomness, - pieces []abi.PieceInfo, -) []byte { +func (tm *TestUnmanagedMiner) generateSectorProof(sector sectorInfo) ([]byte, error) { + interactiveRandomness := tm.proveCommitInteractiveRandomness(sector.sectorNumber, sector.proofType) - tm.t.Logf("Miner %s: Generating proof type %d Sector Proof for sector %d...", tm.ActorAddr, proofType, sectorNumber) - req := require.New(tm.t) + if tm.mockProofs { + return []byte{0xde, 0xad, 0xbe, 0xef}, nil // mock prove commit + } + + tm.log("Generating proof type %d Sector Proof for sector %d...", sector.proofType, sector.sectorNumber) actorIdNum, err := address.IDFromAddress(tm.ActorAddr) - req.NoError(err) + if err != nil { + return nil, fmt.Errorf("failed to get actor ID for sector %d: %w", sector.sectorNumber, err) + } actorId := abi.ActorID(actorIdNum) - tm.t.Logf("Miner %s: Running proof type %d SealCommitPhase1 for sector %d...", tm.ActorAddr, proofType, sectorNumber) + tm.log("Running proof type %d SealCommitPhase1 for sector %d...", sector.proofType, sector.sectorNumber) scp1, err := ffi.SealCommitPhase1( - proofType, - tm.sealedCids[sectorNumber], - tm.unsealedCids[sectorNumber], - tm.cacheDirPaths[sectorNumber], - tm.sealedSectorPaths[sectorNumber], - sectorNumber, + sector.proofType, + sector.sealedCid, + sector.unsealedCid, + sector.cacheDirPath, + sector.sealedSectorPath, + sector.sectorNumber, actorId, - tm.sealTickets[sectorNumber], - seedRandomness, - pieces, + sector.sealTickets, + interactiveRandomness, + sector.pieces, ) - req.NoError(err) + if err != nil { + return nil, fmt.Errorf("failed to run SealCommitPhase1 for sector %d: %w", sector.sectorNumber, err) + } - tm.t.Logf("Miner %s: Running proof type %d SealCommitPhase2 for sector %d...", tm.ActorAddr, proofType, sectorNumber) + tm.log("Running proof type %d SealCommitPhase2 for sector %d...", sector.proofType, sector.sectorNumber) var sectorProof []byte - if proofType.IsNonInteractive() { - circuitProofs, err := ffi.SealCommitPhase2CircuitProofs(scp1, sectorNumber) - req.NoError(err) - asvpai := proof.AggregateSealVerifyProofAndInfos{ - Miner: actorId, - SealProof: proofType, - AggregateProof: abi.RegisteredAggregationProof_SnarkPackV2, - Infos: []proof.AggregateSealVerifyInfo{{ - Number: sectorNumber, - Randomness: tm.sealTickets[sectorNumber], - InteractiveRandomness: make([]byte, 32), - SealedCID: tm.sealedCids[sectorNumber], - UnsealedCID: tm.unsealedCids[sectorNumber], - }}, + if sector.proofType.IsNonInteractive() { + sectorProof, err = ffi.SealCommitPhase2CircuitProofs(scp1, sector.sectorNumber) + if err != nil { + return nil, fmt.Errorf("failed to run SealCommitPhase2CircuitProofs for sector %d: %w", sector.sectorNumber, err) } - tm.t.Logf("Miner %s: Aggregating circuit proofs for sector %d: %+v", tm.ActorAddr, sectorNumber, asvpai) - sectorProof, err = ffi.AggregateSealProofs(asvpai, [][]byte{circuitProofs}) - req.NoError(err) } else { - sectorProof, err = ffi.SealCommitPhase2(scp1, sectorNumber, actorId) - req.NoError(err) + sectorProof, err = ffi.SealCommitPhase2(scp1, sector.sectorNumber, actorId) + if err != nil { + return nil, fmt.Errorf("failed to run SealCommitPhase2 for sector %d: %w", sector.sectorNumber, err) + } } - tm.t.Logf("Miner %s: Got proof type %d sector proof of length %d for sector %d", tm.ActorAddr, proofType, len(sectorProof), sectorNumber) + tm.log("Got proof type %d sector proof of length %d for sector %d", sector.proofType, len(sectorProof), sector.sectorNumber) - return sectorProof + return sectorProof, nil } func (tm *TestUnmanagedMiner) SubmitMessage( - ctx context.Context, params cbg.CBORMarshaler, value uint64, method abi.MethodNum, ) (*api.MsgLookup, error) { + mCid, err := tm.mpoolPushMessage(params, value, method) + if err != nil { + return nil, err + } + + return tm.waitMessage(mCid) +} + +func (tm *TestUnmanagedMiner) waitMessage(mCid cid.Cid) (*api.MsgLookup, error) { + msg, err := tm.FullNode.StateWaitMsg(tm.ctx, mCid, 2, api.LookbackNoLimit, true) + if err != nil { + return nil, err + } + + tm.log("Message with CID: %s has been confirmed on-chain", mCid) + + return msg, nil +} + +func (tm *TestUnmanagedMiner) mpoolPushMessage( + params cbg.CBORMarshaler, + value uint64, + method abi.MethodNum, +) (cid.Cid, error) { + enc, aerr := actors.SerializeParams(params) if aerr != nil { - return nil, aerr + return cid.Undef, aerr } - tm.t.Logf("Submitting message for miner %s with method number %d", tm.ActorAddr, method) + tm.log("Submitting message for miner with method number %d", method) - m, err := tm.FullNode.MpoolPushMessage(ctx, &types.Message{ + m, err := tm.FullNode.MpoolPushMessage(tm.ctx, &types.Message{ To: tm.ActorAddr, From: tm.OwnerKey.Address, Value: types.FromFil(value), @@ -1064,90 +1433,184 @@ func (tm *TestUnmanagedMiner) SubmitMessage( Params: enc, }, nil) if err != nil { - return nil, err - } - - tm.t.Logf("Pushed message with CID: %s for miner %s", m.Cid(), tm.ActorAddr) - - msg, err := tm.FullNode.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true) - if err != nil { - return nil, err + return cid.Undef, err } - tm.t.Logf("Message with CID: %s has been confirmed on-chain for miner %s", m.Cid(), tm.ActorAddr) + tm.log("Pushed message with CID: %s", m.Cid()) - return msg, nil + return m.Cid(), nil } -func requireTempFile(t *testing.T, fileContentsReader io.Reader, size uint64) *os.File { +func mkTempFile(t *testing.T, fileContentsReader io.Reader, size uint64) (*os.File, error) { // Create a temporary file tempFile, err := os.CreateTemp(t.TempDir(), "") - require.NoError(t, err) + if err != nil { + return nil, err + } // Copy contents from the reader to the temporary file bytesCopied, err := io.Copy(tempFile, fileContentsReader) - require.NoError(t, err) + if err != nil { + return nil, err + } // Ensure the expected size matches the copied size - require.EqualValues(t, size, bytesCopied) + if int64(size) != bytesCopied { + return nil, fmt.Errorf("expected file size %d, got %d", size, bytesCopied) + } // Synchronize the file's content to disk - require.NoError(t, tempFile.Sync()) + if err := tempFile.Sync(); err != nil { + return nil, err + } // Reset the file pointer to the beginning of the file - _, err = tempFile.Seek(0, io.SeekStart) - require.NoError(t, err) + if _, err = tempFile.Seek(0, io.SeekStart); err != nil { + return nil, err + } - return tempFile + return tempFile, nil } -func (tm *TestUnmanagedMiner) WaitTillActivatedAndAssertPower( - ctx context.Context, - respCh chan WindowPostResp, - sector abi.SectorNumber, -) { +func (tm *TestUnmanagedMiner) WaitTillActivatedAndAssertPower(sectors []abi.SectorNumber, raw uint64, qa uint64) { + req := require.New(tm.t) + + di, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, types.EmptyTSK) + req.NoError(err) - // wait till sector is activated - select { - case resp := <-respCh: - require.NoError(tm.t, resp.Error) - require.True(tm.t, resp.Posted) - case <-ctx.Done(): - tm.t.Fatal("timed out waiting for sector activation") + // wait till sectors are activated + for _, sectorNumber := range sectors { + tm.WaitTillPost(sectorNumber) + + if !tm.mockProofs { // else it would pass, which we don't want + // if the sector is in the current or previous deadline, we can't dispute the PoSt + sl, err := tm.FullNode.StateSectorPartition(tm.ctx, tm.ActorAddr, sectorNumber, types.EmptyTSK) + req.NoError(err) + if sl.Deadline == CurrentDeadlineIndex(di) { + tm.log("In current proving deadline for sector %d, waiting for the next deadline to dispute PoSt", sectorNumber) + // wait until we're past the proving deadline for this sector + tm.FullNode.WaitTillChain(tm.ctx, HeightAtLeast(di.Close+5)) + } + // WindowPost Dispute should fail + tm.AssertDisputeFails(sectorNumber) + } } - // Fetch on-chain sector properties - head, err := tm.FullNode.ChainHead(ctx) - require.NoError(tm.t, err) + tm.t.Log("Checking power after PoSt ...") - soi, err := tm.FullNode.StateSectorGetInfo(ctx, tm.ActorAddr, sector, head.Key()) - require.NoError(tm.t, err) - tm.t.Logf("Miner %s SectorOnChainInfo %d: %+v", tm.ActorAddr.String(), sector, soi) + // Miner B should now have power + tm.AssertPower(raw, qa) +} - _ = tm.FullNode.WaitTillChain(ctx, HeightAtLeast(head.Height()+5)) +func (tm *TestUnmanagedMiner) AssertNoWindowPostError() { + tm.postsLk.Lock() + defer tm.postsLk.Unlock() + for _, post := range tm.posts { + require.NoError(tm.t, post.Error, "expected no error in window post but found one at epoch %d", post.Epoch) + } +} - tm.t.Log("Checking power after PoSt ...") +func (tm *TestUnmanagedMiner) WaitTillPost(sectorNumber abi.SectorNumber) { + for i := 0; tm.ctx.Err() == nil; i++ { + if i%10 == 0 { + tm.log("Waiting for sector %d to be posted", sectorNumber) + } + tm.postsLk.Lock() + for _, post := range tm.posts { + require.NoError(tm.t, post.Error, "expected no error in window post but found one at epoch %d", post.Epoch) + if post.Error == nil { + for _, sn := range post.Posted { + if sn == sectorNumber { + tm.postsLk.Unlock() + return + } + } + } + } + tm.postsLk.Unlock() + select { + case <-tm.ctx.Done(): + return + case <-time.After(time.Millisecond * 100): + } + } +} - // Miner B should now have power - tm.AssertPower(ctx, uint64(tm.options.sectorSize), uint64(tm.options.sectorSize)) +func (tm *TestUnmanagedMiner) AssertNoPower() { + req := require.New(tm.t) - if !tm.mockProofs { - // WindowPost Dispute should fail - tm.AssertDisputeFails(ctx, sector) - } // else it would pass, which we don't want + p := tm.CurrentPower() + tm.log("RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.True(p.MinerPower.RawBytePower.IsZero()) +} + +func (tm *TestUnmanagedMiner) CurrentPower() *api.MinerPower { + req := require.New(tm.t) + + head, err := tm.FullNode.ChainHead(tm.ctx) + req.NoError(err) + + p, err := tm.FullNode.StateMinerPower(tm.ctx, tm.ActorAddr, head.Key()) + req.NoError(err) + + return p } -func (tm *TestUnmanagedMiner) AssertDisputeFails(ctx context.Context, sector abi.SectorNumber) { - err := tm.SubmitPostDispute(ctx, sector) - require.Error(tm.t, err) - require.Contains(tm.t, err.Error(), "failed to dispute valid post") - require.Contains(tm.t, err.Error(), "(RetCode=16)") +func (tm *TestUnmanagedMiner) AssertPower(raw uint64, qa uint64) { + req := require.New(tm.t) + + p := tm.CurrentPower() + tm.log("RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.Equal(raw, p.MinerPower.RawBytePower.Uint64()) + req.Equal(qa, p.MinerPower.QualityAdjPower.Uint64()) } -func (tm *TestUnmanagedMiner) IsImmutableDeadline(ctx context.Context, deadlineIndex uint64) bool { - di, err := tm.FullNode.StateMinerProvingDeadline(ctx, tm.ActorAddr, types.EmptyTSK) - require.NoError(tm.t, err) - // don't rely on di.Index because if we haven't enrolled in cron it won't be ticking - currentDeadlineIdx := uint64(math.Abs(float64((di.CurrentEpoch - di.PeriodStart) / di.WPoStChallengeWindow))) +func (tm *TestUnmanagedMiner) AssertDisputeFails(sector abi.SectorNumber) { + req := require.New(tm.t) + + tm.log("Disputing WindowedPoSt for sector %d ...", sector) + + err := tm.submitPostDispute(sector) + req.Error(err) + req.Contains(err.Error(), "failed to dispute valid post") + req.Contains(err.Error(), "(RetCode=16)") +} + +func (tm *TestUnmanagedMiner) IsImmutableDeadline(deadlineIndex uint64) bool { + req := require.New(tm.t) + di, err := tm.FullNode.StateMinerProvingDeadline(tm.ctx, tm.ActorAddr, types.EmptyTSK) + req.NoError(err) + currentDeadlineIdx := CurrentDeadlineIndex(di) return currentDeadlineIdx == deadlineIndex || currentDeadlineIdx == deadlineIndex-1 } + +// CurrentDeadlineIndex manually calculates the current deadline index. This may be useful in +// situations where the miner hasn't been enrolled in cron and the deadline index isn't ticking +// so dline.Info.Index may not be accurate. +func CurrentDeadlineIndex(di *dline.Info) uint64 { + didx := int64((di.CurrentEpoch - di.PeriodStart) / di.WPoStChallengeWindow) + if didx < 0 { // before the first deadline + return uint64(int64(di.WPoStPeriodDeadlines) + didx) + } + return uint64(didx) +} + +// TODO: remove when https://github.com/filecoin-project/go-state-types/pull/286 is available +func exitCodesFromBatchReturn(b miner14.BatchReturn) []exitcode.ExitCode { + size := int(b.SuccessCount) + len(b.FailCodes) + codes := make([]exitcode.ExitCode, size) + i := 0 + for _, fc := range b.FailCodes { + if fc.Idx > uint64(i) { + for ; i < int(fc.Idx); i++ { + codes[i] = exitcode.Ok + } + } + codes[i] = fc.Code + i++ + } + for ; i < len(codes); i++ { + codes[i] = exitcode.Ok + } + return codes +} diff --git a/itests/manual_onboarding_test.go b/itests/manual_onboarding_test.go index 4e976b030b3..c03ddd9b1d7 100644 --- a/itests/manual_onboarding_test.go +++ b/itests/manual_onboarding_test.go @@ -61,9 +61,11 @@ func TestManualSectorOnboarding(t *testing.T) { // performing all related tasks manually. Managed by the TestKit, MinerB has the capability to utilize actual proofs // for the processes of sector onboarding and activation. nodeOpts := []kit.NodeOpt{kit.SectorSize(defaultSectorSize), kit.OwnerAddr(client.DefaultKey)} - minerB, ens := ens.UnmanagedMiner(&client, nodeOpts...) + minerB, ens := ens.UnmanagedMiner(ctx, &client, nodeOpts...) + defer minerB.Stop() // MinerC is similar to MinerB, but onboards pieces instead of a pure CC sector - minerC, ens := ens.UnmanagedMiner(&client, nodeOpts...) + minerC, ens := ens.UnmanagedMiner(ctx, &client, nodeOpts...) + defer minerC.Stop() ens.Start() @@ -79,40 +81,32 @@ func TestManualSectorOnboarding(t *testing.T) { t.Logf("MinerA RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) // Miner B should have no power as it has yet to onboard and activate any sectors - minerB.AssertNoPower(ctx) + minerB.AssertNoPower() // Miner C should have no power as it has yet to onboard and activate any sectors - minerC.AssertNoPower(ctx) + minerC.AssertNoPower() // ---- Miner B onboards a CC sector - var bSectorNum abi.SectorNumber - var bRespCh chan kit.WindowPostResp - var bWdPostCancelF context.CancelFunc - - bSectorNum, bRespCh, bWdPostCancelF = minerB.OnboardCCSector(ctx, sealProofType) + bSectors := minerB.OnboardSectors(sealProofType, false, 1) + req.Len(bSectors, 1) // Miner B should still not have power as power can only be gained after sector is activated i.e. the first WindowPost is submitted for it - minerB.AssertNoPower(ctx) + minerB.AssertNoPower() // Ensure that the block miner checks for and waits for posts during the appropriate proving window from our new miner with a sector blockMiner.WatchMinerForPost(minerB.ActorAddr) // --- Miner C onboards sector with data/pieces - var cSectorNum abi.SectorNumber - var cRespCh chan kit.WindowPostResp - - cSectorNum, cRespCh, _ = minerC.OnboardSectorWithPieces(ctx, kit.TestSpt) + cSectors := minerC.OnboardSectors(sealProofType, true, 1) // Miner C should still not have power as power can only be gained after sector is activated i.e. the first WindowPost is submitted for it - minerC.AssertNoPower(ctx) + minerC.AssertNoPower() // Ensure that the block miner checks for and waits for posts during the appropriate proving window from our new miner with a sector blockMiner.WatchMinerForPost(minerC.ActorAddr) // Wait till both miners' sectors have had their first post and are activated and check that this is reflected in miner power - minerB.WaitTillActivatedAndAssertPower(ctx, bRespCh, bSectorNum) - minerC.WaitTillActivatedAndAssertPower(ctx, cRespCh, cSectorNum) + minerB.WaitTillActivatedAndAssertPower(bSectors, uint64(defaultSectorSize), uint64(defaultSectorSize)) + minerC.WaitTillActivatedAndAssertPower(cSectors, uint64(defaultSectorSize), uint64(defaultSectorSize)) // Miner B has activated the CC sector -> upgrade it with snapdeals - _ = minerB.SnapDeal(ctx, kit.TestSpt, bSectorNum) - // cancel the WdPost for the CC sector as the corresponding CommR is no longer valid - bWdPostCancelF() + _ = minerB.SnapDeal(bSectors[0]) }) } } diff --git a/itests/mempool_test.go b/itests/mempool_test.go index f07b46a737c..e366fe49bb4 100644 --- a/itests/mempool_test.go +++ b/itests/mempool_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/api" @@ -18,6 +19,33 @@ import ( const mPoolThrottle = time.Millisecond * 100 const mPoolTimeout = time.Second * 10 +func TestMemPoolPushOutgoingInvalidDelegated(t *testing.T) { + //stm: @CHAIN_MEMPOOL_PENDING_001, @CHAIN_STATE_WAIT_MSG_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 + //stm: @CHAIN_MEMPOOL_PUSH_002 + ctx := context.Background() + firstNode, _, _, ens := kit.EnsembleTwoOne(t, kit.MockProofs()) + ens.InterconnectAll() + kit.QuietMiningLogs() + + sender := firstNode.DefaultKey.Address + badTo, err := address.NewFromString("f410f74aaaaaaaaaaaaaaaaaaaaaaaaac5sh2bf3lgta") + require.NoError(t, err) + + bal, err := firstNode.WalletBalance(ctx, sender) + require.NoError(t, err) + toSend := big.Div(bal, big.NewInt(10)) + + msg := &types.Message{ + From: sender, + Value: toSend, + To: badTo, + } + + _, err = firstNode.MpoolPushMessage(ctx, msg, nil) + require.Error(t, err) + require.Contains(t, err.Error(), "is a delegated address but not a valid Eth Address") +} + func TestMemPoolPushSingleNode(t *testing.T) { //stm: @CHAIN_MEMPOOL_CREATE_MSG_CHAINS_001, @CHAIN_MEMPOOL_SELECT_001 //stm: @CHAIN_MEMPOOL_PENDING_001, @CHAIN_STATE_WAIT_MSG_001, @CHAIN_MEMPOOL_CAP_GAS_FEE_001 diff --git a/itests/migration_test.go b/itests/migration_test.go index 4d7e01d527b..ddf997212d7 100644 --- a/itests/migration_test.go +++ b/itests/migration_test.go @@ -596,7 +596,7 @@ func TestMigrationNV18(t *testing.T) { // check all actor's Address fields require.NoError(t, newStateTree.ForEach(func(address address.Address, actor *types.Actor) error { if address != ethZeroAddrID { - require.Nil(t, actor.Address) + require.Nil(t, actor.DelegatedAddress) } return nil })) diff --git a/itests/msgindex_test.go b/itests/msgindex_test.go index 807ab3c03f0..d9ed752797e 100644 --- a/itests/msgindex_test.go +++ b/itests/msgindex_test.go @@ -52,7 +52,7 @@ func testMsgIndex( makeMsgIndex := func(cs *store.ChainStore) (index.MsgIndex, error) { var err error tmp := t.TempDir() - msgIndex, err := index.NewMsgIndex(context.Background(), tmp, cs) + msgIndex, err := index.NewMsgIndex(context.Background(), tmp+"/msgindex.db", cs) if err == nil { mx.Lock() tmpDirs = append(tmpDirs, tmp) diff --git a/itests/niporep_manual_test.go b/itests/niporep_manual_test.go index 76ea1f9696b..a2fa949082a 100644 --- a/itests/niporep_manual_test.go +++ b/itests/niporep_manual_test.go @@ -3,7 +3,6 @@ package itests import ( "context" "fmt" - "math" "testing" "time" @@ -20,6 +19,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin" miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner" + "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/build" @@ -29,52 +29,217 @@ import ( "github.com/filecoin-project/lotus/lib/must" ) +// All real-proofs test cases in here are skipped by default, gated with the LOTUS_RUN_VERY_EXPENSIVE_TESTS env var. +// Set this env var to "1" to run these tests. +// Some tests are also explicitly skipped with a `skipped` bool which can be manually commented out here and run. +// They are both very-very expensive, and are mainly useful to test very specific scenarios. You may need a -timeout +// of more than 10m to run these. + func TestManualNISectorOnboarding(t *testing.T) { req := require.New(t) + const blocktime = 2 * time.Millisecond const defaultSectorSize = abi.SectorSize(2 << 10) // 2KiB sealProofType, err := miner.SealProofTypeFromSectorSize(defaultSectorSize, network.Version23, miner.SealProofVariant_NonInteractive) req.NoError(err) - for _, withMockProofs := range []bool{true, false} { - testName := "WithRealProofs" - if withMockProofs { - testName = "WithMockProofs" + mkgood := func(c int) []exitcode.ExitCode { + out := make([]exitcode.ExitCode, c) + for i := range out { + out[i] = exitcode.Ok } - t.Run(testName, func(t *testing.T) { - if !withMockProofs { + return out + } + + type testCaseMiner struct { + // sectorsToOnboard tells us (a) how many sectors to prepare and (b) how many of them should pass the onboarding process + // with an Ok exit code + sectorsToOnboard []exitcode.ExitCode + // allOrNothing tells us whether all sectors should pass onboarding or none + allOrNothing bool + expectPower uint64 + // snapDeal tells us whether to snap a deal into one of the sectors after activation + snapDeal bool + } + + testCases := []struct { + name string + skip bool + mockProofs bool + miners []testCaseMiner + }{ + { + name: "mock proofs, miners with 1, 3 (1 bad) and 6 sectors", + mockProofs: true, + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(1), + allOrNothing: true, + expectPower: uint64(defaultSectorSize), + snapDeal: true, + }, + { + sectorsToOnboard: []exitcode.ExitCode{exitcode.Ok, exitcode.ErrIllegalArgument, exitcode.Ok}, + allOrNothing: false, + expectPower: uint64(defaultSectorSize * 2), + snapDeal: true, + }, + { + // should trigger a non-zero aggregate fee (>5 for niporep) + sectorsToOnboard: mkgood(6), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 6), + snapDeal: true, + }, + }, + }, + { + name: "mock proofs, 1 miner with 65 sectors", + mockProofs: true, + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(65), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 65), + snapDeal: true, + }, + }, + }, + { + name: "real proofs, 1 miner with 1 sector", + mockProofs: false, + skip: true, // uncomment if you want to run this test manually + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(1), + allOrNothing: true, + expectPower: uint64(defaultSectorSize), + snapDeal: true, + }, + }, + }, + { + name: "real proofs, 1 miner with 2 sectors", + mockProofs: false, + skip: true, // uncomment if you want to run this test manually + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(2), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 2), + snapDeal: true, + }, + }, + }, + { + name: "real proofs, 1 miner with 3 sectors", + mockProofs: false, + skip: true, // uncomment if you want to run this test manually + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(3), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 3), + snapDeal: true, + }, + }, + }, + { + name: "real proofs, 1 miner with 4 sectors", + mockProofs: false, + skip: true, // uncomment if you want to run this test manually + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(4), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 4), + snapDeal: true, + }, + }, + }, + { + // useful for testing aggregate fee + // "aggregate seal verify failed: invalid aggregate" + name: "real proofs, 1 miner with 7 sectors", + mockProofs: false, + skip: true, // uncomment if you want to run this test manually + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(7), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 7), + snapDeal: true, + }, + }, + }, + { + // useful for testing aggregate fee and successful activation with the aggregate proof even + // though one of them is bad + name: "real proofs, 1 miner with 7 sectors, 1 bad", + mockProofs: false, + miners: []testCaseMiner{ + { + sectorsToOnboard: []exitcode.ExitCode{exitcode.Ok, exitcode.ErrIllegalArgument, exitcode.Ok, exitcode.Ok, exitcode.Ok, exitcode.Ok, exitcode.Ok}, + allOrNothing: false, + expectPower: uint64(defaultSectorSize * 6), + snapDeal: true, + }, + }, + }, + { + name: "real proofs, 1 miner with 65 sectors", + mockProofs: false, + skip: true, // uncomment if you want to run this test manually + miners: []testCaseMiner{ + { + sectorsToOnboard: mkgood(65), + allOrNothing: true, + expectPower: uint64(defaultSectorSize * 65), + snapDeal: true, + }, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if tc.skip { + t.Skip("skipping test") + } + if !tc.mockProofs { kit.VeryExpensive(t) } + req := require.New(t) + kit.QuietMiningLogs() ctx, cancel := context.WithCancel(context.Background()) defer cancel() var ( - // need to pick a balance value so that the test is not racy on CI by running through it's WindowPostDeadlines too fast - blocktime = 2 * time.Millisecond - client kit.TestFullNode - minerA kit.TestMiner // A is a standard genesis miner + client kit.TestFullNode + genesisMiner kit.TestMiner ) - // Setup and begin mining with a single miner (A) - // Miner A will only be a genesis Miner with power allocated in the genesis block and will not onboard any sectors from here on - ens := kit.NewEnsemble(t, kit.MockProofs(withMockProofs)). + // Setup and begin mining with a single genesis block miner, this miner won't be used + // in the test beyond mining the chain and maintaining power + ens := kit.NewEnsemble(t, kit.MockProofs(tc.mockProofs)). FullNode(&client, kit.SectorSize(defaultSectorSize)). // preseal more than the default number of sectors to ensure that the genesis miner has power // because our unmanaged miners won't produce blocks so we may get null rounds - Miner(&minerA, &client, kit.PresealSectors(5), kit.SectorSize(defaultSectorSize), kit.WithAllSubsystems()). + Miner(&genesisMiner, &client, kit.PresealSectors(5), kit.SectorSize(defaultSectorSize), kit.WithAllSubsystems()). Start(). InterconnectAll() blockMiners := ens.BeginMiningMustPost(blocktime) req.Len(blockMiners, 1) blockMiner := blockMiners[0] - // Instantiate MinerB to manually handle sector onboarding and power acquisition through sector activation. - // Unlike other miners managed by the Lotus Miner storage infrastructure, MinerB operates independently, - // performing all related tasks manually. Managed by the TestKit, MinerB has the capability to utilize actual proofs - // for the processes of sector onboarding and activation. + // Instantiate our test miners to manually handle sector onboarding and power acquisition through sector activation. nodeOpts := []kit.NodeOpt{kit.SectorSize(defaultSectorSize), kit.OwnerAddr(client.DefaultKey)} - minerB, ens := ens.UnmanagedMiner(&client, nodeOpts...) + miners := make([]*kit.TestUnmanagedMiner, len(tc.miners)) + for i := range tc.miners { + miners[i], _ = ens.UnmanagedMiner(ctx, &client, nodeOpts...) + defer miners[i].Stop() + } ens.Start() @@ -82,111 +247,188 @@ func TestManualNISectorOnboarding(t *testing.T) { t.Log("Checking initial power ...") - // Miner A should have power as it has already onboarded sectors in the genesis block + // The genesis miner A should have power as it has already onboarded sectors in the genesis block head, err := client.ChainHead(ctx) req.NoError(err) - p, err := client.StateMinerPower(ctx, minerA.ActorAddr, head.Key()) + p, err := client.StateMinerPower(ctx, genesisMiner.ActorAddr, head.Key()) req.NoError(err) - t.Logf("MinerA RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) - - // Miner B should have no power as it has yet to onboard and activate any sectors - minerB.AssertNoPower(ctx) - - // Verify that ProveCommitSectorsNI rejects messages with invalid parameters - verifyProveCommitSectorsNIErrorConditions(ctx, t, minerB, sealProofType) - - // ---- Miner B onboards a CC sector - var bSectorNum abi.SectorNumber - var bRespCh chan kit.WindowPostResp - var bWdPostCancelF context.CancelFunc - - // Onboard a CC sector with Miner B using NI-PoRep - bSectorNum, bRespCh, bWdPostCancelF = minerB.OnboardCCSector(ctx, sealProofType) - // Miner B should still not have power as power can only be gained after sector is activated i.e. the first WindowPost is submitted for it - minerB.AssertNoPower(ctx) - - // Check that the sector-activated event was emitted - { - expectedEntries := []types.EventEntry{ - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("sector-activated"), dagcbor.Encode))}, - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(bSectorNum)), dagcbor.Encode))}, - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "unsealed-cid", Value: must.One(ipld.Encode(datamodel.Null, dagcbor.Encode))}, + t.Logf("genesisMiner RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + + // Our test miners should have no power as they have yet to onboard and activate any sectors + for _, miner := range miners { + miner.AssertNoPower() + } + + sectors := make([][]abi.SectorNumber, len(tc.miners)) + + for i, tcMiner := range tc.miners { + miner := miners[i] + var expectSuccesses int + for _, ec := range tcMiner.sectorsToOnboard { + if ec.IsSuccess() { + expectSuccesses++ + } } - from := head.Height() - recentEvents, err := client.FullNode.GetActorEventsRaw(ctx, &types.ActorEventFilter{FromHeight: &from}) + + head, err = client.ChainHead(ctx) req.NoError(err) - req.Len(recentEvents, 1) - req.Equal(expectedEntries, recentEvents[0].Entries) - } - // Ensure that the block miner checks for and waits for posts during the appropriate proving window from our new miner with a sector - blockMiner.WatchMinerForPost(minerB.ActorAddr) + // Onboard CC sectors to this test miner using NI-PoRep + sectors[i] = miner.OnboardSectors( + sealProofType, + false, + len(tcMiner.sectorsToOnboard), + kit.WithExpectedExitCodes(tcMiner.sectorsToOnboard), + kit.WithRequireActivationSuccess(tcMiner.allOrNothing), + kit.WithModifyNIActivationsBeforeSubmit(func(activations []miner14.SectorNIActivationInfo) []miner14.SectorNIActivationInfo { + head, err := client.ChainHead(ctx) + req.NoError(err) + + for j, ec := range tcMiner.sectorsToOnboard { + if !ec.IsSuccess() { + // Set the expiration in the past to ensure the sector fails onboarding + activations[j].Expiration = head.Height() - 100 + } + } + return activations + }), + ) + + req.Len(sectors[i], expectSuccesses) + + // Miner B should still not have power as power can only be gained after sector is activated i.e. the first WindowPost is submitted for it + miner.AssertNoPower() + + // Check that the sector-activated event was emitted + { + expectedEntries := make([][]types.EventEntry, 0) + for _, sectorNumber := range sectors[i] { + expectedEntries = append(expectedEntries, []types.EventEntry{ + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("sector-activated"), dagcbor.Encode))}, + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(sectorNumber)), dagcbor.Encode))}, + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "unsealed-cid", Value: must.One(ipld.Encode(datamodel.Null, dagcbor.Encode))}, + }) + } + from := head.Height() + recentEvents, err := client.FullNode.GetActorEventsRaw(ctx, &types.ActorEventFilter{FromHeight: &from}) + req.NoError(err) + req.Len(recentEvents, len(sectors[i])) + for i, event := range recentEvents { + req.Equal(expectedEntries[i], event.Entries) + } + } - // Wait till both miners' sectors have had their first post and are activated and check that this is reflected in miner power - minerB.WaitTillActivatedAndAssertPower(ctx, bRespCh, bSectorNum) + // Ensure that the block miner checks for and waits for posts during the appropriate proving window from our new miner with a sector + blockMiner.WatchMinerForPost(miner.ActorAddr) + } - head, err = client.ChainHead(ctx) - req.NoError(err) + // Wait till each miners' sectors have had their first post and are activated and check that this is reflected in miner power + for i, miner := range miners { + miner.WaitTillActivatedAndAssertPower(sectors[i], tc.miners[i].expectPower, tc.miners[i].expectPower) + } - // Miner B has activated the CC sector -> upgrade it with snapdeals - snapPieces := minerB.SnapDeal(ctx, kit.TestSpt, bSectorNum) - // cancel the WdPost for the CC sector as the corresponding CommR is no longer valid - bWdPostCancelF() - - // Check "sector-updated" event happned after snap - { - expectedEntries := []types.EventEntry{ - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("sector-updated"), dagcbor.Encode))}, - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(bSectorNum)), dagcbor.Encode))}, - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "unsealed-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: snapPieces[0].PieceCID}), dagcbor.Encode))}, - {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: snapPieces[0].PieceCID}), dagcbor.Encode))}, - {Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(snapPieces[0].Size)), dagcbor.Encode))}, + for i, tcMiner := range tc.miners { + if !tcMiner.snapDeal { + continue } - from := head.Height() - recentEvents, err := client.FullNode.GetActorEventsRaw(ctx, &types.ActorEventFilter{FromHeight: &from}) + + miner := miners[i] + head, err = client.ChainHead(ctx) req.NoError(err) - req.Len(recentEvents, 1) - req.Equal(expectedEntries, recentEvents[0].Entries) + + // Snap a deal into the first of the successfully onboarded CC sectors for this miner + snapPieces := miner.SnapDeal(sectors[i][0]) + + // Check "sector-updated" event happned after snap + { + expectedEntries := []types.EventEntry{ + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("sector-updated"), dagcbor.Encode))}, + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(sectors[i][0])), dagcbor.Encode))}, + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "unsealed-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: snapPieces[0].PieceCID}), dagcbor.Encode))}, + {Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: snapPieces[0].PieceCID}), dagcbor.Encode))}, + {Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(snapPieces[0].Size)), dagcbor.Encode))}, + } + from := head.Height() + recentEvents, err := client.FullNode.GetActorEventsRaw(ctx, &types.ActorEventFilter{FromHeight: &from}) + req.NoError(err) + req.Len(recentEvents, 1) + req.Equal(expectedEntries, recentEvents[0].Entries) + } } }) } } -func verifyProveCommitSectorsNIErrorConditions(ctx context.Context, t *testing.T, miner *kit.TestUnmanagedMiner, sealProofType abi.RegisteredSealProof) { +func TestNISectorFailureCases(t *testing.T) { req := require.New(t) - head, err := miner.FullNode.ChainHead(ctx) + const blocktime = 2 * time.Millisecond + const defaultSectorSize = abi.SectorSize(2 << 10) // 2KiB + sealProofType, err := miner.SealProofTypeFromSectorSize(defaultSectorSize, network.Version23, miner.SealProofVariant_NonInteractive) req.NoError(err) + kit.QuietMiningLogs() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + var ( + client kit.TestFullNode + genesisMiner kit.TestMiner + ) + ens := kit.NewEnsemble(t, kit.MockProofs(true)). + FullNode(&client, kit.SectorSize(defaultSectorSize)). + Miner(&genesisMiner, &client, kit.PresealSectors(5), kit.SectorSize(defaultSectorSize), kit.WithAllSubsystems()). + Start(). + InterconnectAll() + _ = ens.BeginMining(blocktime) + + miner, _ := ens.UnmanagedMiner(ctx, &client, kit.SectorSize(defaultSectorSize), kit.OwnerAddr(client.DefaultKey)) + defer miner.Stop() + + ens.Start() + + build.Clock.Sleep(time.Second) + + // We have to onboard a sector first to get the miner enrolled in cron; although we don't need to wait for it to prove + _ = miner.OnboardSectors(sealProofType, false, 1) + + // Utility functions and variables for our failure cases + actorIdNum, err := address.IDFromAddress(miner.ActorAddr) req.NoError(err) actorId := abi.ActorID(actorIdNum) - var provingDeadline uint64 = 7 - if miner.IsImmutableDeadline(ctx, provingDeadline) { - // avoid immutable deadlines - provingDeadline = 5 + // make sure we are working with a deadline that has no chance of being immutable (current or next) + di, err := miner.FullNode.StateMinerProvingDeadline(ctx, miner.ActorAddr, types.EmptyTSK) + req.NoError(err) + currentDeadlineIdx := kit.CurrentDeadlineIndex(di) + provingDeadline := currentDeadlineIdx - 2 + if currentDeadlineIdx <= 2 { + provingDeadline = miner14.WPoStPeriodDeadlines - 1 } + head, err := miner.FullNode.ChainHead(ctx) + req.NoError(err) + + sectorNumber := abi.SectorNumber(5000) + submitAndFail := func(params *miner14.ProveCommitSectorsNIParams, errMsg string, errCode int) { t.Helper() - r, err := miner.SubmitMessage(ctx, params, 1, builtin.MethodsMiner.ProveCommitSectorsNI) - req.Error(err) + r, err := miner.SubmitMessage(params, 1, builtin.MethodsMiner.ProveCommitSectorsNI) + req.Error(err, "expected error: [%s]", errMsg) req.Contains(err.Error(), errMsg) if errCode > 0 { req.Contains(err.Error(), fmt.Sprintf("(RetCode=%d)", errCode)) } req.Nil(r) } - - sn := abi.SectorNumber(5000) mkSai := func() miner14.SectorNIActivationInfo { - sn++ + sectorNumber++ // unique per sector return miner14.SectorNIActivationInfo{ - SealingNumber: sn, + SealingNumber: sectorNumber, SealerID: actorId, SealedCID: cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkiekz"), - SectorNumber: sn, + SectorNumber: sectorNumber, SealRandEpoch: head.Height() - 10, Expiration: 2880 * 300, } @@ -202,59 +444,78 @@ func verifyProveCommitSectorsNIErrorConditions(ctx context.Context, t *testing.T } } - // Test message rejection on no sectors - params := mkParams() - params.Sectors = []miner14.SectorNIActivationInfo{} - submitAndFail(¶ms, "too few sectors", 16) + // Failure cases - // Test message rejection on too many sectors - sectorInfos := make([]miner14.SectorNIActivationInfo, 66) - for i := range sectorInfos { - sectorInfos[i] = mkSai() - } - params = mkParams() - params.Sectors = sectorInfos - submitAndFail(¶ms, "too many sectors", 16) - - // Test bad aggregation proof type - params = mkParams() - params.AggregateProofType = abi.RegisteredAggregationProof_SnarkPackV1 - submitAndFail(¶ms, "aggregate proof type", 16) - - // Test bad SealerID - params = mkParams() - params.Sectors[1].SealerID = 1234 - submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) - - // Test bad SealingNumber - params = mkParams() - params.Sectors[1].SealingNumber = 1234 - submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) - - // Test bad SealedCID - params = mkParams() - params.Sectors[1].SealedCID = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") - submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) - - // Test bad SealRandEpoch - head, err = miner.FullNode.ChainHead(ctx) - req.NoError(err) - params = mkParams() - params.Sectors[1].SealRandEpoch = head.Height() + builtin.EpochsInDay - submitAndFail(¶ms, fmt.Sprintf("seal challenge epoch %d must be before now", params.Sectors[1].SealRandEpoch), 16) - params.Sectors[1].SealRandEpoch = head.Height() - 190*builtin.EpochsInDay - submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) - - // Immutable/bad deadlines - di, err := miner.FullNode.StateMinerProvingDeadline(ctx, miner.ActorAddr, head.Key()) - req.NoError(err) - currentDeadlineIdx := uint64(math.Abs(float64((di.CurrentEpoch - di.PeriodStart) / di.WPoStChallengeWindow))) - req.Less(currentDeadlineIdx, di.WPoStPeriodDeadlines) - params = mkParams() - params.ProvingDeadline = currentDeadlineIdx - submitAndFail(¶ms, fmt.Sprintf("proving deadline %d must not be the current or next deadline", currentDeadlineIdx), 18) - params.ProvingDeadline = currentDeadlineIdx + 1 - submitAndFail(¶ms, fmt.Sprintf("proving deadline %d must not be the current or next deadline", currentDeadlineIdx+1), 18) - params.ProvingDeadline = di.WPoStPeriodDeadlines // too big - submitAndFail(¶ms, fmt.Sprintf("proving deadline index %d invalid", di.WPoStPeriodDeadlines), 16) + t.Run("message rejection on no sectors", func(t *testing.T) { + params := mkParams() + params.Sectors = []miner14.SectorNIActivationInfo{} + submitAndFail(¶ms, "too few sectors", 16) + }) + + t.Run("message rejection on too many sectors", func(t *testing.T) { + sectorInfos := make([]miner14.SectorNIActivationInfo, 66) + for i := range sectorInfos { + sectorInfos[i] = mkSai() + } + params := mkParams() + params.Sectors = sectorInfos + submitAndFail(¶ms, "too many sectors", 16) + }) + + t.Run("bad aggregation proof type", func(t *testing.T) { + params := mkParams() + params.AggregateProofType = abi.RegisteredAggregationProof_SnarkPackV1 + submitAndFail(¶ms, "aggregate proof type", 16) + }) + + t.Run("bad SealerID", func(t *testing.T) { + params := mkParams() + params.Sectors[1].SealerID = 1234 + submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) + }) + + t.Run("bad SealingNumber", func(t *testing.T) { + params := mkParams() + params.Sectors[1].SealingNumber = 1234 + submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) + }) + + t.Run("bad SealedCID", func(t *testing.T) { + params := mkParams() + params.Sectors[1].SealedCID = cid.MustParse("baga6ea4seaqjtovkwk4myyzj56eztkh5pzsk5upksan6f5outesy62bsvl4dsha") + submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) + }) + + t.Run("bad SealRandEpoch", func(t *testing.T) { + head, err = miner.FullNode.ChainHead(ctx) + req.NoError(err) + params := mkParams() + params.Sectors[1].SealRandEpoch = head.Height() + builtin.EpochsInDay + submitAndFail(¶ms, fmt.Sprintf("seal challenge epoch %d must be before now", params.Sectors[1].SealRandEpoch), 16) + params.Sectors[1].SealRandEpoch = head.Height() - miner14.MaxProveCommitNiLookback - builtin.EpochsInDay + submitAndFail(¶ms, "invalid NI commit 1 while requiring activation success", 16) + }) + + t.Run("immutable deadlines", func(t *testing.T) { + di, err = miner.FullNode.StateMinerProvingDeadline(ctx, miner.ActorAddr, head.Key()) + req.NoError(err) + currentDeadlineIdx = kit.CurrentDeadlineIndex(di) + + t.Logf("Validating submission failure for current and next deadline. Current Deadline Info: %+v, calculated current deadline: %d.", di, currentDeadlineIdx) + + params := mkParams() + params.ProvingDeadline = currentDeadlineIdx + submitAndFail(¶ms, fmt.Sprintf("proving deadline %d must not be the current or next deadline", currentDeadlineIdx), 18) + params.ProvingDeadline = currentDeadlineIdx + 1 + if params.ProvingDeadline == di.WPoStPeriodDeadlines { + params.ProvingDeadline = 0 + } + msgdline := currentDeadlineIdx + 1 + if msgdline == di.WPoStPeriodDeadlines { + msgdline = 0 + } + submitAndFail(¶ms, fmt.Sprintf("proving deadline %d must not be the current or next deadline", msgdline), 18) + params.ProvingDeadline = di.WPoStPeriodDeadlines // too big + submitAndFail(¶ms, fmt.Sprintf("proving deadline index %d invalid", di.WPoStPeriodDeadlines), 16) + }) } diff --git a/lib/sqlite/sqlite.go b/lib/sqlite/sqlite.go new file mode 100644 index 00000000000..cb489284c9a --- /dev/null +++ b/lib/sqlite/sqlite.go @@ -0,0 +1,169 @@ +package sqlite + +import ( + "context" + "database/sql" + "errors" + "io/fs" + "os" + "path/filepath" + "strconv" + "time" + + logging "github.com/ipfs/go-log/v2" + "golang.org/x/xerrors" +) + +var log = logging.Logger("sqlite") + +type MigrationFunc func(ctx context.Context, tx *sql.Tx) error + +var pragmas = []string{ + "PRAGMA synchronous = normal", + "PRAGMA temp_store = memory", + "PRAGMA mmap_size = 30000000000", + "PRAGMA page_size = 32768", + "PRAGMA auto_vacuum = NONE", + "PRAGMA automatic_index = OFF", + "PRAGMA journal_mode = WAL", + "PRAGMA wal_autocheckpoint = 256", // checkpoint @ 256 pages + "PRAGMA journal_size_limit = 0", // always reset journal and wal files +} + +const metaTableDdl = `CREATE TABLE IF NOT EXISTS _meta ( + version UINT64 NOT NULL UNIQUE +)` + +// metaDdl returns the DDL statements required to create the _meta table and add the required +// up to the given version. +func metaDdl(version uint64) []string { + var ddls []string + for i := 1; i <= int(version); i++ { + ddls = append(ddls, `INSERT OR IGNORE INTO _meta (version) VALUES (`+strconv.Itoa(i)+`)`) + } + return append([]string{metaTableDdl}, ddls...) +} + +// Open opens a database at the given path. If the database does not exist, it will be created. +func Open(path string) (*sql.DB, bool, error) { + if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { + return nil, false, xerrors.Errorf("error creating database base directory [@ %s]: %w", path, err) + } + + _, err := os.Stat(path) + if err != nil && !errors.Is(err, fs.ErrNotExist) { + return nil, false, xerrors.Errorf("error checking file status for database [@ %s]: %w", path, err) + } + exists := err == nil + + db, err := sql.Open("sqlite3", path+"?mode=rwc") + if err != nil { + return nil, false, xerrors.Errorf("error opening database [@ %s]: %w", path, err) + } + + for _, pragma := range pragmas { + if _, err := db.Exec(pragma); err != nil { + _ = db.Close() + return nil, false, xerrors.Errorf("error setting database pragma %q: %w", pragma, err) + } + } + + return db, exists, nil +} + +// InitDb initializes the database by checking whether it needs to be created or upgraded. +// The ddls are the DDL statements to create the tables in the database and their initial required +// content. The schemaVersion will be set inside the databse if it is newly created. Otherwise, the +// version is read from the databse and returned. This value should be checked against the expected +// version to determine if the database needs to be upgraded. +// It is up to the caller to close the database if an error is returned by this function. +func InitDb( + ctx context.Context, + name string, + db *sql.DB, + ddls []string, + versionMigrations []MigrationFunc, +) error { + + schemaVersion := len(versionMigrations) + 1 + + q, err := db.QueryContext(ctx, "SELECT name FROM sqlite_master WHERE type='table' AND name='_meta';") + if q != nil { + defer func() { _ = q.Close() }() + } + + if errors.Is(err, sql.ErrNoRows) || !q.Next() { + // empty database, create the schema including the _meta table and its versions + ddls := append(metaDdl(uint64(schemaVersion)), ddls...) + for _, ddl := range ddls { + if _, err := db.Exec(ddl); err != nil { + return xerrors.Errorf("failed to %s database execute ddl %q: %w", name, ddl, err) + } + } + return nil + } + + if err != nil { + return xerrors.Errorf("error looking for %s database _meta table: %w", name, err) + } + + if err := q.Close(); err != nil { + return xerrors.Errorf("error closing %s database _meta table query: %w", name, err) + } + + // check the schema version to see if we need to upgrade the database schema + var foundVersion int + if err = db.QueryRow("SELECT max(version) FROM _meta").Scan(&foundVersion); err != nil { + return xerrors.Errorf("invalid %s database version: no version found", name) + } + + if foundVersion > schemaVersion { + return xerrors.Errorf("invalid %s database version: version %d is greater than the number of migrations %d", name, foundVersion, len(versionMigrations)) + } + + runVacuum := foundVersion != schemaVersion + + // run a migration for each version that we have not yet applied, where foundVersion is what is + // currently in the database and schemaVersion is the target version. If they are the same, + // nothing is run. + for i := foundVersion + 1; i <= schemaVersion; i++ { + now := time.Now() + + log.Infof("Migrating %s database to version %d...", name, i) + + tx, err := db.BeginTx(ctx, nil) + if err != nil { + return xerrors.Errorf("failed to start %s database transaction: %w", name, err) + } + defer func() { _ = tx.Rollback() }() + // versions start at 1, but the migrations are 0-indexed where the first migration would take us to version 2 + if err := versionMigrations[i-2](ctx, tx); err != nil { + return xerrors.Errorf("failed to migrate %s database to version %d: %w", name, i, err) + } + if _, err := tx.ExecContext(ctx, `INSERT OR IGNORE INTO _meta (version) VALUES (?)`, i); err != nil { + return xerrors.Errorf("failed to update %s database _meta table: %w", name, err) + } + if err := tx.Commit(); err != nil { + return xerrors.Errorf("failed to commit %s database v%d migration transaction: %w", name, i, err) + } + + log.Infof("Successfully migrated %s database from version %d to %d in %s", name, i-1, i, time.Since(now)) + } + + if runVacuum { + // During the large migrations, we have likely increased the WAL size a lot, so lets do some + // simple DB administration to free up space (VACUUM followed by truncating the WAL file) + // as this would be a good time to do it when no other writes are happening. + log.Infof("Performing %s database vacuum and wal checkpointing to free up space after the migration", name) + _, err := db.ExecContext(ctx, "VACUUM") + if err != nil { + log.Warnf("error vacuuming %s database: %s", name, err) + } + _, err = db.ExecContext(ctx, "PRAGMA wal_checkpoint(TRUNCATE)") + if err != nil { + log.Warnf("error checkpointing %s database wal: %s", name, err) + } + } + + return nil +} diff --git a/lib/sqlite/sqlite_test.go b/lib/sqlite/sqlite_test.go new file mode 100644 index 00000000000..bda6432f5e6 --- /dev/null +++ b/lib/sqlite/sqlite_test.go @@ -0,0 +1,242 @@ +package sqlite_test + +import ( + "context" + "database/sql" + "path/filepath" + "strings" + "testing" + + _ "github.com/mattn/go-sqlite3" + "github.com/stretchr/testify/require" + + "github.com/filecoin-project/lotus/lib/sqlite" +) + +func TestSqlite(t *testing.T) { + req := require.New(t) + + ddl := []string{ + `CREATE TABLE IF NOT EXISTS blip ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + blip_name TEXT NOT NULL + )`, + `CREATE TABLE IF NOT EXISTS bloop ( + blip_id INTEGER NOT NULL, + bloop_name TEXT NOT NULL, + FOREIGN KEY (blip_id) REFERENCES blip(id) + )`, + `CREATE INDEX IF NOT EXISTS blip_name_index ON blip (blip_name)`, + } + + tmpDir := t.TempDir() + dbPath := filepath.Join(tmpDir, "/test.db") + + db, exists, err := sqlite.Open(dbPath) + req.NoError(err) + req.False(exists) + req.NotNil(db) + + err = sqlite.InitDb(context.Background(), "testdb", db, ddl, nil) + req.NoError(err) + + // insert some data + + r, err := db.Exec("INSERT INTO blip (blip_name) VALUES ('blip1')") + req.NoError(err) + id, err := r.LastInsertId() + req.NoError(err) + req.Equal(int64(1), id) + _, err = db.Exec("INSERT INTO bloop (blip_id, bloop_name) VALUES (?, 'bloop1')", id) + req.NoError(err) + r, err = db.Exec("INSERT INTO blip (blip_name) VALUES ('blip2')") + req.NoError(err) + id, err = r.LastInsertId() + req.NoError(err) + req.Equal(int64(2), id) + _, err = db.Exec("INSERT INTO bloop (blip_id, bloop_name) VALUES (?, 'bloop2')", id) + req.NoError(err) + + // check that the db contains what we think it should + + expectedIndexes := []string{"blip_name_index"} + + expectedData := []tabledata{ + { + name: "_meta", + cols: []string{"version"}, + data: [][]interface{}{ + {int64(1)}, + }, + }, + { + name: "blip", + cols: []string{"id", "blip_name"}, + data: [][]interface{}{ + {int64(1), "blip1"}, + {int64(2), "blip2"}, + }, + }, + { + name: "bloop", + cols: []string{"blip_id", "bloop_name"}, + data: [][]interface{}{ + {int64(1), "bloop1"}, + {int64(2), "bloop2"}, + }, + }, + } + + actualIndexes, actualData := dumpTables(t, db) + req.Equal(expectedIndexes, actualIndexes) + req.Equal(expectedData, actualData) + + req.NoError(db.Close()) + + // open again, check contents is the same + + db, exists, err = sqlite.Open(dbPath) + req.NoError(err) + req.True(exists) + req.NotNil(db) + + err = sqlite.InitDb(context.Background(), "testdb", db, ddl, nil) + req.NoError(err) + + // database should contain the same things + + actualIndexes, actualData = dumpTables(t, db) + req.Equal(expectedIndexes, actualIndexes) + req.Equal(expectedData, actualData) + + req.NoError(db.Close()) + + // open again, with a migration + + db, exists, err = sqlite.Open(dbPath) + req.NoError(err) + req.True(exists) + req.NotNil(db) + + migration1 := func(ctx context.Context, tx *sql.Tx) error { + _, err := tx.Exec("ALTER TABLE blip ADD COLUMN blip_extra TEXT NOT NULL DEFAULT '!'") + return err + } + + err = sqlite.InitDb(context.Background(), "testdb", db, ddl, []sqlite.MigrationFunc{migration1}) + req.NoError(err) + + // also add something new + r, err = db.Exec("INSERT INTO blip (blip_name, blip_extra) VALUES ('blip1', '!!!')") + req.NoError(err) + id, err = r.LastInsertId() + req.NoError(err) + _, err = db.Exec("INSERT INTO bloop (blip_id, bloop_name) VALUES (?, 'bloop3')", id) + req.NoError(err) + + // database should contain new stuff + + expectedData[0].data = append(expectedData[0].data, []interface{}{int64(2)}) // _meta schema version 2 + expectedData[1] = tabledata{ + name: "blip", + cols: []string{"id", "blip_name", "blip_extra"}, + data: [][]interface{}{ + {int64(1), "blip1", "!"}, + {int64(2), "blip2", "!"}, + {int64(3), "blip1", "!!!"}, + }, + } + expectedData[2].data = append(expectedData[2].data, []interface{}{int64(3), "bloop3"}) + + actualIndexes, actualData = dumpTables(t, db) + req.Equal(expectedIndexes, actualIndexes) + req.Equal(expectedData, actualData) + + req.NoError(db.Close()) + + // open again, with another migration + + db, exists, err = sqlite.Open(dbPath) + req.NoError(err) + req.True(exists) + req.NotNil(db) + + migration2 := func(ctx context.Context, tx *sql.Tx) error { + // add an index + _, err := tx.Exec("CREATE INDEX IF NOT EXISTS blip_extra_index ON blip (blip_extra)") + return err + } + + err = sqlite.InitDb(context.Background(), "testdb", db, ddl, []sqlite.MigrationFunc{migration1, migration2}) + req.NoError(err) + + // database should contain new stuff + + expectedData[0].data = append(expectedData[0].data, []interface{}{int64(3)}) // _meta schema version 3 + expectedIndexes = append(expectedIndexes, "blip_extra_index") + + actualIndexes, actualData = dumpTables(t, db) + req.Equal(expectedIndexes, actualIndexes) + req.Equal(expectedData, actualData) + + req.NoError(db.Close()) +} + +func dumpTables(t *testing.T, db *sql.DB) ([]string, []tabledata) { + req := require.New(t) + + var indexes []string + rows, err := db.Query("SELECT name FROM sqlite_master WHERE type='index'") + req.NoError(err) + for rows.Next() { + var name string + err = rows.Scan(&name) + req.NoError(err) + if !strings.Contains(name, "sqlite_autoindex") { + indexes = append(indexes, name) + } + } + + var data []tabledata + rows, err = db.Query("SELECT name, sql FROM sqlite_master WHERE type = 'table'") + req.NoError(err) + for rows.Next() { + var name, sql string + err = rows.Scan(&name, &sql) + req.NoError(err) + if strings.HasPrefix(name, "sqlite") { + continue + } + sqla := strings.Split(sql, "\n") + cols := []string{} + for _, s := range sqla { + // alter table does funky things to the sql, hence the "," ReplaceAll: + s = strings.Split(strings.TrimSpace(strings.ReplaceAll(s, ",", "")), " ")[0] + switch s { + case "CREATE", "FOREIGN", "", ")": + default: + cols = append(cols, s) + } + } + data = append(data, tabledata{name: name, cols: cols}) + rows2, err := db.Query("SELECT * FROM " + name) + req.NoError(err) + for rows2.Next() { + vals := make([]interface{}, len(cols)) + vals2 := make([]interface{}, len(cols)) + for i := range vals { + vals[i] = &vals2[i] + } + err = rows2.Scan(vals...) + req.NoError(err) + data[len(data)-1].data = append(data[len(data)-1].data, vals2) + } + } + return indexes, data +} + +type tabledata struct { + name string + cols []string + data [][]interface{} +} diff --git a/lib/tracing/setup.go b/lib/tracing/setup.go index a72ecdf2396..549e1bb4dee 100644 --- a/lib/tracing/setup.go +++ b/lib/tracing/setup.go @@ -5,8 +5,6 @@ import ( "strings" logging "github.com/ipfs/go-log/v2" - octrace "go.opencensus.io/trace" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/bridge/opencensus" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/sdk/resource" @@ -84,8 +82,6 @@ func SetupJaegerTracing(serviceName string) *tracesdk.TracerProvider { )), tracesdk.WithSampler(tracesdk.AlwaysSample()), ) - otel.SetTracerProvider(tp) - tracer := tp.Tracer(serviceName) - octrace.DefaultTracer = opencensus.NewTracer(tracer) + opencensus.InstallTraceBridge(opencensus.WithTracerProvider(tp)) return tp } diff --git a/lib/ulimit/ulimit.go b/lib/ulimit/ulimit.go index e900f12136e..739802dbf5d 100644 --- a/lib/ulimit/ulimit.go +++ b/lib/ulimit/ulimit.go @@ -11,7 +11,7 @@ import ( logging "github.com/ipfs/go-log/v2" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) var log = logging.Logger("ulimit") @@ -65,7 +65,7 @@ func ManageFdLimit() (changed bool, newLimit uint64, err error) { return false, 0, nil } - targetLimit := build.DefaultFDLimit + targetLimit := buildconstants.DefaultFDLimit userLimit := userMaxFDs() if userLimit > 0 { targetLimit = userLimit diff --git a/lib/ulimit/ulimit_test.go b/lib/ulimit/ulimit_test.go index ad20feb1de9..4b3cf73dfae 100644 --- a/lib/ulimit/ulimit_test.go +++ b/lib/ulimit/ulimit_test.go @@ -13,7 +13,7 @@ import ( "syscall" "testing" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" ) func TestManageFdLimit(t *testing.T) { @@ -22,7 +22,7 @@ func TestManageFdLimit(t *testing.T) { t.Errorf("Cannot manage file descriptors") } - if build.DefaultFDLimit != uint64(16<<10) { + if buildconstants.DefaultFDLimit != uint64(16<<10) { t.Errorf("Maximum file descriptors default value changed") } } diff --git a/miner/miner.go b/miner/miner.go index 4f27c53dbcd..b18e027a28b 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -25,6 +25,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/gen" @@ -588,7 +589,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type // To safeguard against this, we make sure it's been EquivocationDelaySecs since our base was calculated, // then re-calculate it. // If the daemon detected equivocated blocks, those blocks will no longer be in the new base. - m.niceSleep(time.Until(base.ComputeTime.Add(time.Duration(build.EquivocationDelaySecs) * time.Second))) + m.niceSleep(time.Until(base.ComputeTime.Add(time.Duration(buildconstants.EquivocationDelaySecs) * time.Second))) newBase, err := m.GetBestMiningCandidate(ctx) if err != nil { err = xerrors.Errorf("failed to refresh best mining candidate: %w", err) diff --git a/node/builder.go b/node/builder.go index 2ea9dcac55c..0bdb1fab223 100644 --- a/node/builder.go +++ b/node/builder.go @@ -23,6 +23,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/beacon" "github.com/filecoin-project/lotus/chain/index" "github.com/filecoin-project/lotus/chain/types" @@ -114,6 +115,7 @@ const ( HandleDealsKey HandleRetrievalKey RunSectorServiceKey + F3Participation // daemon ExtractApiKey @@ -161,7 +163,7 @@ func defaults() []Option { Override(new(*alerting.Alerting), alerting.NewAlertingSystem), Override(new(dtypes.NodeStartTime), FromVal(dtypes.NodeStartTime(time.Now()))), - Override(CheckFDLimit, modules.CheckFdLimit(build.DefaultFDLimit)), + Override(CheckFDLimit, modules.CheckFdLimit(buildconstants.DefaultFDLimit)), Override(CheckFvmConcurrency, modules.CheckFvmConcurrency()), Override(CheckUDPBufferSize, modules.CheckUDPBufferSize(2048*1024)), diff --git a/node/builder_chain.go b/node/builder_chain.go index b273a168cc1..deda103042d 100644 --- a/node/builder_chain.go +++ b/node/builder_chain.go @@ -6,6 +6,8 @@ import ( "go.uber.org/fx" "golang.org/x/xerrors" + "github.com/filecoin-project/go-f3/manifest" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain" @@ -17,6 +19,7 @@ import ( "github.com/filecoin-project/lotus/chain/exchange" "github.com/filecoin-project/lotus/chain/gen/slashfilter" "github.com/filecoin-project/lotus/chain/index" + "github.com/filecoin-project/lotus/chain/lf3" "github.com/filecoin-project/lotus/chain/market" "github.com/filecoin-project/lotus/chain/messagepool" "github.com/filecoin-project/lotus/chain/messagesigner" @@ -149,6 +152,11 @@ var ChainNode = Options( Override(HandleIncomingMessagesKey, modules.HandleIncomingMessages), Override(HandleIncomingBlocksKey, modules.HandleIncomingBlocks), ), + + If(build.IsF3Enabled(), + Override(new(manifest.ManifestProvider), lf3.NewManifestProvider), + Override(new(*lf3.F3), lf3.New), + ), ) func ConfigFullNode(c interface{}) Option { diff --git a/node/builder_miner.go b/node/builder_miner.go index fddec7785cc..9aaf2fc4bc6 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -141,6 +141,7 @@ func ConfigStorageMiner(c interface{}) Option { Override(new(config.HarmonyDB), cfg.HarmonyDB), Override(new(harmonydb.ITestID), harmonydb.ITestID("")), Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&cfg.Addresses)), + If(build.IsF3Enabled(), Override(F3Participation, modules.F3Participation)), ) } diff --git a/node/impl/full.go b/node/impl/full.go index aef7a75cb2a..cf8048eb3a4 100644 --- a/node/impl/full.go +++ b/node/impl/full.go @@ -34,6 +34,7 @@ type FullNodeAPI struct { full.SyncAPI full.EthAPI full.ActorEventsAPI + full.F3API DS dtypes.MetadataDS NetworkName dtypes.NetworkName diff --git a/node/impl/full/chain.go b/node/impl/full/chain.go index ce677978028..87be3fd0433 100644 --- a/node/impl/full/chain.go +++ b/node/impl/full/chain.go @@ -599,10 +599,6 @@ func (a ChainAPI) ChainExportRangeInternal(ctx context.Context, head, tail types } fileName := filepath.Join(a.Repo.Path(), fmt.Sprintf("snapshot_%d_%d_%d.car", tailTs.Height(), headTs.Height(), time.Now().Unix())) - if err != nil { - return err - } - f, err := os.Create(fileName) if err != nil { return err diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index 27d7002e440..129b89c3cd9 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -27,6 +27,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors" builtinactors "github.com/filecoin-project/lotus/chain/actors/builtin" builtinevm "github.com/filecoin-project/lotus/chain/actors/builtin/evm" @@ -255,7 +256,6 @@ func (a *EthModule) EthGetBlockByNumber(ctx context.Context, blkParam string, fu func (a *EthModule) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) { return a.EthGetTransactionByHashLimited(ctx, txHash, api.LookbackNoLimit) - } func (a *EthModule) EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error) { @@ -485,7 +485,7 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, Value: big.Zero(), Method: builtintypes.MethodsEVM.GetBytecode, Params: nil, - GasLimit: build.BlockGasLimit, + GasLimit: buildconstants.BlockGasLimit, GasFeeCap: big.Zero(), GasPremium: big.Zero(), } @@ -583,7 +583,7 @@ func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAdd Value: big.Zero(), Method: builtintypes.MethodsEVM.GetStorageAt, Params: params, - GasLimit: build.BlockGasLimit, + GasLimit: buildconstants.BlockGasLimit, GasFeeCap: big.Zero(), GasPremium: big.Zero(), } @@ -651,7 +651,7 @@ func (a *EthModule) EthGetBalance(ctx context.Context, address ethtypes.EthAddre } func (a *EthModule) EthChainId(ctx context.Context) (ethtypes.EthUint64, error) { - return ethtypes.EthUint64(build.Eip155ChainId), nil + return ethtypes.EthUint64(buildconstants.Eip155ChainId), nil } func (a *EthModule) EthSyncing(ctx context.Context) (ethtypes.EthSyncingResult, error) { @@ -734,6 +734,7 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth ) for blocksIncluded < int(params.BlkCount) && ts.Height() > 0 { + basefee = ts.Blocks()[0].ParentBaseFee _, msgs, rcpts, err := executeTipset(ctx, ts, a.Chain, a.StateAPI) if err != nil { return ethtypes.EthFeeHistory{}, xerrors.Errorf("failed to retrieve messages and receipts for height %d: %w", ts.Height(), err) @@ -749,7 +750,7 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth } rewards, totalGasUsed := calculateRewardsAndGasUsed(rewardPercentiles, txGasRewards) - maxGas := build.BlockGasLimit * int64(len(ts.Blocks())) + maxGas := buildconstants.BlockGasLimit * int64(len(ts.Blocks())) // arrays should be reversed at the end baseFeeArray = append(baseFeeArray, ethtypes.EthBigInt(basefee)) @@ -788,7 +789,7 @@ func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (eth } func (a *EthModule) NetVersion(_ context.Context) (string, error) { - return strconv.FormatInt(build.Eip155ChainId, 10), nil + return strconv.FormatInt(buildconstants.Eip155ChainId, 10), nil } func (a *EthModule) NetListening(ctx context.Context) (bool, error) { @@ -830,6 +831,11 @@ func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.Et return ethtypes.EmptyEthHash, err } + txHash, err := txArgs.TxHash() + if err != nil { + return ethtypes.EmptyEthHash, err + } + smsg, err := ethtypes.ToSignedFilecoinMessage(txArgs) if err != nil { return ethtypes.EmptyEthHash, err @@ -840,6 +846,12 @@ func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.Et return ethtypes.EmptyEthHash, err } + // make it immediately available in the transaction hash lookup db, even though it will also + // eventually get there via the mpool + if err := a.EthTxHashManager.TransactionHashLookup.UpsertHash(txHash, smsg.Cid()); err != nil { + log.Errorf("error inserting tx mapping to db: %s", err) + } + return ethtypes.EthHashFromTxBytes(rawTx), nil } @@ -1093,7 +1105,7 @@ func (a *EthModule) EthEstimateGas(ctx context.Context, p jsonrpc.RawParams) (et // So we re-execute the message with EthCall (well, applyMessage which contains the // guts of EthCall). This will give us an ethereum specific error with revert // information. - msg.GasLimit = build.BlockGasLimit + msg.GasLimit = buildconstants.BlockGasLimit if _, err2 := a.applyMessage(ctx, msg, ts.Key()); err2 != nil { err = err2 } @@ -1156,8 +1168,8 @@ func gasSearch( low = high high = high * 2 - if high > build.BlockGasLimit { - high = build.BlockGasLimit + if high > buildconstants.BlockGasLimit { + high = buildconstants.BlockGasLimit break } } @@ -1275,9 +1287,17 @@ func (e *EthEventHandler) EthGetLogs(ctx context.Context, filterSpec *ethtypes.E if pf.tipsetCid == cid.Undef { maxHeight := pf.maxHeight if maxHeight == -1 { - maxHeight = e.Chain.GetHeaviestTipSet().Height() + // heaviest tipset doesn't have events because its messages haven't been executed yet + maxHeight = e.Chain.GetHeaviestTipSet().Height() - 1 + } + + if maxHeight < 0 { + return nil, xerrors.Errorf("maxHeight requested is less than 0") } - if maxHeight > e.Chain.GetHeaviestTipSet().Height() { + + // we can't return events for the heaviest tipset as the transactions in that tipset will be executed + // in the next non null tipset (because of Filecoin's "deferred execution" model) + if maxHeight > e.Chain.GetHeaviestTipSet().Height()-1 { return nil, xerrors.Errorf("maxHeight requested is greater than the heaviest tipset") } @@ -1285,13 +1305,13 @@ func (e *EthEventHandler) EthGetLogs(ctx context.Context, filterSpec *ethtypes.E if err != nil { return nil, err } - - // should also have the minHeight in the filter indexed - if b, err := e.EventFilterManager.EventIndex.IsHeightProcessed(ctx, uint64(pf.minHeight)); err != nil { - return nil, xerrors.Errorf("failed to check if event index has events for the minHeight: %w", err) - } else if !b { - return nil, xerrors.Errorf("event index does not have event for epoch %d", pf.minHeight) - } + // TODO: Ideally we should also check that events for the epoch at `pf.minheight` have been indexed + // However, it is currently tricky to check/guarantee this for two reasons: + // a) Event Index is not aware of null-blocks. This means that the Event Index wont be able to say whether the block at + // `pf.minheight` is a null block or whether it has no events + // b) There can be holes in the index where events at certain epoch simply haven't been indexed because of edge cases around + // node restarts while indexing. This needs a long term "auto-repair"/"automated-backfilling" implementation in the index + // So, for now, the best we can do is ensure that the event index has evenets for events at height >= `pf.maxHeight` } else { ts, err := e.Chain.GetTipSetByCid(ctx, pf.tipsetCid) if err != nil { @@ -1323,6 +1343,8 @@ func (e *EthEventHandler) EthGetLogs(ctx context.Context, filterSpec *ethtypes.E return ethFilterResultFromEvents(ctx, ces, e.SubManager.StateAPI) } +// note that we can have null blocks at the given height and the event Index is not null block aware +// so, what we do here is wait till we see the event index contain a block at a height greater than the given height func (e *EthEventHandler) waitForHeightProcessed(ctx context.Context, height abi.ChainEpoch) error { ei := e.EventFilterManager.EventIndex if height > e.Chain.GetHeaviestTipSet().Height() { @@ -1333,7 +1355,7 @@ func (e *EthEventHandler) waitForHeightProcessed(ctx context.Context, height abi defer cancel() // if the height we're interested in has already been indexed -> there's nothing to do here - if b, err := ei.IsHeightProcessed(ctx, uint64(height)); err != nil { + if b, err := ei.IsHeightPast(ctx, uint64(height)); err != nil { return xerrors.Errorf("failed to check if event index has events for given height: %w", err) } else if b { return nil @@ -1344,7 +1366,7 @@ func (e *EthEventHandler) waitForHeightProcessed(ctx context.Context, height abi defer unSubscribeF() // it could be that the event index was update while the subscription was being processed -> check if index has what we need now - if b, err := ei.IsHeightProcessed(ctx, uint64(height)); err != nil { + if b, err := ei.IsHeightPast(ctx, uint64(height)); err != nil { return xerrors.Errorf("failed to check if event index has events for given height: %w", err) } else if b { return nil @@ -1353,7 +1375,7 @@ func (e *EthEventHandler) waitForHeightProcessed(ctx context.Context, height abi for { select { case <-subCh: - if b, err := ei.IsHeightProcessed(ctx, uint64(height)); err != nil { + if b, err := ei.IsHeightPast(ctx, uint64(height)); err != nil { return xerrors.Errorf("failed to check if event index has events for given height: %w", err) } else if b { return nil diff --git a/node/impl/full/eth_trace.go b/node/impl/full/eth_trace.go index e4e5d794d0e..1666dab774a 100644 --- a/node/impl/full/eth_trace.go +++ b/node/impl/full/eth_trace.go @@ -103,8 +103,8 @@ func baseEnvironment(st *state.StateTree, from address.Address) (*environment, e } func traceToAddress(act *types.ActorTrace) ethtypes.EthAddress { - if act.State.Address != nil { - if addr, err := ethtypes.EthAddressFromFilecoinAddress(*act.State.Address); err == nil { + if act.State.DelegatedAddress != nil { + if addr, err := ethtypes.EthAddressFromFilecoinAddress(*act.State.DelegatedAddress); err == nil { return addr } } @@ -446,7 +446,7 @@ func decodeCreateViaEAM(et *types.ExecutionTrace) (initcode []byte, addr *ethtyp } ret, err := decodeReturn[eam12.CreateReturn](&et.MsgRct) if err != nil { - return nil, (*ethtypes.EthAddress)(&ret.EthAddress), err + return nil, nil, err } return initcode, (*ethtypes.EthAddress)(&ret.EthAddress), nil } diff --git a/node/impl/full/eth_utils.go b/node/impl/full/eth_utils.go index a5799b0dda4..d67bb26fb44 100644 --- a/node/impl/full/eth_utils.go +++ b/node/impl/full/eth_utils.go @@ -21,6 +21,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/state" @@ -202,7 +203,7 @@ func ethCallToFilecoinMessage(ctx context.Context, tx ethtypes.EthCall) (*types. Value: big.Int(tx.Value), Method: method, Params: params, - GasLimit: build.BlockGasLimit, + GasLimit: buildconstants.BlockGasLimit, GasFeeCap: big.Zero(), GasPremium: big.Zero(), }, nil @@ -419,9 +420,9 @@ func lookupEthAddress(addr address.Address, st *state.StateTree) (ethtypes.EthAd } else if err != nil { // Any other error -> fail. return ethtypes.EthAddress{}, err - } else if actor.Address == nil { + } else if actor.DelegatedAddress == nil { // No delegated address -> use masked ID address. - } else if ethAddr, err := ethtypes.EthAddressFromFilecoinAddress(*actor.Address); err == nil && !ethAddr.IsMaskedID() { + } else if ethAddr, err := ethtypes.EthAddressFromFilecoinAddress(*actor.DelegatedAddress); err == nil && !ethAddr.IsMaskedID() { // Conversable into an eth address, use it. return ethAddr, nil } @@ -558,7 +559,7 @@ func ethTxFromNativeMessage(msg *types.Message, st *state.StateTree) (ethtypes.E From: from, Input: encodeFilecoinParamsAsABI(msg.Method, codec, msg.Params), Nonce: ethtypes.EthUint64(msg.Nonce), - ChainID: ethtypes.EthUint64(build.Eip155ChainId), + ChainID: ethtypes.EthUint64(buildconstants.Eip155ChainId), Value: ethtypes.EthBigInt(msg.Value), Type: ethtypes.EIP1559TxType, Gas: ethtypes.EthUint64(msg.GasLimit), @@ -700,7 +701,7 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook BlockNumber: blockNumber, Type: ethtypes.EthUint64(2), Logs: []ethtypes.EthLog{}, // empty log array is compulsory when no logs, or libraries like ethers.js break - LogsBloom: ethtypes.EmptyEthBloom[:], + LogsBloom: ethtypes.NewEmptyEthBloom(), } if lookup.Receipt.ExitCode.IsSuccess() { diff --git a/node/impl/full/f3.go b/node/impl/full/f3.go new file mode 100644 index 00000000000..0ee4da5805b --- /dev/null +++ b/node/impl/full/f3.go @@ -0,0 +1,66 @@ +package full + +import ( + "context" + "errors" + "time" + + "go.uber.org/fx" + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-f3/certs" + "github.com/filecoin-project/go-f3/gpbft" + + "github.com/filecoin-project/lotus/chain/lf3" + "github.com/filecoin-project/lotus/chain/types" +) + +type F3API struct { + fx.In + + F3 *lf3.F3 `optional:"true"` +} + +var ErrF3Disabled = errors.New("f3 is disabled") + +func (f3api *F3API) F3Participate(ctx context.Context, miner address.Address, + newLeaseExpiration time.Time, oldLeaseExpiration time.Time) (bool, error) { + + if leaseDuration := time.Until(newLeaseExpiration); leaseDuration > 5*time.Minute { + return false, xerrors.Errorf("F3 participation lease too long: %v > 5 min", leaseDuration) + } else if leaseDuration < 0 { + return false, xerrors.Errorf("F3 participation lease is in the past: %d < 0", leaseDuration) + } + + if f3api.F3 == nil { + log.Infof("F3Participate called for %v, F3 is disabled", miner) + return false, ErrF3Disabled + } + minerID, err := address.IDFromAddress(miner) + if err != nil { + return false, xerrors.Errorf("miner address is not of ID type: %v: %w", miner, err) + } + + return f3api.F3.Participate(ctx, minerID, newLeaseExpiration, oldLeaseExpiration), nil +} + +func (f3api *F3API) F3GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) { + if f3api.F3 == nil { + return nil, ErrF3Disabled + } + return f3api.F3.GetCert(ctx, instance) +} + +func (f3api *F3API) F3GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) { + if f3api.F3 == nil { + return nil, ErrF3Disabled + } + return f3api.F3.GetLatestCert(ctx) +} +func (f3api *F3API) F3GetPowerTable(ctx context.Context, tsk types.TipSetKey) (gpbft.PowerEntries, error) { + if f3api.F3 == nil { + return nil, ErrF3Disabled + } + return f3api.F3.GetPowerTable(ctx, tsk) +} diff --git a/node/impl/full/gas.go b/node/impl/full/gas.go index c5b22354a52..3f105e63753 100644 --- a/node/impl/full/gas.go +++ b/node/impl/full/gas.go @@ -19,6 +19,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" lbuiltin "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/messagepool" "github.com/filecoin-project/lotus/chain/stmgr" @@ -128,7 +129,7 @@ func gasEstimateFeeCap(cstore *store.ChainStore, msg *types.Message, maxqueueblk ts := cstore.GetHeaviestTipSet() parentBaseFee := ts.Blocks()[0].ParentBaseFee - increaseFactor := math.Pow(1.+1./float64(build.BaseFeeMaxChangeDenom), float64(maxqueueblks)) + increaseFactor := math.Pow(1.+1./float64(buildconstants.BaseFeeMaxChangeDenom), float64(maxqueueblks)) feeInFuture := types.BigMul(parentBaseFee, types.NewInt(uint64(increaseFactor*(1<<8)))) out := types.BigDiv(feeInFuture, types.NewInt(1<<8)) @@ -147,8 +148,8 @@ func medianGasPremium(prices []GasMeta, blocks int) abi.TokenAmount { return prices[i].Price.GreaterThan(prices[j].Price) }) - at := build.BlockGasTarget * int64(blocks) / 2 // 50th - at += build.BlockGasTarget * int64(blocks) / (2 * 20) // move 5% further + at := buildconstants.BlockGasTarget * int64(blocks) / 2 // 50th + at += buildconstants.BlockGasTarget * int64(blocks) / (2 * 20) // move 5% further prev1, prev2 := big.Zero(), big.Zero() for _, price := range prices { prev1, prev2 = price.Price, prev1 @@ -310,7 +311,7 @@ func gasEstimateGasLimit( currTs *types.TipSet, ) (int64, error) { msg := *msgIn - msg.GasLimit = build.BlockGasLimit + msg.GasLimit = buildconstants.BlockGasLimit msg.GasFeeCap = big.Zero() msg.GasPremium = big.Zero() @@ -390,8 +391,8 @@ func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Messag msg.GasLimit = int64(float64(gasLimit) * m.Mpool.GetConfig().GasLimitOverestimation) // Gas overestimation can cause us to exceed the block gas limit, cap it. - if msg.GasLimit > build.BlockGasLimit { - msg.GasLimit = build.BlockGasLimit + if msg.GasLimit > buildconstants.BlockGasLimit { + msg.GasLimit = buildconstants.BlockGasLimit } } diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index 8fc585bd544..ee4ca3b9850 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -8,35 +8,35 @@ import ( "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/types" ) func TestMedian(t *testing.T) { //stm: @MARKET_GAS_GET_MEDIAN_PREMIUM_001 require.Equal(t, types.NewInt(5), medianGasPremium([]GasMeta{ - {big.NewInt(5), build.BlockGasTarget}, + {big.NewInt(5), buildconstants.BlockGasTarget}, }, 1)) require.Equal(t, types.NewInt(10), medianGasPremium([]GasMeta{ - {big.NewInt(5), build.BlockGasTarget}, - {big.NewInt(10), build.BlockGasTarget}, + {big.NewInt(5), buildconstants.BlockGasTarget}, + {big.NewInt(10), buildconstants.BlockGasTarget}, }, 1)) require.Equal(t, types.NewInt(15), medianGasPremium([]GasMeta{ - {big.NewInt(10), build.BlockGasTarget / 2}, - {big.NewInt(20), build.BlockGasTarget / 2}, + {big.NewInt(10), buildconstants.BlockGasTarget / 2}, + {big.NewInt(20), buildconstants.BlockGasTarget / 2}, }, 1)) require.Equal(t, types.NewInt(25), medianGasPremium([]GasMeta{ - {big.NewInt(10), build.BlockGasTarget / 2}, - {big.NewInt(20), build.BlockGasTarget / 2}, - {big.NewInt(30), build.BlockGasTarget / 2}, + {big.NewInt(10), buildconstants.BlockGasTarget / 2}, + {big.NewInt(20), buildconstants.BlockGasTarget / 2}, + {big.NewInt(30), buildconstants.BlockGasTarget / 2}, }, 1)) require.Equal(t, types.NewInt(15), medianGasPremium([]GasMeta{ - {big.NewInt(10), build.BlockGasTarget / 2}, - {big.NewInt(20), build.BlockGasTarget / 2}, - {big.NewInt(30), build.BlockGasTarget / 2}, + {big.NewInt(10), buildconstants.BlockGasTarget / 2}, + {big.NewInt(20), buildconstants.BlockGasTarget / 2}, + {big.NewInt(30), buildconstants.BlockGasTarget / 2}, }, 2)) } diff --git a/node/impl/full/mpool.go b/node/impl/full/mpool.go index fac48a3508f..13b7665e059 100644 --- a/node/impl/full/mpool.go +++ b/node/impl/full/mpool.go @@ -16,6 +16,7 @@ import ( "github.com/filecoin-project/lotus/chain/messagepool" "github.com/filecoin-project/lotus/chain/messagesigner" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/node/modules/dtypes" ) @@ -131,14 +132,24 @@ func (a *MpoolAPI) MpoolClear(ctx context.Context, local bool) error { } func (m *MpoolModule) MpoolPush(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error) { + if err := sanityCheckOutgoingMessage(&smsg.Message); err != nil { + return cid.Undef, xerrors.Errorf("message %s from %s with nonce %d failed sanity check: %w", smsg.Cid(), smsg.Message.From, smsg.Message.Nonce, err) + } return m.Mpool.Push(ctx, smsg, true) } func (a *MpoolAPI) MpoolPushUntrusted(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error) { + if err := sanityCheckOutgoingMessage(&smsg.Message); err != nil { + return cid.Undef, xerrors.Errorf("message %s from %s with nonce %d failed sanity check: %w", smsg.Cid(), smsg.Message.From, smsg.Message.Nonce, err) + } return a.Mpool.PushUntrusted(ctx, smsg) } func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) { + if err := sanityCheckOutgoingMessage(msg); err != nil { + return nil, xerrors.Errorf("message from %s failed sanity check: %w", msg.From, err) + } + cp := *msg msg = &cp inMsg := *msg @@ -223,6 +234,11 @@ func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message, spe } func (a *MpoolAPI) MpoolBatchPush(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error) { + for _, msg := range smsgs { + if err := sanityCheckOutgoingMessage(&msg.Message); err != nil { + return nil, xerrors.Errorf("message %s from %s with nonce %d failed sanity check: %w", msg.Cid(), msg.Message.From, msg.Message.Nonce, err) + } + } var messageCids []cid.Cid for _, smsg := range smsgs { smsgCid, err := a.Mpool.Push(ctx, smsg, true) @@ -235,6 +251,11 @@ func (a *MpoolAPI) MpoolBatchPush(ctx context.Context, smsgs []*types.SignedMess } func (a *MpoolAPI) MpoolBatchPushUntrusted(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error) { + for _, msg := range smsgs { + if err := sanityCheckOutgoingMessage(&msg.Message); err != nil { + return nil, xerrors.Errorf("message %s from %s with nonce %d failed sanity check: %w", msg.Cid(), msg.Message.From, msg.Message.Nonce, err) + } + } var messageCids []cid.Cid for _, smsg := range smsgs { smsgCid, err := a.Mpool.PushUntrusted(ctx, smsg) @@ -247,6 +268,11 @@ func (a *MpoolAPI) MpoolBatchPushUntrusted(ctx context.Context, smsgs []*types.S } func (a *MpoolAPI) MpoolBatchPushMessage(ctx context.Context, msgs []*types.Message, spec *api.MessageSendSpec) ([]*types.SignedMessage, error) { + for i, msg := range msgs { + if err := sanityCheckOutgoingMessage(msg); err != nil { + return nil, xerrors.Errorf("message #%d from %s with failed sanity check: %w", i, msg.From, err) + } + } var smsgs []*types.SignedMessage for _, msg := range msgs { smsg, err := a.MpoolPushMessage(ctx, msg, spec) @@ -277,3 +303,19 @@ func (a *MpoolAPI) MpoolGetNonce(ctx context.Context, addr address.Address) (uin func (a *MpoolAPI) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error) { return a.Mpool.Updates(ctx) } + +func sanityCheckOutgoingMessage(msg *types.Message) error { + // Check that the message's TO address is a _valid_ Eth address if it's a delegated address. + // + // It's legal (from a consensus perspective) to send funds to any 0xf410f address as long as + // the payload is at most 54 bytes, but the vast majority of this address space is + // essentially a black-hole. Unfortunately, the conversion from 0x addresses to Filecoin + // native addresses has a few pitfalls (especially with respect to masked ID addresses), so + // we've added this check to the API to avoid accidentally (and avoidably) sending messages + // to these black-hole addresses. + if msg.To.Protocol() == address.Delegated && !ethtypes.IsEthAddress(msg.To) { + return xerrors.Errorf("message recipient %s is a delegated address but not a valid Eth Address", msg.To) + } + + return nil +} diff --git a/node/impl/full/mpool_test.go b/node/impl/full/mpool_test.go new file mode 100644 index 00000000000..c8e44edbfd8 --- /dev/null +++ b/node/impl/full/mpool_test.go @@ -0,0 +1,67 @@ +package full + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/crypto" + + "github.com/filecoin-project/lotus/chain/types" +) + +func TestSanityCheckOutgoingMessage(t *testing.T) { + // fails for invalid delegated address + badTo, err := address.NewFromString("f410f74aaaaaaaaaaaaaaaaaaaaaaaaac5sh2bf3lgta") + require.NoError(t, err) + msg := &types.Message{ + To: badTo, + } + + err = sanityCheckOutgoingMessage(msg) + require.Error(t, err) + require.Contains(t, err.Error(), "is a delegated address but not a valid Eth Address") + + // works for valid delegated address + goodTo, err := address.NewFromString("f410faxfebiima2gp4lduo2k3vt2iuqapuk3logeftky") + require.NoError(t, err) + msg = &types.Message{ + To: goodTo, + } + err = sanityCheckOutgoingMessage(msg) + require.NoError(t, err) + + // works for valid non-delegated address + goodTo, err = address.NewFromString("f1z762skeib2v6zlkvhywmjxbv3dxoiv4hmb6gs4y") + require.NoError(t, err) + msg = &types.Message{ + To: goodTo, + } + err = sanityCheckOutgoingMessage(msg) + require.NoError(t, err) +} + +func TestMpoolPushInvalidDelegatedAddressFails(t *testing.T) { + badTo, err := address.NewFromString("f410f74aaaaaaaaaaaaaaaaaaaaaaaaac5sh2bf3lgta") + require.NoError(t, err) + module := &MpoolModule{} + m := &MpoolAPI{ + MpoolModuleAPI: module, + } + smsg := &types.SignedMessage{ + Message: types.Message{ + From: badTo, + To: badTo, + }, + Signature: crypto.Signature{ + Type: crypto.SigTypeSecp256k1, + Data: []byte("signature"), + }, + } + _, err = m.MpoolPush(context.Background(), smsg) + require.Error(t, err) + + require.Contains(t, err.Error(), "is a delegated address but not a valid Eth Address") +} diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 312d30ee315..332ba00720f 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -30,6 +30,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/datacap" @@ -1929,11 +1930,11 @@ func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParam return &api.NetworkParams{ NetworkName: networkName, - BlockDelaySecs: build.BlockDelaySecs, - ConsensusMinerMinPower: build.ConsensusMinerMinPower, - SupportedProofTypes: build.SupportedProofTypes, - PreCommitChallengeDelay: build.PreCommitChallengeDelay, - Eip155ChainID: build.Eip155ChainId, + BlockDelaySecs: buildconstants.BlockDelaySecs, + ConsensusMinerMinPower: buildconstants.ConsensusMinerMinPower, + SupportedProofTypes: buildconstants.SupportedProofTypes, + PreCommitChallengeDelay: buildconstants.PreCommitChallengeDelay, + Eip155ChainID: buildconstants.Eip155ChainId, ForkUpgradeParams: api.ForkUpgradeParams{ UpgradeSmokeHeight: build.UpgradeSmokeHeight, UpgradeBreezeHeight: build.UpgradeBreezeHeight, @@ -1943,7 +1944,7 @@ func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParam UpgradeRefuelHeight: build.UpgradeRefuelHeight, UpgradeTapeHeight: build.UpgradeTapeHeight, UpgradeKumquatHeight: build.UpgradeKumquatHeight, - BreezeGasTampingDuration: build.BreezeGasTampingDuration, + BreezeGasTampingDuration: buildconstants.BreezeGasTampingDuration, UpgradeCalicoHeight: build.UpgradeCalicoHeight, UpgradePersianHeight: build.UpgradePersianHeight, UpgradeOrangeHeight: build.UpgradeOrangeHeight, diff --git a/node/modules/actorevent.go b/node/modules/actorevent.go index 78ac5b18b84..22c5c5bc587 100644 --- a/node/modules/actorevent.go +++ b/node/modules/actorevent.go @@ -108,7 +108,7 @@ func EventFilterManager(cfg config.EventsConfig) func(helpers.MetricsCtx, repo.L if err != nil { return nil, xerrors.Errorf("failed to resolve event index database path: %w", err) } - dbPath = filepath.Join(sqlitePath, "events.db") + dbPath = filepath.Join(sqlitePath, filter.DefaultDbFilename) } else { dbPath = cfg.DatabasePath } @@ -138,11 +138,11 @@ func EventFilterManager(cfg config.EventsConfig) func(helpers.MetricsCtx, repo.L } actor, err := sm.LoadActor(ctx, idAddr, ts) - if err != nil || actor.Address == nil { + if err != nil || actor.DelegatedAddress == nil { return idAddr, true } - return *actor.Address, true + return *actor.DelegatedAddress, true }, MaxFilterResults: cfg.MaxFilterResults, diff --git a/node/modules/ethmodule.go b/node/modules/ethmodule.go index b36416e4e56..1360daf1a89 100644 --- a/node/modules/ethmodule.go +++ b/node/modules/ethmodule.go @@ -23,18 +23,20 @@ import ( func EthModuleAPI(cfg config.FevmConfig) func(helpers.MetricsCtx, repo.LockedRepo, fx.Lifecycle, *store.ChainStore, *stmgr.StateManager, EventHelperAPI, *messagepool.MessagePool, full.StateAPI, full.ChainAPI, full.MpoolAPI, full.SyncAPI) (*full.EthModule, error) { return func(mctx helpers.MetricsCtx, r repo.LockedRepo, lc fx.Lifecycle, cs *store.ChainStore, sm *stmgr.StateManager, evapi EventHelperAPI, mp *messagepool.MessagePool, stateapi full.StateAPI, chainapi full.ChainAPI, mpoolapi full.MpoolAPI, syncapi full.SyncAPI) (*full.EthModule, error) { + ctx := helpers.LifecycleCtx(mctx, lc) + sqlitePath, err := r.SqlitePath() if err != nil { return nil, err } - dbPath := filepath.Join(sqlitePath, "txhash.db") + dbPath := filepath.Join(sqlitePath, ethhashlookup.DefaultDbFilename) // Check if the db exists, if not, we'll back-fill some entries _, err = os.Stat(dbPath) dbAlreadyExists := err == nil - transactionHashLookup, err := ethhashlookup.NewTransactionHashLookup(dbPath) + transactionHashLookup, err := ethhashlookup.NewTransactionHashLookup(ctx, dbPath) if err != nil { return nil, err } @@ -68,7 +70,6 @@ func EthModuleAPI(cfg config.FevmConfig) func(helpers.MetricsCtx, repo.LockedRep log.Infof("Prefilling GetTipsetByHeight done in %s", time.Since(start)) }() - ctx := helpers.LifecycleCtx(mctx, lc) lc.Append(fx.Hook{ OnStart: func(context.Context) error { ev, err := events.NewEvents(ctx, &evapi) diff --git a/node/modules/lp2p/pubsub.go b/node/modules/lp2p/pubsub.go index 408ab17a63e..67dcb5134a7 100644 --- a/node/modules/lp2p/pubsub.go +++ b/node/modules/lp2p/pubsub.go @@ -3,6 +3,7 @@ package lp2p import ( "context" "encoding/json" + "fmt" "net" "time" @@ -16,6 +17,9 @@ import ( "go.uber.org/fx" "golang.org/x/xerrors" + "github.com/filecoin-project/go-f3/gpbft" + "github.com/filecoin-project/go-f3/manifest" + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/metrics" "github.com/filecoin-project/lotus/node/config" @@ -44,6 +48,12 @@ const ( GraylistScoreThreshold = -2500 AcceptPXScoreThreshold = 1000 OpportunisticGraftScoreThreshold = 3.5 + + // Determines the max. number of configuration changes + // that are allowed for the dynamic manifest. + // If the manifest changes more than this number, the F3 + // message topic will be filtered + MaxDynamicManifestChangesAllowed = 1000 ) func ScoreKeeper() *dtypes.ScoreKeeper { @@ -378,6 +388,32 @@ func GossipSub(in GossipIn) (service *pubsub.PubSub, err error) { build.MessagesTopic(in.Nn), build.IndexerIngestTopic(in.Nn), } + + if build.IsF3Enabled() { + f3TopicName := manifest.PubSubTopicFromNetworkName(gpbft.NetworkName(in.Nn)) + allowTopics = append(allowTopics, f3TopicName) + + // allow dynamic manifest topic and the new topic names after a reconfiguration. + // Note: This is pretty ugly, but I tried to use a regex subscription filter + // as the commented code below, but unfortunately it overwrites previous filters. A simple fix would + // be to allow combining several topic filters, but for now this works. + // + // pattern := fmt.Sprintf(`^\/f3\/%s\/0\.0\.1\/?[0-9]*$`, in.Nn) + // rx, err := regexp.Compile(pattern) + // if err != nil { + // return nil, xerrors.Errorf("failed to compile manifest topic regex: %w", err) + // } + // options = append(options, + // pubsub.WithSubscriptionFilter( + // pubsub.WrapLimitSubscriptionFilter( + // pubsub.NewRegexpSubscriptionFilter(rx), + // 100))) + allowTopics = append(allowTopics, manifest.ManifestPubSubTopicName) + for i := 0; i < MaxDynamicManifestChangesAllowed; i++ { + allowTopics = append(allowTopics, f3TopicName+"/"+fmt.Sprintf("%d", i)) + } + } + allowTopics = append(allowTopics, drandTopics...) options = append(options, pubsub.WithSubscriptionFilter( diff --git a/node/modules/msgindex.go b/node/modules/msgindex.go index 72e9840ba33..423be65d1b7 100644 --- a/node/modules/msgindex.go +++ b/node/modules/msgindex.go @@ -2,6 +2,7 @@ package modules import ( "context" + "path/filepath" "go.uber.org/fx" @@ -17,7 +18,7 @@ func MsgIndex(lc fx.Lifecycle, mctx helpers.MetricsCtx, cs *store.ChainStore, r return nil, err } - msgIndex, err := index.NewMsgIndex(helpers.LifecycleCtx(mctx, lc), basePath, cs) + msgIndex, err := index.NewMsgIndex(helpers.LifecycleCtx(mctx, lc), filepath.Join(basePath, index.DefaultDbFilename), cs) if err != nil { return nil, err } diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 01f293b8f4a..04a0a53768c 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -10,6 +10,7 @@ import ( "github.com/google/uuid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" + "github.com/jpillora/backoff" "go.uber.org/fx" "go.uber.org/multierr" "golang.org/x/xerrors" @@ -32,6 +33,7 @@ import ( "github.com/filecoin-project/lotus/journal" lotusminer "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/config" + "github.com/filecoin-project/lotus/node/impl/full" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/modules/helpers" "github.com/filecoin-project/lotus/node/repo" @@ -351,6 +353,81 @@ func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, lstor *paths.Local, return sst, nil } +func F3Participation(mctx helpers.MetricsCtx, lc fx.Lifecycle, api v1api.FullNode, minerAddress dtypes.MinerAddress) error { + ctx := helpers.LifecycleCtx(mctx, lc) + b := &backoff.Backoff{ + Min: 1 * time.Second, + Max: 1 * time.Minute, + Factor: 1.5, + Jitter: false, + } + go func() { + timer := time.NewTimer(0) + defer timer.Stop() + + if !timer.Stop() { + <-timer.C + } + + leaseTime := 120 * time.Second + // start with some time in the past + oldLease := time.Now().Add(-24 * time.Hour) + + for ctx.Err() == nil { + newLease := time.Now().Add(leaseTime) + + ok, err := api.F3Participate(ctx, address.Address(minerAddress), newLease, oldLease) + + if ctx.Err() != nil { + return + } + if errors.Is(err, full.ErrF3Disabled) { + log.Errorf("Cannot participate in F3 as it is disabled: %+v", err) + return + } + if err != nil { + log.Errorf("while starting to participate in F3: %+v", err) + // use exponential backoff to avoid hotloop + timer.Reset(b.Duration()) + select { + case <-ctx.Done(): + return + case <-timer.C: + } + continue + } + if !ok { + log.Errorf("lotus node refused our lease, are you loadbalancing or did the miner just restart?") + + sleepFor := b.Duration() + if d := time.Until(oldLease); d > 0 && d < sleepFor { + sleepFor = d + } + timer.Reset(sleepFor) + select { + case <-ctx.Done(): + return + case <-timer.C: + } + continue + } + + // we have succeeded in giving a lease, reset the backoff + b.Reset() + + oldLease = newLease + // wait for the half of the lease time and then refresh + timer.Reset(leaseTime / 2) + select { + case <-ctx.Done(): + return + case <-timer.C: + } + } + }() + return nil +} + func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sealer.StorageAuth, error) { token, err := ca.AuthNew(ctx, []auth.Permission{"admin"}) if err != nil { diff --git a/storage/sectorblocks/blocks.go b/storage/sectorblocks/blocks.go index 4b84e18fbcb..9affdac008f 100644 --- a/storage/sectorblocks/blocks.go +++ b/storage/sectorblocks/blocks.go @@ -23,12 +23,6 @@ import ( "github.com/filecoin-project/lotus/storage/sealer/storiface" ) -type SealSerialization uint8 - -const ( - SerializationUnixfs0 SealSerialization = 'u' -) - var dsPrefix = datastore.NewKey("/sealedblocks") var ErrNotFound = errors.New("not found") diff --git a/tools/stats/points/collect.go b/tools/stats/points/collect.go index 8b86695742e..24be14a6a96 100644 --- a/tools/stats/points/collect.go +++ b/tools/stats/points/collect.go @@ -18,6 +18,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/build/buildconstants" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/power" @@ -203,11 +204,11 @@ func (c *ChainPointCollector) collectBlockheaderPoints(ctx context.Context, pl * } { blks := int64(len(cids)) - p = influx.NewPoint("chain.gas_fill_ratio", float64(totalGasLimit)/float64(blks*build.BlockGasTarget)) + p = influx.NewPoint("chain.gas_fill_ratio", float64(totalGasLimit)/float64(blks*buildconstants.BlockGasTarget)) pl.AddPoint(p) - p = influx.NewPoint("chain.gas_capacity_ratio", float64(totalUniqGasLimit)/float64(blks*build.BlockGasTarget)) + p = influx.NewPoint("chain.gas_capacity_ratio", float64(totalUniqGasLimit)/float64(blks*buildconstants.BlockGasTarget)) pl.AddPoint(p) - p = influx.NewPoint("chain.gas_waste_ratio", float64(totalGasLimit-totalUniqGasLimit)/float64(blks*build.BlockGasTarget)) + p = influx.NewPoint("chain.gas_waste_ratio", float64(totalGasLimit-totalUniqGasLimit)/float64(blks*buildconstants.BlockGasTarget)) pl.AddPoint(p) }