Compare commits

...
Author SHA1 Message Date
jonathanface 8aa30b6fe0 debugs 2024-05-06 18:50:34 +00:00
jonathanface fc8600e1c0 Merge pull request 'v1.26.3' (#5) from v1.26.3 into master
Reviewed-on: #5
2024-05-02 18:22:07 +00:00
jonathanface a9038d28bc Merge branch 'master' into v1.26.3 2024-05-02 18:21:49 +00:00
jonathanface 54d35ac88c Merge pull request 'Automate y/n prompt on snapshot import' (#6) from entrypoint_update into master
Reviewed-on: #6
2024-05-02 18:21:24 +00:00
jonathanface 0b6cf58995 version update 2024-05-02 16:43:12 +00:00
jonathanface f7a51f0387 conflicts 2024-05-02 16:38:29 +00:00
jonathanface fdb1108154 remove debug 2024-04-26 15:05:44 +00:00
jonathanface 6d47bcba54 adding auto-accept to docker entrypointt snapshot import 2024-04-26 15:03:57 +00:00
jonathanface e461e672ea Merge tag 'tags/v1.26.2' into 1.26.2
v1.26.2
Git-EVTag-v0-SHA512: f94cc711cb948b08eea54dedd0ddedf9b3443f4b1ea4e606154264b39f8a47f4949283c9a76c1564ce59e3aeab3e3232bc4a9491138035597159cb322f85e2f4
2024-04-09 15:34:47 +00:00
Rod Vagg 082a9159ce doc: add 1.26.x notes in 1.26.2 changelog 2024-04-09 08:18:50 +10:00
Rod Vagg 099a754a74 doc: update changelog, retract 1.26.{0,1}, fix formatting 2024-04-09 08:18:50 +10:00
Rod Vagg 557c3c01f7 fix(build): disable phoenix drand upgrade if LOTUS_DISABLE_DRAGON 2024-04-09 07:45:45 +10:00
Phi 647aa48b11 Update changelog and upgrade epochs/date 2024-04-09 07:44:15 +10:00
Łukasz Magiera 65e89a08ca fix: sealing: Use PRU3 After Nv22 (#11831) 2024-04-09 07:44:15 +10:00
Łukasz Magiera ba11769228 fix: lmcli: make 'sectors list' DDO-aware 2024-04-09 07:44:15 +10:00
Phi 01e24969df Update Changelog
Update Changelog
2024-04-09 07:44:15 +10:00
Łukasz Magiera 9cfdea3447 fix: piece: Don't return StartEport in PieceDealInfo.EndEpoch (#11832) 2024-04-09 07:44:15 +10:00
Phi a3ce23cf3b Make gen & Make docsgen-cli
Make gen & Make docsgen-cli
2024-04-09 07:44:15 +10:00
Jiaying Wang cf7ef3823f update deps (#11819) 2024-04-09 07:44:15 +10:00
Rod Vagg 5d620a72f7 fix(events): harden tests to assert strict event entry order 2024-04-05 16:46:30 +11:00
Rod Vagg f5100a2a1d fix(events): order entries by insertion order when selecting
Fixes: https://github.com/filecoin-project/lotus/issues/11823
2024-04-05 16:46:30 +11:00
jonathanfaceandraulk e2712a9157 fix: Eth API: accept input data in call arguments under field 'input' (#11505)
The correct name for this field is 'input' according to the Ethereum specs [0].
However, for the longest time, clients have been using 'data' and servers have been
lenient to accept both, preferring 'input' over 'data' when both appear.

Our lack of support for 'input' had gone unnoticed until go-ethereum decided
to adjust their ethclient implementation to issue eth_call and eth_estimateGas
requests with the 'input' field instead of 'data' [1]. This suddenly broke apps
using this client against Lotus' Eth API.

[0]: https://github.com/ethereum/execution-apis/blob/main/src/schemas/transaction.yaml#L33-L35
[1]: ethereum/go-ethereum#28078

Co-authored-by: raulk <raul.kripalani@gmail.com>
2024-04-04 16:35:48 +00:00
Phi-rjan 2cd6aea94b Merge pull request #11578 from filecoin-project/merge-releases-into-master
chore: releases: merge releases branch to master
2024-01-17 15:56:29 +01:00
Phi 73d830e2fb Remove merge conflict artefact
Remove merge conflict artefact
2024-01-17 13:27:09 +01:00
Łukasz Magiera 5091434f30 Merge pull request #11573 from filecoin-project/debugWeb
Debug Web 2: rearrange
2024-01-15 23:50:28 +01:00
Phi 330afff2e9 Merge remote-tracking branch 'origin/releases' into merge-releases-into-master 2024-01-15 11:28:20 +01:00
Andrew Jackson (Ajax) 32559aa463 rearrange 2024-01-13 06:47:22 -06:00
Jiaying Wang 512c70bb39 Merge pull request #11565 from filecoin-project/asr/harden-sync
feat: exchange: change GetBlocks to always fetch the requested number of tipsets
2024-01-11 18:13:10 +08:00
Aayush Rajasekaran f9833391d6 Merge pull request #11563 from filecoin-project/jen/ma
dep: go-multi-address
2024-01-10 13:17:24 -05:00
Aayush 170b9844ef feat: exchange: change GetBlocks to always fetch the requested number of tipsets 2024-01-10 12:04:52 -05:00
jennijuju aeed4cba6b update to the latest go multiaddress release 2024-01-10 21:15:45 +08:00
Andrew Jackson (Ajax) 0c7037b56f Merge pull request #11468 from filecoin-project/misc/drop-raft-experiment
misc: Drop the raft-cluster experiment
2024-01-09 15:29:41 -08:00
Łukasz Magiera 886020b7ed Merge pull request #11559 from filecoin-project/fix-docker-lp
fix: docker
2024-01-09 19:56:06 +01:00
Andrew Jackson (Ajax) 06f0e6beb8 fix: docker 2024-01-09 10:28:57 -06:00
Łukasz Magiera 92b67334ae Merge remote-tracking branch 'origin/master' into misc/drop-raft-experiment 2024-01-09 15:39:41 +01:00
Łukasz Magiera fb3970a958 Merge pull request #11281 from hunjixin/feat/add_confidencef_for_init_miner
feat: add confidence for init miner
2024-01-09 14:53:26 +01:00
Łukasz Magiera 179d981a88 Merge pull request #11557 from filecoin-project/steb/upstream-poseidon
chore: mod: use upstream poseidon
2024-01-09 14:45:40 +01:00
Łukasz Magiera 2ae68c841d Merge pull request #11558 from filecoin-project/jen/gma
deps: multiaddress
2024-01-09 14:40:49 +01:00
jennijuju 5621c1a193 update go multi address 2024-01-09 19:27:39 +08:00
Steven Allen b93e89c401 chore: mod: use upstream poseidon
The upstream PR was merged https://github.com/triplewz/poseidon/pull/1.
2024-01-08 14:55:15 -08:00
Łukasz Magiera 9ce25d7a7b Merge pull request #11547 from RobQuistNL/patch-13
Remove error log as its no longer an error since snap
2024-01-08 16:10:57 +01:00
Łukasz Magiera c3f0554dd3 Merge pull request #11516 from filecoin-project/debugWeb
Debug web
2024-01-08 15:57:56 +01:00
Łukasz Magiera 3d1cc159b0 Merge remote-tracking branch 'origin/master' into debugWeb 2024-01-08 15:08:24 +01:00
Steven Allenandraulk 156a3a400c fix: Eth API: accept input data in call arguments under field 'input' (#11505)
The correct name for this field is 'input' according to the Ethereum specs [0].
However, for the longest time, clients have been using 'data' and servers have been
lenient to accept both, preferring 'input' over 'data' when both appear.

Our lack of support for 'input' had gone unnoticed until go-ethereum decided
to adjust their ethclient implementation to issue eth_call and eth_estimateGas
requests with the 'input' field instead of 'data' [1]. This suddenly broke apps
using this client against Lotus' Eth API.

[0]: https://github.com/ethereum/execution-apis/blob/main/src/schemas/transaction.yaml#L33-L35
[1]: ethereum/go-ethereum#28078

Co-authored-by: raulk <raul.kripalani@gmail.com>
2024-01-06 15:42:52 -08:00
Andrew Jackson (Ajax) fc8e4c54f8 docsgen 2024-01-04 09:47:56 -06:00
Andrew Jackson (Ajax) 1d75af73fa Merge pull request #11550 from filecoin-project/fix/worker-multipart-post-err
fix: wdpost: fix vanilla proof indexes
2024-01-04 07:42:30 -08:00
Łukasz Magiera fafaf0d7af fix: wdpost: fix vanilla proof indexes 2024-01-04 12:47:30 +01:00
Andrew Jackson (Ajax) ad8e90d31c lp debugWeb ui bug 2024-01-03 16:18:23 -06:00
Andrew Jackson (Ajax) a959c049b3 Merge pull request #11532 from filecoin-project/fix/lpwinning-nowin-err
lpwinning: Don't say a task is done when persistNoWin fails
2024-01-03 08:23:24 -08:00
Andrew Jackson (Ajax) 15128b69a7 Update winning_task.go
last return should be true
2024-01-03 10:11:10 -06:00
Andrew Jackson (Ajax) 56bbeb01af fix: lint 2024-01-02 11:29:55 -06:00
Andrew Jackson (Ajax) 464e492fd2 srv cleanups 2023-12-30 09:37:04 -06:00
Andrew Jackson (Ajax) 83295e3a25 Merge branch 'master' into debugWeb for other bug fixes 2023-12-29 11:44:19 -06:00
Rob Quist d9d1b4370c Remove error log as its no longer an error since snap 2023-12-21 18:14:00 +01:00
Andrew Jackson (Ajax) 8dffab5d39 fix: lp lint and dev simplicities 2023-12-19 18:58:55 -06:00
Rob Quist b0bc4a9632 Fix 2 typo's (#11542)
* Fix typo in miner

* Fix typo in sectors.go
2023-12-19 16:18:20 -08:00
Aayush Rajasekaran bfc26cdc18 fix: sync: do not include incoming in return of syncFork (#11541) 2023-12-19 13:39:52 -08:00
Andrew Jackson (Ajax) 25b228c2f6 fix: lint 2023-12-19 09:12:45 -06:00
Andrew Jackson (Ajax) a65c8f1393 Merge branch 'master' into debugWeb to unbreak testing 2023-12-18 19:24:16 -06:00
Andrew Jackson (Ajax) b12757485a squash of 11515 with some fixups - not tested 2023-12-18 19:23:40 -06:00
Andrew Jackson (Ajax) 223e08bb84 lpweb minor cleanups 2023-12-18 18:23:31 -06:00
Andrew Jackson (Ajax) 41bc8f8791 Folded PR11519 into a shared-capable LP 2023-12-18 16:02:54 -06:00
Aayush Rajasekaran 324748d01b Merge pull request #11533 from filecoin-project/asr/speedup-fork-sync
feat: syncer: optimize syncFork for one-epoch forks
2023-12-18 15:09:52 -05:00
Andrew Jackson (Ajax) c1b42a8ce0 Merge pull request #11478 from filecoin-project/diBreakout
maint: break out lp deps for easy testing
2023-12-18 10:01:21 -08:00
Łukasz Magiera b1c1839b57 lotus-provider: Remove stray ~ dir in repo, fix bug causing it 2023-12-18 18:46:37 +01:00
Andrew Jackson (Ajax) 62fe670c28 Merge pull request #11535 from filecoin-project/lp-generate-cli-docs
fix: docs: Modify generate-lotus-cli.py to ignoring aliases.
2023-12-18 08:51:48 -08:00
Phi 5bdea21ad5 Make docsgen-cli
Make docsgen-cli
2023-12-18 16:06:47 +01:00
Phi 6373701412 Modify generate-lotus-cli.py to ignoring aliases.
Modify generate-lotus-cli.py to ignoring aliases.
2023-12-18 15:43:58 +01:00
Aayush e473571dfb feat: syncer: optimize syncFork for one-epoch forks 2023-12-15 14:02:17 -05:00
Łukasz Magiera f885ffb44d lpwinning: Don't say a task is done when persistNoWin fails 2023-12-15 14:39:56 +01:00
Phi-rjan fac1d11ccb Merge pull request #11512 from filecoin-project/jen/253
chore: bump version
2023-12-15 08:45:18 +01:00
Andrew Jackson (Ajax) b363bc3e70 fix lp blocking 2023-12-14 18:13:44 -06:00
Steven Allen 17f6f4caf2 fix: eth: decode as actor creation iff "to" is the EAM (#11520)
Previously, we weren't checking the "to" address. I've also re-ordered
the operations in this function to make it easier to reason about them.
It'll have a slight runtime cost (we _always_ ABI-encode the parameters,
then throw away the result if it turns out we're actually dealing with
an Ethereum transaction), but it's _much_ simpler.
2023-12-14 10:12:54 -08:00
Łukasz Magiera d75d7c78de Merge pull request #11522 from filecoin-project/feat/update-libp2p-deps
chore:libp2p: update libp2p deps in master
2023-12-14 15:26:56 +01:00
Aarsh Shah 6faeaa7d28 update libp2p deps 2023-12-14 11:26:36 +05:30
Andrew Jackson (Ajax) bc76004c15 module 2023-12-12 08:07:38 -06:00
Andrew Jackson (Ajax) 5717ec8c0a fix deps2 2023-12-11 23:48:07 -06:00
Andrew Jackson (Ajax) 8070e3424f fix deps 2023-12-11 23:47:31 -06:00
Andrew Jackson (Ajax) 17e17eaac3 move 2023-12-11 23:36:04 -06:00
Andrew Jackson (Ajax) 4161c270d7 debugWeb 1 2023-12-11 23:16:57 -06:00
Andrew Jackson (Ajax) a478b734fd build-env: unable to exit from deps 2023-12-11 23:15:41 -06:00
Andrew Jackson (Ajax) 0175faf5c2 deps fix 2023-12-11 21:10:15 -06:00
Andrew Jackson (Ajax) 0bad4d910d fix the listener 2023-12-11 18:30:39 -06:00
Andrew Jackson (Ajax) cdcb96567c listenAndServe hooked up 2023-12-11 18:12:05 -06:00
Andrew Jackson (Ajax) d0cfcd99f5 Merge branch 'diBreakout' of https://github.com/filecoin-project/lotus into diBreakout 2023-12-11 17:47:33 -06:00
Andrew Jackson (Ajax) becfc470a2 basic ensemble provider 2023-12-11 17:47:29 -06:00
Andrew Jackson (Ajax) 39afeff95d Merge branch 'master' into diBreakout 2023-12-11 15:47:06 -08:00
Andrew Jackson (Ajax) c912f3bcd5 Merge pull request #11501 from filecoin-project/serializationFix
fix: lotus-provider: Serialization fix
2023-12-11 13:23:56 -08:00
Andrew Jackson (Ajax) de38e77cfc tx-detector use atomic 2023-12-11 11:31:38 -06:00
Andrew Jackson (Ajax) 96353e63ea exp backoff, short stack err 2023-12-11 10:50:49 -06:00
Łukasz Magiera 47477c0b02 Merge pull request #11486 from filecoin-project/lpMigrateNicer
do not suggest the default layer
2023-12-11 13:32:42 +01:00
Łukasz Magiera 89fabbbbfe Merge pull request #11488 from filecoin-project/lpdocsgen
lp docsgen
2023-12-11 13:31:54 +01:00
Łukasz Magiera 68c1e56cef Merge pull request #11504 from filecoin-project/lp-wdposttaskcmd-format
fix: lotus-provider: Fix log output format in wdPostTaskCmd
2023-12-11 13:30:41 +01:00
Andrew Jackson (Ajax) 9dca4346b1 fix: lint 2023-12-09 11:20:41 -06:00
jennijuju 4a5c241762 bump version 2023-12-09 23:47:21 +08:00
Steven Allen f2a4891ada fix: exchange: explicitly cast the block message limit const (#11511)
It's not a const for the testground build, and needs to be an int 99%
of the time. So we might as well just cast here.
2023-12-09 23:24:43 +09:00
Łukasz Magiera 7f684ec840 Merge pull request #11506 from filecoin-project/steb/fix-exchange-message-length
fix: exchange: allow up to 10k messages per block
2023-12-09 11:31:03 +01:00
Steven Allen 88e90aaa44 fix lints 2023-12-09 18:21:22 +09:00
Steven Allen 986f240d91 fix: exchange: allow up to 10k messages per block
Also explicitly limit how many bytes we're willing to read in one go
such that we're capable of reading a worst-case tipset (like, really,
never going to happen worst-case). Previously, this wasn't an issue.
However, we've bumped the max number of messages from 8,192 to 150,000
and need to limit allocations somewhere else.
2023-12-09 18:08:32 +09:00
Phi 4ab92cae70 Fix log output format in wdPostTaskCmd
Fix log output format in wdPostTaskCmd
2023-12-08 09:21:07 +01:00
Andrew Jackson (Ajax) 1e09e1e966 detect unsafe code uses 2023-12-07 16:01:28 -06:00
Andrew Jackson (Ajax) 0e49673c49 fix: db serialize txn - retry 2023-12-07 15:32:35 -06:00
Andrew Jackson (Ajax) cf8fed9440 Merge pull request #11498 from filecoin-project/fix/harmony-reclaim
harmony: Fix task reclaim on restart
2023-12-07 09:46:33 -06:00
Łukasz Magiera efb4a09cf8 harmony: Fix task reclaim on restart 2023-12-07 12:17:53 +01:00
Andrew Jackson (Ajax) d32b8be99d Merge pull request #11493 from filecoin-project/fix/lp-send-taskid-wait
fix: lotus-provider: Wait for the correct taskID
2023-12-06 16:16:08 -06:00
Łukasz Magiera bf5132e50b more sender fixes 2023-12-06 23:00:53 +01:00
Łukasz Magiera 93fd408267 lotus-provider: additional fixes to make recover work 2023-12-06 22:54:46 +01:00
Łukasz Magiera 4b1445e3b2 fix: lotus-provider: Wait for the correct taskID 2023-12-06 20:53:50 +01:00
Andrew Jackson (Ajax) 9dd94585b6 Merge pull request #11490 from filecoin-project/phi-fix-lp-info-log
fix: lotus-provider: show addresses in log
2023-12-06 09:28:41 -06:00
Phi 3d30dedc39 Actually show miner-addrs in info-log
Actually show miner-addrs in lotus-provider info-log
2023-12-06 12:52:26 +01:00
Andrew Jackson (Ajax) e570693b3e lp docsgen 2023-12-05 17:38:07 -06:00
Łukasz Magiera e0a8fe3f18 Merge pull request #11485 from filecoin-project/sqlGptHard
fix: sql Scan cannot write to an object
2023-12-05 23:32:47 +01:00
Andrew Jackson (Ajax) 91b0032ee4 do not suggest the default layer 2023-12-05 13:58:15 -06:00
Andrew Jackson (Ajax) 685934a644 fix: sql Scan cannot write to an object 2023-12-05 13:45:08 -06:00
Andrew Jackson (Ajax) 0490359ac6 in progress 2023-12-05 13:36:47 -06:00
Andrew Jackson (Ajax) 2d75cc5f4e Merge pull request #11482 from filecoin-project/fix/lp-winning
fix: lotus-provider: Fix winning PoSt
2023-12-05 11:26:05 -06:00
Łukasz Magiera 943c223dad fix: lotus-provider: Fix winning PoSt 2023-12-05 17:51:42 +01:00
Andrew Jackson (Ajax) 2618b963e7 getdeps 2023-12-05 10:41:32 -06:00
Łukasz Magiera 956ac8a77c Merge pull request #11480 from filecoin-project/lpSenderBug
fix: lotus-provider: lotus-provider msg sending
2023-12-05 17:36:06 +01:00
Andrew Jackson (Ajax) 538039fc8d fix sender 2023-12-05 10:34:17 -06:00
Łukasz Magiera 271a011f81 Merge pull request #11475 from filecoin-project/phi-bump-master-v
chore: build: Bump version in master
2023-12-05 09:02:33 +01:00
Phi c9f13253fd Make gen
Make gen
2023-12-05 08:13:25 +01:00
Phi 8db6e73c90 Bump version in master
Bump version in master
2023-12-05 08:04:01 +01:00
Andrew Jackson (Ajax) d7ea5561dc maint: break out lp deps for easy testing 2023-12-04 22:30:40 -06:00
Łukasz Magiera 563975a85d mod tidy 2023-11-29 17:56:20 +01:00
Łukasz Magiera e425322c2b misc: Drop the raft-cluster experiment 2023-11-29 17:28:46 +01:00
hunjixin 0921c911a3 feat: add confidence for init miner 2023-09-22 09:36:30 +08:00
26 changed files with 247 additions and 89 deletions
+38 -1
View File
@@ -6,8 +6,43 @@
## Improvements
# v1.26.2 / 2024-04-08
**This is a mandatory patch release for the Filecoin network version 22 mainnet upgrade, for all node operators.**
There is an update in the upgrade epoch for nv22, you can read the [full discussion in Slack here.](https://filecoinproject.slack.com/archives/C05P37R9KQD/p1712548103521969)
The new upgrade epoch is scheduled to be on **epoch `3855360 - 2024-04-24 - 14:00:00Z`**. That means:
- **All mainnet node operators that have upgraded to v1.26.x, must upgrade to this patch release before 2024-04-11T14:00:00Z.**
- **All mainnet node operators that are on a version lower the v1.26.x, must upgrade to this patch release before 2024-04-24T14:00:00Z.**
This patch also includes fixes for node operators who want to index builtin-actor events after the nv22 upgrade. Specifically, it ensures the builtin actor event entries are ordered by insertion order when selected ([#11834](https://github.com/filecoin-project/lotus/pull/11834)). It also includes a couple Lotus-Miner patch fixes, ensuring that SnapDeals works properly and are using the new ProveReplicaUpdate3 message after the network version 22 upgrade, ensuring that DDO-sectors has the correct sector expirations, as well as DDO-sector visibility in the `lotus-miner sectors list` cmd.
## Upgrade Warnings
For users currently on a version of Lotus lower than v1.26.0, please note that **this release requires a minimum Go version of v1.21.7 or higher to successfully build Lotus.**
## v1.26.x Inclusions
See the [v1.26.0](#v1260--2024-03-21) release notes below for inclusions and notes on the v1.26.x series.
* [v13 Builtin Actor Bundle](#v13-builtin-actor-bundle)
* [Migration](#migration)
* [New features](#new-features-1)
* [Tracing API](#tracing-api)
* [Ethereum Tracing API (`trace_block` and `trace_replayBlockTransactions`)](#ethereum-tracing-api-trace_block-and-trace_replayblocktransactions)
* [GetActorEventsRaw and SubscribeActorEventsRaw](#getactoreventsraw-and-subscribeactoreventsraw)
* [Events Configuration Changes](#events-configuration-changes)
* [GetAllClaims and GetAllAlocations](#getallclaims-and-getallalocations)
* [Lotus CLI](#lotus-cli)
#v1260--2024-03-21
# v1.26.1 / 2024-03-27
***RETRACTED: Due to a change in network version 22 upgrade epoch, Lotus v1.26.1 should not be used prior to the new upgrade epoch. See v1.26.2 release notes above.***
**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.
@@ -16,6 +51,8 @@ The agreed-upon epoch between the Filecoin implementer team for the update is `1
# v1.26.0 / 2024-03-21
***RETRACTED: Due to a change in network version 22 upgrade epoch, Lotus v1.26.0 should not be used prior to the new upgrade epoch. See v1.26.2 release notes above.***
This is the stable release for the upcoming MANDATORY Filecoin network upgrade v22, codenamed Dragon 🐉, at `epoch 3817920 - 2024-04-11 - 14:00:00Z`
The Filecoin network version 22 delivers the following FIPs:
@@ -76,7 +113,7 @@ For certain node operators, such as full archival nodes or systems that need to
- feat: implement FIP-0063 ([filecoin-project/lotus#11572](https://github.com/filecoin-project/lotus/pull/11572))
- feat: events: Add Lotus APIs to consume smart contract and built-in actor events ([filecoin-project/lotus#11618](https://github.com/filecoin-project/lotus/pull/11618))
## Tracing API
### Tracing API
Replace the `CodeCid` field in the message trace (added in 1.23.4) with an `InvokedActor` field.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -2
View File
@@ -99,8 +99,8 @@ const UpgradeThunderHeight = UpgradeLightningHeight + 2880*21
// 2023-12-12T13:30:00Z
const UpgradeWatermelonHeight = 3469380
// 2024-04-11T14:00:00Z
var UpgradeDragonHeight = abi.ChainEpoch(3817920)
// 2024-04-24T14:00:00Z
var UpgradeDragonHeight = abi.ChainEpoch(3855360)
// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
// 2024-04-11T15:00:00Z
@@ -132,6 +132,7 @@ func init() {
if os.Getenv("LOTUS_DISABLE_DRAGON") == "1" {
UpgradeDragonHeight = math.MaxInt64 - 1
delete(DrandSchedule, UpgradePhoenixHeight)
UpgradePhoenixHeight = math.MaxInt64
}
+1 -1
View File
@@ -37,7 +37,7 @@ func BuildTypeString() string {
}
// BuildVersion is the local build version
const BuildVersion = "1.26.1"
const BuildVersion = "1.26.3"
func UserVersion() string {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
+2 -1
View File
@@ -577,7 +577,8 @@ func (ei *EventIndex) prefillFilter(ctx context.Context, f *eventFilter, exclude
s = s + " WHERE " + strings.Join(clauses, " AND ")
}
s += " ORDER BY event.height DESC"
// retain insertion order of event_entry rows with the implicit _rowid_ column
s += " ORDER BY event.height DESC, event_entry._rowid_ ASC"
stmt, err := ei.db.Prepare(s)
if err != nil {
+15 -3
View File
@@ -229,13 +229,25 @@ type EthCall struct {
}
func (c *EthCall) UnmarshalJSON(b []byte) error {
type TempEthCall EthCall
var params TempEthCall
type EthCallRaw EthCall // Avoid a recursive call.
type EthCallDecode struct {
// The field should be "input" by spec, but many clients use "data" so we support
// both, but prefer "input".
Input *EthBytes `json:"input"`
EthCallRaw
}
var params EthCallDecode
if err := json.Unmarshal(b, &params); err != nil {
return err
}
*c = EthCall(params)
// If input is specified, prefer it.
if params.Input != nil {
params.Data = *params.Input
}
*c = EthCall(params.EthCallRaw)
return nil
}
+30 -1
View File
@@ -194,11 +194,40 @@ func TestMaskedIDInF4(t *testing.T) {
}
func TestUnmarshalEthCall(t *testing.T) {
data := `{"from":"0x4D6D86b31a112a05A473c4aE84afaF873f632325","to":"0xFe01CC39f5Ae8553D6914DBb9dC27D219fa22D7f","gas":"0x5","gasPrice":"0x6","value":"0x123","data":""}`
data := `{"from":"0x4D6D86b31a112a05A473c4aE84afaF873f632325","to":"0xFe01CC39f5Ae8553D6914DBb9dC27D219fa22D7f","gas":"0x5","gasPrice":"0x6","value":"0x123","data":"0xFF"}`
var c EthCall
err := c.UnmarshalJSON([]byte(data))
require.Nil(t, err)
require.EqualValues(t, []byte{0xff}, c.Data)
}
func TestUnmarshalEthCallInput(t *testing.T) {
data := `{"from":"0x4D6D86b31a112a05A473c4aE84afaF873f632325","to":"0xFe01CC39f5Ae8553D6914DBb9dC27D219fa22D7f","gas":"0x5","gasPrice":"0x6","value":"0x123","input":"0xFF"}`
var c EthCall
err := c.UnmarshalJSON([]byte(data))
require.Nil(t, err)
require.EqualValues(t, []byte{0xff}, c.Data)
}
func TestUnmarshalEthCallInputAndData(t *testing.T) {
data := `{"from":"0x4D6D86b31a112a05A473c4aE84afaF873f632325","to":"0xFe01CC39f5Ae8553D6914DBb9dC27D219fa22D7f","gas":"0x5","gasPrice":"0x6","value":"0x123","data":"0xFE","input":"0xFF"}`
var c EthCall
err := c.UnmarshalJSON([]byte(data))
require.Nil(t, err)
require.EqualValues(t, []byte{0xff}, c.Data)
}
func TestUnmarshalEthCallInputAndDataEmpty(t *testing.T) {
// Even if the input is empty, it should be used when specified.
data := `{"from":"0x4D6D86b31a112a05A473c4aE84afaF873f632325","to":"0xFe01CC39f5Ae8553D6914DBb9dC27D219fa22D7f","gas":"0x5","gasPrice":"0x6","value":"0x123","data":"0xFE","input":""}`
var c EthCall
err := c.UnmarshalJSON([]byte(data))
require.Nil(t, err)
require.EqualValues(t, []byte{}, c.Data)
}
func TestUnmarshalEthBytes(t *testing.T) {
+9
View File
@@ -487,6 +487,13 @@ var sectorsListCmd = &cli.Command{
}
}
var pams int
for _, p := range st.Pieces {
if p.DealInfo != nil && p.DealInfo.PieceActivationManifest != nil {
pams++
}
}
exp := st.Expiration
if st.OnTime > 0 && st.OnTime < exp {
exp = st.OnTime // Can be different when the sector was CC upgraded
@@ -501,6 +508,8 @@ var sectorsListCmd = &cli.Command{
if deals > 0 {
m["Deals"] = color.GreenString("%d", deals)
} else if pams > 0 {
m["Deals"] = color.MagentaString("DDO:%d", pams)
} else {
m["Deals"] = color.BlueString("CC")
if st.ToUpgrade {
+7
View File
@@ -2,7 +2,9 @@ package main
import (
"context"
"fmt"
"os"
"strings"
"github.com/fatih/color"
logging "github.com/ipfs/go-log/v2"
@@ -24,6 +26,11 @@ var log = logging.Logger("main")
var AdvanceBlockCmd *cli.Command
func main() {
libp2p_addr := os.Getenv("LOTUS_LIBP2P_LISTENADDRESSES")
fmt.Println("env", libp2p_addr)
if len(libp2p_addr) > 0 && strings.Contains(libp2p_addr, ",") {
fmt.Println("env var is csv")
}
api.RunningNodeType = api.NodeFull
lotuslog.SetupLogLevels()
+1 -1
View File
@@ -7,7 +7,7 @@ USAGE:
lotus-miner [global options] command [command options] [arguments...]
VERSION:
1.26.1
1.26.2
COMMANDS:
init Initialize a lotus miner repo
+1 -1
View File
@@ -7,7 +7,7 @@ USAGE:
lotus-provider [global options] command [command options] [arguments...]
VERSION:
1.26.1
1.26.2
COMMANDS:
run Start a lotus provider process
+1 -1
View File
@@ -7,7 +7,7 @@ USAGE:
lotus-worker [global options] command [command options] [arguments...]
VERSION:
1.26.1
1.26.2
COMMANDS:
run Start lotus worker
+1 -1
View File
@@ -7,7 +7,7 @@ USAGE:
lotus [global options] command [command options] [arguments...]
VERSION:
1.26.1
1.26.2
COMMANDS:
daemon Start a lotus daemon process
+2 -2
View File
@@ -111,7 +111,7 @@ require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/koalacxr/quantile v0.0.1
github.com/libp2p/go-buffer-pool v0.1.0
github.com/libp2p/go-libp2p v0.33.1
github.com/libp2p/go-libp2p v0.33.2
github.com/libp2p/go-libp2p-consensus v0.0.1
github.com/libp2p/go-libp2p-gorpc v0.6.0
github.com/libp2p/go-libp2p-kad-dht v0.25.2
@@ -126,7 +126,7 @@ require (
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-base32 v0.1.0
github.com/multiformats/go-multiaddr v0.12.2
github.com/multiformats/go-multiaddr v0.12.3
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multibase v0.2.0
github.com/multiformats/go-multicodec v0.9.0
+4 -4
View File
@@ -1012,8 +1012,8 @@ github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xS
github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw=
github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o=
github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0=
github.com/libp2p/go-libp2p v0.33.1 h1:tvJl9b9M6nSLBtZSXSguq+/lRhRj2oLRkyhBmQNMFLA=
github.com/libp2p/go-libp2p v0.33.1/go.mod h1:zOUTMjG4I7TXwMndNyOBn/CNtVBLlvBlnxfi+8xzx+E=
github.com/libp2p/go-libp2p v0.33.2 h1:vCdwnFxoGOXMKmaGHlDSnL4bM3fQeW8pgIa9DECnb40=
github.com/libp2p/go-libp2p v0.33.2/go.mod h1:zTeppLuCvUIkT118pFVzA8xzP/p2dJYOMApCkFh0Yww=
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=
@@ -1309,8 +1309,8 @@ github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u
github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI=
github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc=
github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0=
github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24=
github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M=
github.com/multiformats/go-multiaddr v0.12.3 h1:hVBXvPRcKG0w80VinQ23P5t7czWgg65BmIvQKjDydU8=
github.com/multiformats/go-multiaddr v0.12.3/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII=
github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0=
+52 -34
View File
@@ -11,6 +11,7 @@ import (
"github.com/ipfs/go-cid"
"github.com/ipld/go-ipld-prime"
"github.com/ipld/go-ipld-prime/codec/dagcbor"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
"github.com/ipld/go-ipld-prime/node/basicnode"
"github.com/multiformats/go-multicodec"
"github.com/stretchr/testify/require"
@@ -24,6 +25,7 @@ import (
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
minertypes "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/consensus/filcns"
@@ -131,15 +133,17 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
var pieces []abi.PieceInfo
var dealID abi.DealID
// market ddo piece
var marketSector api.SectorOffset
var marketPiece abi.PieceInfo
marketPieceSize := abi.PaddedPieceSize(2048 / 2).Unpadded()
{
// market piece
pieceSize := abi.PaddedPieceSize(2048 / 2).Unpadded()
pieceData := make([]byte, pieceSize)
pieceData := make([]byte, marketPieceSize)
_, _ = rand.Read(pieceData)
dc, err := miner.ComputeDataCid(ctx, pieceSize, bytes.NewReader(pieceData))
marketPiece, err = miner.ComputeDataCid(ctx, marketPieceSize, bytes.NewReader(pieceData))
require.NoError(t, err)
pieces = append(pieces, dc)
pieces = append(pieces, marketPiece)
head, err := client.ChainHead(ctx)
require.NoError(t, err)
@@ -148,7 +152,7 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
psdParams := market2.PublishStorageDealsParams{
Deals: []market2.ClientDealProposal{
makeMarketDealProposal(t, client, miner, dc.PieceCID, pieceSize.Padded(), head.Height()+2880*2, head.Height()+2880*400),
makeMarketDealProposal(t, client, miner, marketPiece.PieceCID, marketPieceSize.Padded(), head.Height()+2880*2, head.Height()+2880*400),
},
}
@@ -177,7 +181,7 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
mcid := smsg.Cid()
so, err := miner.SectorAddPieceToAny(ctx, pieceSize, bytes.NewReader(pieceData), piece.PieceDealInfo{
marketSector, err = miner.SectorAddPieceToAny(ctx, marketPieceSize, bytes.NewReader(pieceData), piece.PieceDealInfo{
PublishCid: &mcid,
DealID: dealID,
DealProposal: &psdParams.Deals[0].Proposal,
@@ -190,25 +194,26 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
})
require.NoError(t, err)
require.Equal(t, abi.PaddedPieceSize(0), so.Offset)
require.Equal(t, abi.SectorNumber(2), so.Sector)
require.Equal(t, abi.PaddedPieceSize(0), marketSector.Offset)
require.Equal(t, abi.SectorNumber(2), marketSector.Sector)
}
// raw ddo piece
var rawSector api.SectorOffset
var rawPiece abi.PieceInfo
rawPieceSize := abi.PaddedPieceSize(2048 / 2).Unpadded()
{
// raw ddo piece
pieceSize := abi.PaddedPieceSize(2048 / 2).Unpadded()
pieceData := make([]byte, pieceSize)
pieceData := make([]byte, rawPieceSize)
_, _ = rand.Read(pieceData)
dc, err := miner.ComputeDataCid(ctx, pieceSize, bytes.NewReader(pieceData))
rawPiece, err = miner.ComputeDataCid(ctx, rawPieceSize, bytes.NewReader(pieceData))
require.NoError(t, err)
pieces = append(pieces, dc)
pieces = append(pieces, rawPiece)
head, err := client.ChainHead(ctx)
require.NoError(t, err)
so, err := miner.SectorAddPieceToAny(ctx, pieceSize, bytes.NewReader(pieceData), piece.PieceDealInfo{
rawSector, err = miner.SectorAddPieceToAny(ctx, rawPieceSize, bytes.NewReader(pieceData), piece.PieceDealInfo{
PublishCid: nil,
DealID: 0,
DealProposal: nil,
@@ -218,18 +223,20 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
},
KeepUnsealed: false,
PieceActivationManifest: &minertypes.PieceActivationManifest{
CID: dc.PieceCID,
Size: dc.Size,
CID: rawPiece.PieceCID,
Size: rawPiece.Size,
VerifiedAllocationKey: nil,
Notify: nil,
},
})
require.NoError(t, err)
require.Equal(t, abi.PaddedPieceSize(1024), so.Offset)
require.Equal(t, abi.SectorNumber(2), so.Sector)
require.Equal(t, abi.PaddedPieceSize(1024), rawSector.Offset)
require.Equal(t, abi.SectorNumber(2), rawSector.Sector)
}
require.Equal(t, marketSector.Sector, rawSector.Sector) // sanity check same sector
toCheck := map[abi.SectorNumber]struct{}{
2: {},
}
@@ -272,7 +279,7 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
fmt.Println("piece", piece.PieceCID, piece.Size)
}
// check "deal-published" actor event
// check some actor events
var epochZero abi.ChainEpoch
allEvents, err := miner.FullNode.GetActorEventsRaw(ctx, &types.ActorEventFilter{
FromHeight: &epochZero,
@@ -282,21 +289,32 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
var found bool
keyBytes := must.One(ipld.Encode(basicnode.NewString(key), dagcbor.Encode))
for _, event := range allEvents {
for _, e := range event.Entries {
if e.Key == "$type" && bytes.Equal(e.Value, keyBytes) {
found = true
switch key {
case "deal-published", "deal-activated":
expectedEntries := []types.EventEntry{
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: keyBytes},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "id", Value: must.One(ipld.Encode(basicnode.NewInt(2), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "client", Value: must.One(ipld.Encode(basicnode.NewInt(int64(clientId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, event.Entries)
require.True(t, len(event.Entries) > 0)
if event.Entries[0].Key == "$type" && bytes.Equal(event.Entries[0].Value, keyBytes) {
found = true
switch key {
case "deal-published", "deal-activated":
expectedEntries := []types.EventEntry{
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: keyBytes},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "id", Value: must.One(ipld.Encode(basicnode.NewInt(2), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "client", Value: must.One(ipld.Encode(basicnode.NewInt(int64(clientId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
}
break
require.Equal(t, expectedEntries, event.Entries)
case "sector-activated":
// only one sector, that has both our pieces in it
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(rawSector.Sector)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "unsealed-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: expectCommD}), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: marketPiece.PieceCID}), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(marketPieceSize.Padded())), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: rawPiece.PieceCID}), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(rawPieceSize.Padded())), dagcbor.Encode))},
}
require.Equal(t, expectedEntries, event.Entries)
}
break
}
}
require.True(t, found, "expected to find event %s", key)
+11 -11
View File
@@ -175,11 +175,11 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
// first sector to start mining is CC
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(so.Sector)-1), dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, precommitedEvents[0].Entries)
require.Equal(t, expectedEntries, precommitedEvents[0].Entries)
// second sector has our piece
expectedEntries[1].Value = must.One(ipld.Encode(basicnode.NewInt(int64(so.Sector)), dagcbor.Encode))
require.ElementsMatch(t, expectedEntries, precommitedEvents[1].Entries)
require.Equal(t, expectedEntries, precommitedEvents[1].Entries)
}
{
@@ -192,7 +192,7 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(so.Sector)-1), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "unsealed-cid", Value: must.One(ipld.Encode(datamodel.Null, dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, activatedEvents[0].Entries)
require.Equal(t, expectedEntries, activatedEvents[0].Entries)
// second sector has our piece, and only our piece, so usealed-cid matches piece-cid,
// unfortunately we don't have a case with multiple pieces
@@ -202,7 +202,7 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
types.EventEntry{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: dc.PieceCID}), dagcbor.Encode))},
types.EventEntry{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(pieceSize.Padded())), dagcbor.Encode))},
)
require.ElementsMatch(t, expectedEntries, activatedEvents[1].Entries)
require.Equal(t, expectedEntries, activatedEvents[1].Entries)
}
{
@@ -232,21 +232,21 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("allocation"), dagcbor.Encode))},
// first, bogus, allocation
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "id", Value: must.One(ipld.Encode(basicnode.NewInt(int64(allocationId)-1), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "client", Value: must.One(ipld.Encode(basicnode.NewInt(int64(clientId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: bogusPieceCid}), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(pieceSize.Padded())), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "term-min", Value: must.One(ipld.Encode(basicnode.NewInt(verifregtypes13.MinimumVerifiedAllocationTerm), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "term-max", Value: must.One(ipld.Encode(basicnode.NewInt(verifregtypes13.MaximumVerifiedAllocationTerm), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "expiration", Value: must.One(ipld.Encode(basicnode.NewInt(int64(bogusAllocationExpiry)), dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, allocationEvents[0].Entries)
require.Equal(t, expectedEntries, allocationEvents[0].Entries)
// the second, real allocation
expectedEntries[1].Value = must.One(ipld.Encode(basicnode.NewInt(int64(allocationId)), dagcbor.Encode)) // "id"
expectedEntries[4].Value = must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: dc.PieceCID}), dagcbor.Encode)) // "piece-cid"
expectedEntries[8].Value = must.One(ipld.Encode(basicnode.NewInt(verifregtypes13.MaximumVerifiedAllocationExpiration), dagcbor.Encode)) // "expiration"
require.ElementsMatch(t, expectedEntries, allocationEvents[1].Entries)
require.Equal(t, expectedEntries, allocationEvents[1].Entries)
}
{
@@ -257,15 +257,15 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
expectedEntries := []types.EventEntry{
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("allocation-removed"), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "id", Value: must.One(ipld.Encode(basicnode.NewInt(int64(allocationId)-1), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "client", Value: must.One(ipld.Encode(basicnode.NewInt(int64(clientId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: bogusPieceCid}), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(pieceSize.Padded())), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "term-min", Value: must.One(ipld.Encode(basicnode.NewInt(verifregtypes13.MinimumVerifiedAllocationTerm), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "term-max", Value: must.One(ipld.Encode(basicnode.NewInt(verifregtypes13.MaximumVerifiedAllocationTerm), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "expiration", Value: must.One(ipld.Encode(basicnode.NewInt(int64(bogusAllocationExpiry)), dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, allocationEvents[0].Entries)
require.Equal(t, expectedEntries, allocationEvents[0].Entries)
}
{
@@ -276,8 +276,8 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: must.One(ipld.Encode(basicnode.NewString("claim"), dagcbor.Encode))},
// claimId inherits from its original allocationId
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "id", Value: must.One(ipld.Encode(basicnode.NewInt(int64(allocationId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "client", Value: must.One(ipld.Encode(basicnode.NewInt(int64(clientId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "provider", Value: must.One(ipld.Encode(basicnode.NewInt(int64(minerId)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "piece-cid", Value: must.One(ipld.Encode(basicnode.NewLink(cidlink.Link{Cid: dc.PieceCID}), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "piece-size", Value: must.One(ipld.Encode(basicnode.NewInt(int64(pieceSize.Padded())), dagcbor.Encode))},
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "term-min", Value: must.One(ipld.Encode(basicnode.NewInt(verifregtypes13.MinimumVerifiedAllocationTerm), dagcbor.Encode))},
@@ -285,7 +285,7 @@ func TestOnboardRawPieceVerified_WithActorEvents(t *testing.T) {
{Flags: 0x01, Codec: uint64(multicodec.Cbor), Key: "term-start", Value: must.One(ipld.Encode(basicnode.NewInt(int64(claimEvents[0].Height)), dagcbor.Encode))},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(si.SectorID)), dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, claimEvents[0].Entries)
require.Equal(t, expectedEntries, claimEvents[0].Entries)
}
// verify that we can trace a datacap allocation through to a claim with the events, since this
+1 -1
View File
@@ -189,7 +189,7 @@ loop:
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "$type", Value: keyBytes},
{Flags: 0x03, Codec: uint64(multicodec.Cbor), Key: "sector", Value: must.One(ipld.Encode(basicnode.NewInt(int64(toTerminate)), dagcbor.Encode))},
}
require.ElementsMatch(t, expectedEntries, event.Entries)
require.Equal(t, expectedEntries, event.Entries)
}
break
}
+1 -1
View File
@@ -5,7 +5,7 @@ if [ ! -z $DOCKER_LOTUS_IMPORT_SNAPSHOT ]; then
# Don't init if already initialized.
if [ ! -f "$GATE" ]; then
echo importing minimal snapshot
/usr/local/bin/lotus daemon --import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" --halt-after-import
echo "yes" | /usr/local/bin/lotus daemon --import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" --halt-after-import
# Block future inits
date > "$GATE"
fi
+1 -1
View File
@@ -147,7 +147,7 @@ func (ds *PieceDealInfo) EndEpoch() (abi.ChainEpoch, error) {
default:
// note - when implementing make sure to cache any dynamically computed values
// todo do we want a smarter mechanism here
return ds.DealSchedule.StartEpoch, nil
return ds.DealSchedule.EndEpoch, nil
}
}
+35
View File
@@ -18,6 +18,7 @@ import (
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
@@ -242,3 +243,37 @@ func TestMissingDealIsIgnored(t *testing.T) {
assert.Equal(t, 547300, int(exp))
}
func TestBasicPolicyDDO(t *testing.T) {
cfg := fakeConfigGetter(nil)
pcp := pipeline.NewBasicPreCommitPolicy(&fakeChain{
h: abi.ChainEpoch(55),
}, cfg, 0)
pieces := []pipeline.SafeSectorPiece{
pipeline.SafePiece(api.SectorPiece{
Piece: abi.PieceInfo{
Size: abi.PaddedPieceSize(1024),
PieceCID: fakePieceCid(t),
},
DealInfo: &piece.PieceDealInfo{
PublishCid: nil,
DealID: abi.DealID(44),
DealSchedule: piece.DealSchedule{
StartEpoch: abi.ChainEpoch(100_000),
EndEpoch: abi.ChainEpoch(1500_000),
},
PieceActivationManifest: &miner.PieceActivationManifest{
Size: 0,
VerifiedAllocationKey: nil,
Notify: nil,
},
},
}),
}
exp, err := pcp.Expiration(context.Background(), pieces...)
require.NoError(t, err)
assert.Equal(t, abi.ChainEpoch(1500_000), exp)
}
+7 -1
View File
@@ -11,6 +11,7 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/go-statemachine"
"github.com/filecoin-project/lotus/api"
@@ -170,7 +171,12 @@ func (m *Sealing) handleSubmitReplicaUpdate(ctx statemachine.Context, sector Sec
// figure out message type
pams, deals, err := m.processPieces(ctx.Context(), sector)
nv, err := m.Api.StateNetworkVersion(ctx.Context(), ts.Key())
if err != nil {
log.Errorf("failed to get network version: %+v", err)
}
pams, deals, err := m.processPieces(ctx.Context(), sector, nv >= network.Version22)
if err != nil {
log.Errorf("failed to process pieces: %+v", err)
return ctx.Send(SectorSubmitReplicaUpdateFailed{})
+24 -21
View File
@@ -748,30 +748,33 @@ func (m *Sealing) handleSubmitCommit(ctx statemachine.Context, sector SectorInfo
// processPieces returns either:
// - a list of piece activation manifests
// - a list of deal IDs, if all non-filler pieces are deal-id pieces
func (m *Sealing) processPieces(ctx context.Context, sector SectorInfo) ([]miner.PieceActivationManifest, []abi.DealID, error) {
func (m *Sealing) processPieces(ctx context.Context, sector SectorInfo, forceDDO bool) ([]miner.PieceActivationManifest, []abi.DealID, error) {
pams := make([]miner.PieceActivationManifest, 0, len(sector.Pieces))
dealIDs := make([]abi.DealID, 0, len(sector.Pieces))
var hasDDO bool
hasDDO := forceDDO
for _, piece := range sector.Pieces {
piece := piece
if !forceDDO {
// if not forcing DDO, check if we have any DDO pieces
for _, piece := range sector.Pieces {
piece := piece
// first figure out if this is a ddo sector
err := piece.handleDealInfo(handleDealInfoParams{
FillerHandler: func(info UniversalPieceInfo) error {
// Fillers are implicit (todo review: Are they??)
return nil
},
BuiltinMarketHandler: func(info UniversalPieceInfo) error {
return nil
},
DDOHandler: func(info UniversalPieceInfo) error {
hasDDO = true
return nil
},
})
if err != nil {
return nil, nil, xerrors.Errorf("handleDealInfo: %w", err)
// first figure out if this is a ddo sector
err := piece.handleDealInfo(handleDealInfoParams{
FillerHandler: func(info UniversalPieceInfo) error {
// Fillers are implicit (todo review: Are they??)
return nil
},
BuiltinMarketHandler: func(info UniversalPieceInfo) error {
return nil
},
DDOHandler: func(info UniversalPieceInfo) error {
hasDDO = true
return nil
},
})
if err != nil {
return nil, nil, xerrors.Errorf("handleDealInfo: %w", err)
}
}
}
for _, piece := range sector.Pieces {
@@ -847,7 +850,7 @@ func (m *Sealing) handleSubmitCommitAggregate(ctx statemachine.Context, sector S
return ctx.Send(SectorCommitFailed{xerrors.Errorf("sector had nil commR or commD")})
}
pams, dealIDs, err := m.processPieces(ctx.Context(), sector)
pams, dealIDs, err := m.processPieces(ctx.Context(), sector, false)
if err != nil {
return err
}