Compare commits

..

102 Commits

Author SHA1 Message Date
i-norden
1735a6f308 add index to event.emitter_addr 2024-03-28 02:10:00 +00:00
Fridrik Asmundsson
75c7f16765 Add block param to EthEstimateGas 2024-03-28 02:10:00 +00:00
i-norden
2e372edde4 add index to event.emitter_addr 2024-03-28 02:09:59 +00:00
i-norden
ff21559244 add index to event_entry.key 2024-03-28 02:09:59 +00:00
Ian Norden
0a29aa0b6f fix: api: exclude reverted events in eth_getLogs results (#11318)
* exclude reverted events from results returned by eth_getLogs

* unit test

* update CHANGELOG.md
2024-03-28 02:09:59 +00:00
Phi-rjan
9dc9a5cf45
Merge pull request #11790 from filecoin-project/phi-v1261
release: v1.26.1
2024-03-27 21:15:57 +01:00
Phi
e215381f84 Update changelog, version, make gen
- Update changelog
- Update version
- Make gen / Make docsgen-cli
2024-03-27 20:29:36 +01:00
Aayush Rajasekaran
4d0d520ffd
feat: nv22: lightweight patch to upgrade calibnet (#11776) 2024-03-27 14:13:00 -04:00
Steven Allen
0cdf58849b Merge branch 'release/v1.26.0' into releases 2024-03-26 10:15:39 -07:00
Phi
5f86ff9a6e Update date PhoenixHeight
Update date PhoenixHeight
2024-03-22 07:00:28 +01:00
Phi
285b8f863f Update date PhoenixHeight
Update date PhoenixHeight
2024-03-22 00:44:21 +01:00
Phi
9fecda4835 make gen, make docsgen-cli
make gen, make docsgen-cli
2024-03-22 00:44:21 +01:00
Phi
a73612cab5 Set mainnet upgrade height
Set mainnet upgrade height
2024-03-22 00:44:21 +01:00
Phi
6016be5c25 Update changelog, bump version
Update changelog, bump version
2024-03-22 00:44:21 +01:00
Phi
dfbedbea05 Update actor bundle, except calib
Update the actor bundle for everything except calibnet: ./pack.sh v13 v13.0.0 calibrationnet=v13.0.0-rc.3
2024-03-21 22:15:58 +01:00
aarshkshah1992
722418ab25 remove cli test 2024-03-21 22:15:58 +01:00
Phi
efb31858e1 chore: deps: bump GST
chore: deps: bump GST
2024-03-21 22:15:58 +01:00
aarshkshah1992
d4edafb7f3 update verified claim tests 2024-03-21 22:15:58 +01:00
Phi
881a8e4569 chore: deps: bump actor bundle
chore: deps: bump actor bundle
2024-03-21 22:15:58 +01:00
Łukasz Magiera
734db29863
feat: shed: Add v13 migration to migrate-state (#11601)
* shed: Add v13 migration to migrate-state

* shed: some ADL tools, update GST

* shed: diff hamt address mode

* shed migration debug tooling

* shed migration: market diff on error

* shed: Fix cached migration diff

* shed: Diff deal states on bad migration

* shed: Use std json

* shed: Drill in the migration diff more

* shed: Show proposals in migration market diff

* shed: Show added provider sectors diff

* shed: hamts are hard to use

* update  gst

* update gst

* update gst

* update GST with fixed invartiant

* go mod tidy
2024-03-21 15:07:49 +01:00
Andrew Jackson (Ajax)
1b66824304 Merge pull request #11616 from filecoin-project/rvagg/build-provider
Add lotus-provider to build to match install
2024-03-21 14:56:53 +01:00
Phi
e0202c3750 Make gen
Make gen
2024-03-21 14:56:53 +01:00
Rod Vagg
4beca9adca fix(events): don't log.Warn for EVM events with non-Raw codec (#11742)
Codec != Raw likely means built-in actor events, which we can safely skip, so
avoid filling up logs with warnings for every built-in actor event that comes
past this point.

Fixes: https://github.com/filecoin-project/lotus/issues/11718
2024-03-21 14:56:53 +01:00
Rod Vagg
d7f59b3d74 feat(events): add "Raw" suffix to {Get,Subscribe}ActorEvents
This is done with the intention to add new {Get,Subscribe}ActorEvents in a
future release (i.e. soon!) with both decoded values (dag-json represented)
and simplified (no flags or codec). But because this comes with some
trade-offs wrt fidelity of information (e.g. likely needing to drop events with
badly encoded values, and not retaining original codec), we need to also have
a Raw form of these APIs for consumers that want to take on the burden of
consuming them as they are.
2024-03-21 14:56:53 +01:00
Aayush Rajasekaran
81f4645fca
chore: deps: update GST to v0.13.0-rc3 (#11732) (#11736)
chore: deps: update GST to v0.13.0-rc3

Co-authored-by: Phi-rjan <orjan.roren@gmail.com>
2024-03-19 15:00:12 -07:00
Steven Allen
10479927eb
chore: deps: update boxo/libp2p/graphsync (#11739)
- Pulls in the latest version of `kubo-api-client` (extracted from kubo
  0.27.0).
- Update go-libp2p to v0.33.0
- Update boxo to v0.18.0
- Update go-graphsync to v0.16.0
2024-03-19 08:33:14 -07:00
Aayush Rajasekaran
dd4bce0efb feat: add ChainGetEvents to the gateway API (#11724) 2024-03-18 10:48:31 -04:00
Steven Allen
4026d0178f chore: build: update minimum go version to 1.21.7 (#11652)
Now that 1.22 is out. Libp2p will also be dropping support for 1.20
soon (if it hasn't already?) so it can _finally_ stop supporting
specific compiler versions (we can stop caring so much about the
"maximum" supported go version).
2024-03-15 07:49:14 -07:00
Phi-rjan
bfb36026c5
release: bump to v1.26.0-rc3 (#11714)
release: bump to v1.26.0-rc2
2024-03-13 18:47:15 +01:00
parthshah1
be2bb0a588 fix: api: Length check the array sent to eth_feeHistory RPC (#11696)
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Steven Allen <steven@stebalien.com>
2024-03-13 08:59:22 -07:00
Phi-rjan
f929ae17d7
Chore: Backports to the release/v1.26.0 branch (#11713)
* enable storing events (#11712)

* fix: commit batch: Always go through commit batcher (#11704)

* fix: commit batch: Always go through commit batcher

* fix sealing fsm tests

* sealing pipeline: Fix panic on padding pieces in WaitDeals (#11708)

* sealing pipeline: Fix panic on padding pieces in WaitDeals

* sealing pipeline: Catch panics

* sealing pipeline: Output DDO pieces in SectorStatus (#11709)

* sealing pipeline: Fix failing ProveCommit3 aggregate (#11710)

* itests: Repro failing ProveCommit3 aggregate

* commit batch: Correctly sort sectors in processBatchV2

* fix imports

* ci: Bigger instance for sector_pledge test

* itests: Use Must-Post mining in TestPledgeBatching

---------

Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2024-03-13 15:25:08 +01:00
Rod Vagg
ea2d0790b4 fix(events): properly disable actor events API via cfg
Now EventFilterManager is received as an interface, setting it to `nil` isn't
enough for the `== nil` checks inside ActorEventHandler.
2024-03-13 16:26:52 +11:00
Phi-rjan
a617f81f4c
Remove calibnet-bootstrappers (#11702)
Remove calibnet-bootstrappers
2024-03-12 11:21:20 -05:00
Rod Vagg
e5ccf1915d feat(config): move Fevm.Events->Events, implement soft deprecation
Closes: https://github.com/filecoin-project/lotus/issues/11679

* Introduce a `moved:"To.New.Config"` tag which prints a stderr warning when
  you use one of these, but will move any set value to the new location if the
	new location isn't already set itself.
* Look for `X is DEPRECATED` to hold certain fields back from documentation.
* Use `toml:"omitempty"` to prevent the default config output from having these
  deprecated values.
2024-03-11 13:53:09 +11:00
Rod Vagg
b4e7374cd5
docs(drand): document the meaning of "IsChained" (#11692) 2024-03-07 07:26:23 -08:00
Jiaying Wang
4a1a7bd29e
Merge pull request #11691 from filecoin-project/jen/v126rc2
release: bump to v1.26.0-rc2
2024-03-07 17:17:07 +08:00
Rod Vagg
2bf2706aa2 Add verification for "deal-activated" actor event 2024-03-07 20:14:18 +11:00
Rod Vagg
b91da8eb32 test: add additional actor events checks 2024-03-07 20:14:18 +11:00
Rod Vagg
5e8cf36e7c test: extract verified DDO test to separate file, add more checks 2024-03-07 20:14:18 +11:00
Rod Vagg
5704f7cadb test: cleanup ddo verified itest, extract steps to functions
also add allocation-removed event case
2024-03-07 20:14:18 +11:00
jennijuju
1a46f7171e bump to v1.26.0-rc2 2024-03-07 05:28:32 +08:00
Aayush Rajasekaran
1f6e556d25
Merge pull request #11690 from filecoin-project/asr/fix-drand-skyr
fix: beacon: validate drand change at nv16 correctly
2024-03-06 13:44:29 -05:00
Aayush
daafe73462 fix: beacon: validate drand change at nv16 correctly 2024-03-06 12:23:09 -05:00
Jiaying Wang
64b32ad632
Merge pull request #11620 from filecoin-project/phi-rc1-prep
build: release: v1.26.0-rc1
2024-03-06 01:23:52 +08:00
Phi
2d1fa77dd9 Make gen
Make gen
2024-03-05 11:20:58 +01:00
Phi-rjan
b78aebe1f5
Update CHANGELOG.md
Co-authored-by: Masih H. Derkani <m@derkani.org>
2024-03-05 10:50:29 +01:00
Phi
7ee155370a Prep Lotus v1.26.0-rc1
- For sanity reverting the mainnet upgrade epoch to 99999999, and then only set it when cutting the final release

-Update Calibnet CIDs to v13.0.0-rc3

- Add GetActorEvents, SubscribeActorEvents, GetAllClaims and GetAllAllocations methods to the changelog

Co-Authored-By: Jiaying Wang <42981373+jennijuju@users.noreply.github.com>
2024-03-05 10:48:52 +01:00
Phi-rjan
35ac102389
Merge pull request #11682 from filecoin-project/update-v13actors-rc
chore: build: Update actor bundle to v13.0.0-rc3
2024-03-05 09:53:24 +01:00
Phi
338b4c7d4a Update actor bundle to v13.0.0-rc3
Update actor bundle to v13.0.0-rc3
2024-03-05 08:58:45 +01:00
Rod Vagg
4dcd65882d Fix concerns and docs identified by review 2024-03-05 16:16:15 +11:00
Rod Vagg
5359a172ed Update changelog for actor events APIs 2024-03-05 16:16:15 +11:00
Masih H. Derkani
7ca966900f Use provided libraries to assert eventual conditions
Use the functionalities already provided by `testify` to assert eventual
conditions, and remove the use of `time.Sleep`.

Remove duplicate code in utility functions that are already defined.

Refactor assertion helper functions to use consistent terminology:
"require" implies fatal error, whereas "assert" implies error where the
test may proceed executing.
2024-03-05 16:16:15 +11:00
Masih H. Derkani
a016747b1f Use fixed RNG seed for actor event tests
Improve determinism in actor event tests by using a fixed RNG seed. This
makes up a more reproducible test suit.
2024-03-05 16:16:15 +11:00
Masih H. Derkani
4c868daf4e Reduce scope for filter removal failure when getting actor events
Use a fresh context to remove the temporary filter installed solely to
get the actor events. This should reduce chances of failure in a case
where the original context may be expired/cancelled.

Refactor removal into a `defer` statement for a more readable, concise
return statement.
2024-03-05 16:16:15 +11:00
Masih H. Derkani
92ce665e5c Run actor events table tests in deterministic order
Refactor `map` usage for actor event table tests to ensure deterministic
test execution order, making debugging potential issues easier. If
non-determinism is a target, leverage Go's built-in parallel testing
capabilities.
2024-03-05 16:16:15 +11:00
Masih H. Derkani
5f39979b4b Rename actor events test to follow go convention
Add missing `s` to `actor_events` test file to follow golang convention
used across the repo.
2024-03-05 16:16:15 +11:00
Masih H. Derkani
85584a44fb Remove duplicate code from actor event type marshalling tests
Reduce verbosity and remove duplicate test logic from actor event types
JSON marshalling tests.
2024-03-05 16:16:15 +11:00
Rod Vagg
f9fef2ad75 More post-review changes, lots of tests for SubscribeActorEvents
Use BlockDelay as the window for receiving events on the SubscribeActorEvents
channel. We expect the user to have received the initial batch of historical
events (if any) in one block's time. For real-time events we expect them to
not fall behind by roughly one block's time.
2024-03-05 16:16:15 +11:00
Rod Vagg
e86bb270ca More clarity in actor event API docs 2024-03-05 16:16:15 +11:00
Rod Vagg
377a3e2157 Document future API changes 2024-03-05 16:16:15 +11:00
Rod Vagg
b12714f092 Terminate SubscribeActorEvents chan when at max height 2024-03-05 16:16:15 +11:00
Rod Vagg
dc0c8639df Manage event sending rate for SubscribeActorEvents 2024-03-05 16:16:15 +11:00
Rod Vagg
c492b491d7 s/ActorEvents/Events/g in global config 2024-03-05 16:16:15 +11:00
Rod Vagg
2194eacc0f Adjust actor event API after review 2024-03-05 16:16:15 +11:00
Rod Vagg
ce38c31121 Rename internal events modules for clarity 2024-03-05 16:16:15 +11:00
Rod Vagg
af6cecbd32 Avoid duplicate messages when looking for receipts 2024-03-05 16:16:15 +11:00
Rod Vagg
256f0b004b Minor tweaks to events types 2024-03-05 16:16:15 +11:00
Rod Vagg
bb311dd0d8 Clean up DDO+Events tests, add lots of explainer comments 2024-03-05 16:16:15 +11:00
Aarsh Shah
01ac45c90a Tests for builtin actor events API 2024-03-05 16:16:15 +11:00
Rod Vagg
cef19d5043 itest for DDO non-market verified data w/ builtin actor events 2024-03-05 16:16:15 +11:00
Aarsh Shah
f007a012af Built-in actor events first draft 2024-03-05 16:16:15 +11:00
Phi-rjan
9aef2ec8b5
Merge pull request #11675 from filecoin-project/phi-bump-gst
chore: deps: update to go-state-types v13.0.0-rc.2
2024-03-04 17:57:48 +01:00
Aayush Rajasekaran
544a16d737 feat: set migration config UpgradeEpoch for v13 actors upgrade 2024-03-04 11:23:32 -05:00
Phi
8cf2bbca3a chore: deps: update to go-state-types v13.0.0-rc.2
chore: deps: update to go-state-types v13.0.0-rc.2
2024-03-04 15:38:28 +01:00
Phi-rjan
62989ff743
Merge pull request #11667 from filecoin-project/phi-backport-11632
chore: backport #11632 to release/v1.26.0
2024-03-01 11:05:36 +01:00
Aayush Rajasekaran
f2bca588b2 Merge pull request #11632 from hanabi1224/hm/drand-test
feat: drand quicknet: allow scheduling drand quicknet upgrade before nv22 on 2k devnet
2024-03-01 10:26:39 +01:00
Phi-rjan
fc6229abf7
Merge pull request #11662 from filecoin-project/asr/migration-nv22
chore: deps: update to go-state-types v13.0.0-rc.1
2024-02-28 13:41:56 +01:00
Aayush
d862e2cb8e do NOT update the cache when running the real migration 2024-02-27 21:07:44 -05:00
Aayush
faf0374570 chore: deps: update to go-state-types v13.0.0-rc.1 2024-02-27 21:03:25 -05:00
tom123222
01ec166e3a
fix: add UpgradePhoenixHeight to StateGetNetworkParams (#11648) 2024-02-27 10:52:23 -08:00
Phi-rjan
9dc29bf3f7
chore:: backport #11609 to the feat/nv22 branch (#11644)
* feat: api: improve the correctness of Eth's trace_block (#11609)

* Improve the correctness of Eth's trace_block

- Improve encoding/decoding of parameters and return values:
  - Encode "native" parameters and return values with Solidity ABI.
  - Correctly decode parameters to "create" calls.
  - Use the correct (ish) output for "create" calls.
  - Handle all forms of "create".
- Make robust with respect to reverts:
  - Use the actor ID/address from the trace instead of looking it up in
    the state-tree (may not exist in the state-tree due to a revert).
  - Gracefully handle failed actor/contract creation.
- Improve performance:
  - We avoid looking anything up in the state-tree when translating the
    trace, which should significantly improve performance.
- Improve code readability:
  - Remove all "backtracking" logic.
  - Use an "environment" struct to store temporary state instead of
    attaching it to the trace.
- Fix random bugs:
  - Fix an allocation bug in the "address" logic (need to set the
    capacity before modifying the slice).
  - Improved error checking/handling.
- Use correct types for `trace_block` action/results (create, call, etc.).
  - And use the correct types for Result/Action structs instead of reusing the same "Call" action every time.
- Improve error messages.

* Make gen

Make gen

---------

Co-authored-by: Steven Allen <steven@stebalien.com>
2024-02-27 07:50:07 -08:00
LexLuthr
92503075a6
feat: api: new verified registry methods to get all allocations and claims (#11631)
* new verireg methods

* update changelog and add itest

* update itest and cli

* update new method's support till v9

* remove gateway APIs

* fix cli internal var names
2024-02-22 10:37:47 -08:00
Aayush Rajasekaran
ddf535d7be Merge pull request #11491 from filecoin-project/fix/remove-decommissioned-pl-bootstrap-nodes
Remove PL operated bootstrap nodes from mainnet.pi
2024-02-22 10:30:10 -08:00
Samuel Arogbonlo
2e5de1bdb3 new: add forest bootstrap nodes (#11636)
Signed-off-by: samuelarogbonlo <sbayo971@gmail.com>
2024-02-21 12:32:50 -08:00
Phi-rjan
8ad534b6c5
Update epoch heights (#11637)
Update epoch heights
2024-02-21 12:01:06 -08:00
Phi-rjan
fe75ee0a12
Merge pull request #11599 from filecoin-project/phi-butterfly-prep
chore: Set upgrade heights and change codename
2024-02-13 17:13:33 +01:00
Phi
65b1977cef Make gen
Make gen and UpgradePhoenixHeight in butterfly and local devnet to be in line with Calibration and Mainnet
2024-02-13 17:01:30 +01:00
Aayush
4f23b068cf set UpgradePhoenixHeight to be one hour after Dragon 2024-02-13 09:59:51 -05:00
Aayush
e9245c176e Add UpgradePhoenixHeight to API params 2024-02-13 09:58:58 -05:00
Phi
cea5ae65af Update Mango codename to Phoneix
Make the codename for the Drand-change inline with Dragon style.
2024-02-13 11:20:07 +01:00
Phi
9112e85c7b Update epoch after nv22 DRAND switch
Update epoch after nv22 DRAND switch
2024-02-12 14:25:16 +01:00
Phi
342628955c chore: Upgrade heights and codename
Update upgrade heights

Co-Authored-By: Steven Allen <steven@stebalien.com>
2024-02-09 10:47:01 +01:00
Phi
89d47a79d4 Update to v13.0.0-rc.2 bundle 2024-02-09 12:47:30 +11:00
Rod Vagg
a7982fbeb3 AggregateProofType nil when doing batch updates
Use latest nv22 go-state-types version with matching update
2024-02-09 12:47:30 +11:00
Phi-rjan
b460701b9b
feat: fvm: update the FVM/FFI to v4.1 (#11608) (#11612)
This:

1. Adds nv22 support.
2. Updates the message tracing format.

Co-authored-by: Steven Allen <steven@stebalien.com>
2024-02-07 14:22:23 -08:00
Aayush Rajasekaran
3926a96784
chore: deps: update to go-multiaddr v0.12.2 (#11602) 2024-01-31 14:17:16 -08:00
Aayush Rajasekaran
78edf46afc
Merge pull request #11572 from filecoin-project/asr/fip-0063
feat: implement FIP-0063
2024-01-29 14:10:37 -05:00
Aayush
7613cdfa90 feat: implement FIP-0063 2024-01-29 12:30:52 -05:00
Łukasz Magiera
9e03fcab83
feat: sealing: Support nv22 DDO features in the sealing pipeline (#11226)
* Initial work supporting DDO pieces in lotus-miner

* sealing: Update pipeline input to operate on UniversalPiece

* sealing: Update pipeline checks/sealing states to operate on UniversalPiece

* sealing: Make pipeline build with UniversalPiece

* move PieceDealInfo out of api

* make gen

* make sealing pipeline unit tests pass

* fix itest ensemble build

* don't panic in SectorsStatus with deals

* stop linter from complaining about checkPieces

* fix sector import tests

* mod tidy

* sealing: Add logic for (pre)committing DDO sectors

* sealing: state-types with method defs

* DDO non-snap pipeline works(?), DDO Itests

* DDO support in snapdeals pipeline

* make gen

* update actor bundles

* update the gst market fix

* fix: chain: use PreCommitSectorsBatch2 when setting up genesis

* some bug fixes

* integration working changes

* update actor bundles

* Make TestOnboardRawPieceSnap pass

* Appease the linter

* Make deadlines test pass with v12 actors

* Update go-state-types, abstract market DealState

* make gen

* mod tidy, lint fixes

* Fix some more tests

* Bump version in master

Bump version in master

* Make gen

Make gen

* fix sender

* fix: lotus-provider: Fix winning PoSt

* fix: sql Scan cannot write to an object

* Actually show miner-addrs in info-log

Actually show miner-addrs in lotus-provider info-log

* [WIP] feat: Add nv22 skeleton

Addition of Network Version 22 skeleton

* update FFI

* ddo is now nv22

* make gen

* temp actor bundle with ddo

* use working go-state-types

* gst with v13 market migration

* update bundle, builtin.MethodsMiner.ProveCommitSectors2 -> 3

* actually working v13 migration, v13 migration itest

* Address review

* sealing: Correct DDO snap pledge math

* itests: Mixed ddo itest

* pipeline: Fix sectorWeight

* sealing: convert market deals into PAMs in mixed sectors

* sealing: make market to ddo conversion work

* fix lint

* update gst

* Update actors and GST to lastest integ branch

* commit batcher: Update ProveCommitSectors3Params builder logic

* make gen

* use builtin-actors master

* ddo: address review

* itests: Add commd assertions to ddo tests

* make gen

* gst with fixed types

* config knobs for RequireActivationSuccess

* storage: Drop obsolete flaky tasts

---------

Co-authored-by: Jennifer Wang <jiayingw703@gmail.com>
Co-authored-by: Aayush <arajasek94@gmail.com>
Co-authored-by: Shrenuj Bansal <shrenuj.bansal@protocol.ai>
Co-authored-by: Phi <orjan.roren@gmail.com>
Co-authored-by: Andrew Jackson (Ajax) <snadrus@gmail.com>
Co-authored-by: TippyFlits <james.bluett@protocol.ai>
2024-01-25 15:15:55 +01:00
Aayush
a967a36445 feat: drand: refactor round verification 2024-01-24 19:25:53 -05:00
Aayush
13248220a9 update FFI 2024-01-11 10:54:43 -05:00
TippyFlits
4313f990ce [WIP] feat: Add nv22 skeleton
Addition of Network Version 22 skeleton
2024-01-11 10:54:24 -05:00
21 changed files with 297 additions and 45 deletions

View File

@ -6,6 +6,14 @@
## Improvements ## Improvements
# v1.26.1 / 2024-03-27
**This is a patch release for the Calibration network user.** The Calibration network is scheduled for an upgrade to include the two additional built-in actor events to ease the transition and observability of DDO for the ecosystem ([#964](https://github.com/filecoin-project/FIPs/pull/964) and [#968](https://github.com/filecoin-project/FIPs/pull/968)).
The agreed-upon epoch between the Filecoin implementer team for the update is `1493854`, corresponding to `2024-04-03T11:00:00Z`. All Calibration network users need to upgrade to this patch release before that.
**Lotus Mainnet Users**: For users on the Mainnet, the [Lotus v1.26.0](https://github.com/filecoin-project/lotus/releases/tag/v1.26.0) release already includes the aforementioned events in preparation for the Mainnet nv22 upgrade. Therefore, both v1.26.0 and v1.26.1 versions are suitable for use on the Mainnet for the coming network version 22 upgrade.
# v1.26.0 / 2024-03-21 # v1.26.0 / 2024-03-21
This is the stable release for the upcoming MANDATORY Filecoin network upgrade v22, codenamed Dragon 🐉, at `epoch 3817920 - 2024-04-11 - 14:00:00Z` This is the stable release for the upcoming MANDATORY Filecoin network upgrade v22, codenamed Dragon 🐉, at `epoch 3817920 - 2024-04-11 - 14:00:00Z`
@ -403,8 +411,6 @@ This patch release allows for up to 10k messages per block. Additionally, it int
## Improvements ## Improvements
- fix: exchange: allow up to 10k messages per block ([filecoin-project/lotus#11506](https://github.com/filecoin-project/lotus/pull/11506)) - fix: exchange: allow up to 10k messages per block ([filecoin-project/lotus#11506](https://github.com/filecoin-project/lotus/pull/11506))
>>>>>>> releases
# v 1.25.0 / 2023-11-22 # v 1.25.0 / 2023-11-22
This is a highly recommended feature release of Lotus. This optional release supports the Filecoin network version 21 upgrade, codenamed Watermelon 🍉, in addition to the numerous improvements and enhancements for node operators, ETH RPC-providers and storage providers. This is a highly recommended feature release of Lotus. This optional release supports the Filecoin network version 21 upgrade, codenamed Watermelon 🍉, in addition to the numerous improvements and enhancements for node operators, ETH RPC-providers and storage providers.
@ -492,6 +498,7 @@ Lotus-workers can now be built to leverage the SupraSeal C2 sealing optimization
- fix: lotus-provider: lotus-provider msg sending ([filecoin-project/lotus#11480](https://github.com/filecoin-project/lotus/pull/11480)) - fix: lotus-provider: lotus-provider msg sending ([filecoin-project/lotus#11480](https://github.com/filecoin-project/lotus/pull/11480))
- fix: lotus-provider: Fix winning PoSt ([filecoin-project/lotus#11483](https://github.com/filecoin-project/lotus/pull/11483)) - fix: lotus-provider: Fix winning PoSt ([filecoin-project/lotus#11483](https://github.com/filecoin-project/lotus/pull/11483))
- chore: fix: sql Scan cannot write to an object ([filecoin-project/lotus#11487](https://github.com/filecoin-project/lotus/pull/11487)) - chore: fix: sql Scan cannot write to an object ([filecoin-project/lotus#11487](https://github.com/filecoin-project/lotus/pull/11487))
- fix: Exclude reverted events in `eth_getLogs` results [filecoin-project/lotus#11318](https://github.com/filecoin-project/lotus/pull/11318)
## Dependencies ## Dependencies
- deps: update go-libp2p to v0.28.1 ([filecoin-project/lotus#10998](https://github.com/filecoin-project/lotus/pull/10998)) - deps: update go-libp2p to v0.28.1 ([filecoin-project/lotus#10998](https://github.com/filecoin-project/lotus/pull/10998))

Binary file not shown.

View File

@ -48,6 +48,7 @@ func init() {
if NetworkBundle == "calibrationnet" { if NetworkBundle == "calibrationnet" {
actors.AddActorMeta("storageminer", cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq"), actorstypes.Version12) actors.AddActorMeta("storageminer", cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq"), actorstypes.Version12)
actors.AddActorMeta("storageminer", cid.MustParse("bafk2bzaced7emkbbnrewv5uvrokxpf5tlm4jslu2jsv77ofw2yqdglg657uie"), actorstypes.Version12) actors.AddActorMeta("storageminer", cid.MustParse("bafk2bzaced7emkbbnrewv5uvrokxpf5tlm4jslu2jsv77ofw2yqdglg657uie"), actorstypes.Version12)
actors.AddActorMeta("verifiedregistry", cid.MustParse("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm"), actorstypes.Version13)
} }
} }
@ -194,7 +195,8 @@ func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata,
// The following manifest cids existed temporarily on the calibnet testnet // The following manifest cids existed temporarily on the calibnet testnet
// We include them in our builtin bundle, but intentionally omit from metadata // We include them in our builtin bundle, but intentionally omit from metadata
if root == cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs") || if root == cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs") ||
root == cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru") { root == cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru") ||
root == cid.MustParse("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi") {
continue continue
} }
bundles = append(bundles, &BuiltinActorsMetadata{ bundles = append(bundles, &BuiltinActorsMetadata{

View File

@ -249,8 +249,8 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, { }, {
Network: "calibrationnet", Network: "calibrationnet",
Version: 13, Version: 13,
BundleGitTag: "v13.0.0-rc.3", BundleGitTag: "v13.0.0",
ManifestCid: MustParseCid("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi"), ManifestCid: MustParseCid("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs"),
Actors: map[string]cid.Cid{ Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6"), "account": MustParseCid("bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6"),
"cron": MustParseCid("bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs"), "cron": MustParseCid("bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs"),
@ -267,7 +267,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"storageminer": MustParseCid("bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri"), "storageminer": MustParseCid("bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri"),
"storagepower": MustParseCid("bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu"), "storagepower": MustParseCid("bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu"),
"system": MustParseCid("bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6"), "system": MustParseCid("bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6"),
"verifiedregistry": MustParseCid("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm"), "verifiedregistry": MustParseCid("bafk2bzacebj2zdquagzy2xxn7up574oemg3w7ed3fe4aujkyhgdwj57voesn2"),
}, },
}, { }, {
Network: "caterpillarnet", Network: "caterpillarnet",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -77,6 +77,9 @@ const UpgradeWatermelonFixHeight = -100
// This fix upgrade only ran on calibrationnet // This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFix2Height = -101 const UpgradeWatermelonFix2Height = -101
// This fix upgrade only ran on calibrationnet
const UpgradeCalibrationDragonFixHeight = -102
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet, 0: DrandMainnet,
UpgradePhoenixHeight: DrandQuicknet, UpgradePhoenixHeight: DrandQuicknet,

View File

@ -67,6 +67,9 @@ const UpgradeWatermelonFixHeight = -100
// This fix upgrade only ran on calibrationnet // This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFix2Height = -101 const UpgradeWatermelonFix2Height = -101
// This fix upgrade only ran on calibrationnet
const UpgradeCalibrationDragonFixHeight = -102
var SupportedProofTypes = []abi.RegisteredSealProof{ var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1, abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1, abi.RegisteredSealProof_StackedDrg32GiBV1,

View File

@ -95,6 +95,9 @@ const UpgradeDragonHeight = 1427974
// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet // This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
const UpgradePhoenixHeight = UpgradeDragonHeight + 120 const UpgradePhoenixHeight = UpgradeDragonHeight + 120
// 2024-04-03T11:00:00Z
const UpgradeCalibrationDragonFixHeight = 1493854
var SupportedProofTypes = []abi.RegisteredSealProof{ var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1, abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1, abi.RegisteredSealProof_StackedDrg64GiBV1,

View File

@ -65,6 +65,9 @@ const UpgradeWatermelonFixHeight = -1
// This fix upgrade only ran on calibrationnet // This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFix2Height = -2 const UpgradeWatermelonFix2Height = -2
// This fix upgrade only ran on calibrationnet
const UpgradeCalibrationDragonFixHeight = -3
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet, 0: DrandMainnet,
UpgradePhoenixHeight: DrandQuicknet, UpgradePhoenixHeight: DrandQuicknet,

View File

@ -103,7 +103,7 @@ const UpgradeWatermelonHeight = 3469380
var UpgradeDragonHeight = abi.ChainEpoch(3817920) var UpgradeDragonHeight = abi.ChainEpoch(3817920)
// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet // This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
// 2024-04-02T15:00:00Z // 2024-04-11T15:00:00Z
var UpgradePhoenixHeight = UpgradeDragonHeight + 120 var UpgradePhoenixHeight = UpgradeDragonHeight + 120
// This fix upgrade only ran on calibrationnet // This fix upgrade only ran on calibrationnet
@ -112,6 +112,9 @@ const UpgradeWatermelonFixHeight = -1
// This fix upgrade only ran on calibrationnet // This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFix2Height = -2 const UpgradeWatermelonFix2Height = -2
// This fix upgrade only ran on calibrationnet
const UpgradeCalibrationDragonFixHeight = -3
var SupportedProofTypes = []abi.RegisteredSealProof{ var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1, abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1, abi.RegisteredSealProof_StackedDrg64GiBV1,

View File

@ -87,33 +87,34 @@ var (
UpgradeBreezeHeight abi.ChainEpoch = -1 UpgradeBreezeHeight abi.ChainEpoch = -1
BreezeGasTampingDuration abi.ChainEpoch = 0 BreezeGasTampingDuration abi.ChainEpoch = 0
UpgradeSmokeHeight abi.ChainEpoch = -1 UpgradeSmokeHeight abi.ChainEpoch = -1
UpgradeIgnitionHeight abi.ChainEpoch = -2 UpgradeIgnitionHeight abi.ChainEpoch = -2
UpgradeRefuelHeight abi.ChainEpoch = -3 UpgradeRefuelHeight abi.ChainEpoch = -3
UpgradeTapeHeight abi.ChainEpoch = -4 UpgradeTapeHeight abi.ChainEpoch = -4
UpgradeAssemblyHeight abi.ChainEpoch = 10 UpgradeAssemblyHeight abi.ChainEpoch = 10
UpgradeLiftoffHeight abi.ChainEpoch = -5 UpgradeLiftoffHeight abi.ChainEpoch = -5
UpgradeKumquatHeight abi.ChainEpoch = -6 UpgradeKumquatHeight abi.ChainEpoch = -6
UpgradeCalicoHeight abi.ChainEpoch = -8 UpgradeCalicoHeight abi.ChainEpoch = -8
UpgradePersianHeight abi.ChainEpoch = -9 UpgradePersianHeight abi.ChainEpoch = -9
UpgradeOrangeHeight abi.ChainEpoch = -10 UpgradeOrangeHeight abi.ChainEpoch = -10
UpgradeClausHeight abi.ChainEpoch = -11 UpgradeClausHeight abi.ChainEpoch = -11
UpgradeTrustHeight abi.ChainEpoch = -12 UpgradeTrustHeight abi.ChainEpoch = -12
UpgradeNorwegianHeight abi.ChainEpoch = -13 UpgradeNorwegianHeight abi.ChainEpoch = -13
UpgradeTurboHeight abi.ChainEpoch = -14 UpgradeTurboHeight abi.ChainEpoch = -14
UpgradeHyperdriveHeight abi.ChainEpoch = -15 UpgradeHyperdriveHeight abi.ChainEpoch = -15
UpgradeChocolateHeight abi.ChainEpoch = -16 UpgradeChocolateHeight abi.ChainEpoch = -16
UpgradeOhSnapHeight abi.ChainEpoch = -17 UpgradeOhSnapHeight abi.ChainEpoch = -17
UpgradeSkyrHeight abi.ChainEpoch = -18 UpgradeSkyrHeight abi.ChainEpoch = -18
UpgradeSharkHeight abi.ChainEpoch = -19 UpgradeSharkHeight abi.ChainEpoch = -19
UpgradeHyggeHeight abi.ChainEpoch = -20 UpgradeHyggeHeight abi.ChainEpoch = -20
UpgradeLightningHeight abi.ChainEpoch = -21 UpgradeLightningHeight abi.ChainEpoch = -21
UpgradeThunderHeight abi.ChainEpoch = -22 UpgradeThunderHeight abi.ChainEpoch = -22
UpgradeWatermelonHeight abi.ChainEpoch = -23 UpgradeWatermelonHeight abi.ChainEpoch = -23
UpgradeWatermelonFixHeight abi.ChainEpoch = -24 UpgradeWatermelonFixHeight abi.ChainEpoch = -24
UpgradeWatermelonFix2Height abi.ChainEpoch = -25 UpgradeWatermelonFix2Height abi.ChainEpoch = -25
UpgradeDragonHeight abi.ChainEpoch = -26 UpgradeDragonHeight abi.ChainEpoch = -26
UpgradePhoenixHeight abi.ChainEpoch = -27 UpgradePhoenixHeight abi.ChainEpoch = -27
UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -28
DrandSchedule = map[abi.ChainEpoch]DrandEnum{ DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet, 0: DrandMainnet,

View File

@ -37,7 +37,7 @@ func BuildTypeString() string {
} }
// BuildVersion is the local build version // BuildVersion is the local build version
const BuildVersion = "1.26.0" const BuildVersion = "1.26.1"
func UserVersion() string { func UserVersion() string {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" { if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {

View File

@ -23,7 +23,9 @@ import (
init11 "github.com/filecoin-project/go-state-types/builtin/v11/init" init11 "github.com/filecoin-project/go-state-types/builtin/v11/init"
nv19 "github.com/filecoin-project/go-state-types/builtin/v11/migration" nv19 "github.com/filecoin-project/go-state-types/builtin/v11/migration"
system11 "github.com/filecoin-project/go-state-types/builtin/v11/system" system11 "github.com/filecoin-project/go-state-types/builtin/v11/system"
init12 "github.com/filecoin-project/go-state-types/builtin/v12/init"
nv21 "github.com/filecoin-project/go-state-types/builtin/v12/migration" nv21 "github.com/filecoin-project/go-state-types/builtin/v12/migration"
system12 "github.com/filecoin-project/go-state-types/builtin/v12/system"
nv22 "github.com/filecoin-project/go-state-types/builtin/v13/migration" nv22 "github.com/filecoin-project/go-state-types/builtin/v13/migration"
nv17 "github.com/filecoin-project/go-state-types/builtin/v9/migration" nv17 "github.com/filecoin-project/go-state-types/builtin/v9/migration"
"github.com/filecoin-project/go-state-types/manifest" "github.com/filecoin-project/go-state-types/manifest"
@ -296,6 +298,10 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule {
StopWithin: 10, StopWithin: 10,
}}, }},
Expensive: true, Expensive: true,
}, {
Height: build.UpgradeCalibrationDragonFixHeight,
Network: network.Version22,
Migration: upgradeActorsV13VerifregFix(calibnetv13BuggyVerifregCID1, calibnetv13CorrectManifestCID1),
}, },
} }
@ -1902,6 +1908,13 @@ var (
calibnetv12BuggyManifestCID1 = cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs") calibnetv12BuggyManifestCID1 = cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs")
calibnetv12BuggyManifestCID2 = cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru") calibnetv12BuggyManifestCID2 = cid.MustParse("bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru")
calibnetv12CorrectManifestCID1 = cid.MustParse("bafy2bzacednzb3pkrfnbfhmoqtb3bc6dgvxszpqklf3qcc7qzcage4ewzxsca") calibnetv12CorrectManifestCID1 = cid.MustParse("bafy2bzacednzb3pkrfnbfhmoqtb3bc6dgvxszpqklf3qcc7qzcage4ewzxsca")
calibnetv13BuggyVerifregCID1 = cid.MustParse("bafk2bzacednskl3bykz5qpo54z2j2p4q44t5of4ktd6vs6ymmg2zebsbxazkm")
calibnetv13BuggyBundleSuffix1 = "calibrationnet-13-rc3"
calibnetv13BuggyManifestCID1 = cid.MustParse("bafy2bzacea4firkyvt2zzdwqjrws5pyeluaesh6uaid246tommayr4337xpmi")
calibnetv13CorrectManifestCID1 = cid.MustParse("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs")
) )
func upgradeActorsV12Common( func upgradeActorsV12Common(
@ -2227,16 +2240,53 @@ func upgradeActorsV13Common(
) )
} }
manifest, ok := actors.GetManifest(actorstypes.Version13) // check whether or not this is a calibnet upgrade
if !ok { // we do this because calibnet upgraded to a "wrong" actors bundle, which was then corrected
return cid.Undef, xerrors.Errorf("no manifest CID for v13 upgrade") // we thus upgrade to calibrationnet-buggy in this upgrade
actorsIn, err := state.LoadStateTree(adtStore, root)
if err != nil {
return cid.Undef, xerrors.Errorf("loading state tree: %w", err)
}
initActor, err := actorsIn.GetActor(builtin.InitActorAddr)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to get system actor: %w", err)
}
var initState init12.State
if err := adtStore.Get(ctx, initActor.Head, &initState); err != nil {
return cid.Undef, xerrors.Errorf("failed to get system actor state: %w", err)
}
var manifestCid cid.Cid
if initState.NetworkName == "calibrationnet" {
embedded, ok := build.GetEmbeddedBuiltinActorsBundle(actorstypes.Version13, calibnetv13BuggyBundleSuffix1)
if !ok {
return cid.Undef, xerrors.Errorf("didn't find buggy calibrationnet bundle")
}
var err error
manifestCid, err = bundle.LoadBundle(ctx, writeStore, bytes.NewReader(embedded))
if err != nil {
return cid.Undef, xerrors.Errorf("failed to load buggy calibnet bundle: %w", err)
}
if manifestCid != calibnetv13BuggyManifestCID1 {
return cid.Undef, xerrors.Errorf("didn't find expected buggy calibnet bundle manifest: %s != %s", manifestCid, calibnetv12BuggyManifestCID1)
}
} else {
ok := false
manifestCid, ok = actors.GetManifest(actorstypes.Version13)
if !ok {
return cid.Undef, xerrors.Errorf("no manifest CID for v13 upgrade")
}
} }
// Perform the migration // Perform the migration
newHamtRoot, err := nv22.MigrateStateTree(ctx, adtStore, manifest, stateRoot.Actors, epoch, config, newHamtRoot, err := nv22.MigrateStateTree(ctx, adtStore, manifestCid, stateRoot.Actors, epoch, config,
migrationLogger{}, cache) migrationLogger{}, cache)
if err != nil { if err != nil {
return cid.Undef, xerrors.Errorf("upgrading to actors v11: %w", err) return cid.Undef, xerrors.Errorf("upgrading to actors v13: %w", err)
} }
// Persist the result. // Persist the result.
@ -2261,6 +2311,163 @@ func upgradeActorsV13Common(
return newRoot, nil return newRoot, nil
} }
// ////////////////////
func upgradeActorsV13VerifregFix(oldBuggyVerifregCID, newManifestCID cid.Cid) func(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
return func(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
stateStore := sm.ChainStore().StateBlockstore()
adtStore := store.ActorStore(ctx, stateStore)
// ensure that the manifest is loaded in the blockstore
// this loads the "correct" bundle for UpgradeCalibrationDragonFixHeight
if err := bundle.LoadBundles(ctx, stateStore, actorstypes.Version13); err != nil {
return cid.Undef, xerrors.Errorf("failed to load manifest bundle: %w", err)
}
// this loads the buggy bundle, for UpgradeDragonHeight
embedded, ok := build.GetEmbeddedBuiltinActorsBundle(actorstypes.Version13, calibnetv13BuggyBundleSuffix1)
if !ok {
return cid.Undef, xerrors.Errorf("didn't find buggy calibrationnet bundle")
}
_, err := bundle.LoadBundle(ctx, stateStore, bytes.NewReader(embedded))
if err != nil {
return cid.Undef, xerrors.Errorf("failed to load buggy calibnet bundle: %w", err)
}
// now confirm we have the one we're migrating to
if haveManifest, err := stateStore.Has(ctx, newManifestCID); err != nil {
return cid.Undef, xerrors.Errorf("blockstore error when loading manifest %s: %w", newManifestCID, err)
} else if !haveManifest {
return cid.Undef, xerrors.Errorf("missing new manifest %s in blockstore", newManifestCID)
}
// Load input state tree
actorsIn, err := state.LoadStateTree(adtStore, root)
if err != nil {
return cid.Undef, xerrors.Errorf("loading state tree: %w", err)
}
// load old manifest data
systemActor, err := actorsIn.GetActor(builtin.SystemActorAddr)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to get system actor: %w", err)
}
var systemState system12.State
if err := adtStore.Get(ctx, systemActor.Head, &systemState); err != nil {
return cid.Undef, xerrors.Errorf("failed to get system actor state: %w", err)
}
var oldManifestData manifest.ManifestData
if err := adtStore.Get(ctx, systemState.BuiltinActors, &oldManifestData); err != nil {
return cid.Undef, xerrors.Errorf("failed to get old manifest data: %w", err)
}
// load new manifest
var newManifest manifest.Manifest
if err := adtStore.Get(ctx, newManifestCID, &newManifest); err != nil {
return cid.Undef, xerrors.Errorf("error reading actor manifest: %w", err)
}
if err := newManifest.Load(ctx, adtStore); err != nil {
return cid.Undef, xerrors.Errorf("error loading actor manifest: %w", err)
}
// build the CID mapping
codeMapping := make(map[cid.Cid]cid.Cid, len(oldManifestData.Entries))
for _, oldEntry := range oldManifestData.Entries {
newCID, ok := newManifest.Get(oldEntry.Name)
if !ok {
return cid.Undef, xerrors.Errorf("missing manifest entry for %s", oldEntry.Name)
}
// Note: we expect newCID to be the same as oldEntry.Code for all actors except the verifreg actor
codeMapping[oldEntry.Code] = newCID
}
// Create empty actorsOut
actorsOut, err := state.NewStateTree(adtStore, actorsIn.Version())
if err != nil {
return cid.Undef, xerrors.Errorf("failed to create new tree: %w", err)
}
// Perform the migration
err = actorsIn.ForEach(func(a address.Address, actor *types.Actor) error {
newCid, ok := codeMapping[actor.Code]
if !ok {
return xerrors.Errorf("didn't find mapping for %s", actor.Code)
}
return actorsOut.SetActor(a, &types.ActorV5{
Code: newCid,
Head: actor.Head,
Nonce: actor.Nonce,
Balance: actor.Balance,
Address: actor.Address,
})
})
if err != nil {
return cid.Undef, xerrors.Errorf("failed to perform migration: %w", err)
}
systemState.BuiltinActors = newManifest.Data
newSystemHead, err := adtStore.Put(ctx, &systemState)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to put new system state: %w", err)
}
systemActor.Head = newSystemHead
if err = actorsOut.SetActor(builtin.SystemActorAddr, systemActor); err != nil {
return cid.Undef, xerrors.Errorf("failed to put new system actor: %w", err)
}
// Sanity checking
err = actorsIn.ForEach(func(a address.Address, inActor *types.Actor) error {
outActor, err := actorsOut.GetActor(a)
if err != nil {
return xerrors.Errorf("failed to get actor in outTree: %w", err)
}
if inActor.Nonce != outActor.Nonce {
return xerrors.Errorf("mismatched nonce for actor %s", a)
}
if !inActor.Balance.Equals(outActor.Balance) {
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.Head != outActor.Head && a != builtin.SystemActorAddr {
return xerrors.Errorf("mismatched head for actor %s", a)
}
// Actor Codes are only expected to change for the verifreg actor
if inActor.Code != oldBuggyVerifregCID && inActor.Code != outActor.Code {
return xerrors.Errorf("unexpected change in code for actor %s", a)
}
return nil
})
if err != nil {
return cid.Undef, xerrors.Errorf("failed to sanity check migration: %w", err)
}
// Persist the result.
newRoot, err := actorsOut.Flush(ctx)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to persist new state root: %w", err)
}
return newRoot, nil
}
}
//////////////////// ////////////////////
// Example upgrade function if upgrade requires only code changes // Example upgrade function if upgrade requires only code changes

View File

@ -46,6 +46,7 @@ var ddls = []string{
)`, )`,
`CREATE INDEX IF NOT EXISTS height_tipset_key ON event (height,tipset_key)`, `CREATE INDEX IF NOT EXISTS height_tipset_key ON event (height,tipset_key)`,
`CREATE INDEX IF NOT EXISTS event_emitter_addr ON event (emitter_addr)`,
`CREATE TABLE IF NOT EXISTS event_entry ( `CREATE TABLE IF NOT EXISTS event_entry (
event_id INTEGER, event_id INTEGER,
@ -56,6 +57,8 @@ var ddls = []string{
value BLOB NOT NULL value BLOB NOT NULL
)`, )`,
`CREATE INDEX IF NOT EXISTS event_entry_key_index ON event_entry (key)`,
// metadata containing version of schema // metadata containing version of schema
`CREATE TABLE IF NOT EXISTS _meta ( `CREATE TABLE IF NOT EXISTS _meta (
version UINT64 NOT NULL UNIQUE version UINT64 NOT NULL UNIQUE
@ -63,6 +66,7 @@ var ddls = []string{
`INSERT OR IGNORE INTO _meta (version) VALUES (1)`, `INSERT OR IGNORE INTO _meta (version) VALUES (1)`,
`INSERT OR IGNORE INTO _meta (version) VALUES (2)`, `INSERT OR IGNORE INTO _meta (version) VALUES (2)`,
`INSERT OR IGNORE INTO _meta (version) VALUES (3)`,
} }
var ( var (
@ -70,7 +74,7 @@ var (
) )
const ( const (
schemaVersion = 2 schemaVersion = 3
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=?` 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(?, ?, ?, ?, ?, ?, ?, ?)` insertEvent = `INSERT OR IGNORE INTO event(height, tipset_key, tipset_key_cid, emitter_addr, event_index, message_cid, message_index, reverted) VALUES(?, ?, ?, ?, ?, ?, ?, ?)`
@ -321,6 +325,22 @@ func NewEventIndex(ctx context.Context, path string, chainStore *store.ChainStor
version = 2 version = 2
} }
if version == 2 {
log.Infof("upgrading event index from version 2 to version 3")
// to upgrade to version 3 we only need to create an index on the event_entry.key column
// and on the event.emitter_addr column
// which means we can just reapply the schema (it will not have any effect on existing data)
for _, ddl := range ddls {
if _, err := db.Exec(ddl); err != nil {
_ = db.Close()
return nil, xerrors.Errorf("could not upgrade index to version 3, exec ddl %q: %w", ddl, err)
}
}
version = 3
}
if version != schemaVersion { if version != schemaVersion {
_ = db.Close() _ = db.Close()
return nil, xerrors.Errorf("invalid database version: got %d, expected %d", version, schemaVersion) return nil, xerrors.Errorf("invalid database version: got %d, expected %d", version, schemaVersion)

View File

@ -7,7 +7,7 @@ USAGE:
lotus-miner [global options] command [command options] [arguments...] lotus-miner [global options] command [command options] [arguments...]
VERSION: VERSION:
1.26.0 1.26.1
COMMANDS: COMMANDS:
init Initialize a lotus miner repo init Initialize a lotus miner repo

View File

@ -7,7 +7,7 @@ USAGE:
lotus-provider [global options] command [command options] [arguments...] lotus-provider [global options] command [command options] [arguments...]
VERSION: VERSION:
1.26.0 1.26.1
COMMANDS: COMMANDS:
run Start a lotus provider process run Start a lotus provider process

View File

@ -7,7 +7,7 @@ USAGE:
lotus-worker [global options] command [command options] [arguments...] lotus-worker [global options] command [command options] [arguments...]
VERSION: VERSION:
1.26.0 1.26.1
COMMANDS: COMMANDS:
run Start lotus worker run Start lotus worker

View File

@ -7,7 +7,7 @@ USAGE:
lotus [global options] command [command options] [arguments...] lotus [global options] command [command options] [arguments...]
VERSION: VERSION:
1.26.0 1.26.1
COMMANDS: COMMANDS:
daemon Start a lotus daemon process daemon Start a lotus daemon process