From a095413cd1028a4f3823eff8651de2e4125b1d43 Mon Sep 17 00:00:00 2001 From: Phi Date: Wed, 10 Jan 2024 10:19:20 +0100 Subject: [PATCH 1/5] Update changelog Update changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44a90e6f717..6400fb38f4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ ## Improvements -# v1.25.2 / 2024-01-04 +# v1.25.2 / 2024-01-10 -This is an optional feature release of Lotus. It introduces Lotus-Provider in its alpha testing phase, and includes fixes for synchronization issues that users experienced during the network upgrade. +This is an optional but highly recommended feature release of Lotus, as it includes fixes for synchronizations issues that users have experienced. The feature release also introduces Lotus-Provider in its alpha testing phase, as well as the ability to call external PC2-binaries during the sealing process. ## ☢️ Upgrade Warnings ☢️ @@ -113,6 +113,7 @@ For more information on how to use SupraSeal PC2 with your `lotus-worker`, as we - deps: gostatetype (#11437) ([filecoin-project/lotus#11437](https://github.com/filecoin-project/lotus/pull/11437)) - fix: deps: stop using go-libp2p deprecated peer.ID.Pretty ([filecoin-project/lotus#11263](https://github.com/filecoin-project/lotus/pull/11263)) - chore:libp2p:update libp2p deps in release-v1.25.2 to v0.31.1 ([filecoin-project/lotus#11524](https://github.com/filecoin-project/lotus/pull/11524)) +- deps: update go-multiaddr to v0.12.0 ([filecoin-project/lotus#11524](https://github.com/filecoin-project/lotus/pull/11558)) ## Others - chore: update FFI (#11431) ([filecoin-project/lotus#11431](https://github.com/filecoin-project/lotus/pull/11431)) @@ -146,6 +147,7 @@ For more information on how to use SupraSeal PC2 with your `lotus-worker`, as we - eth_filter flake debug ([filecoin-project/lotus#11261](https://github.com/filecoin-project/lotus/pull/11261)) - fix: sealing: typo in FinalizeReplicaUpdate ([filecoin-project/lotus#11255](https://github.com/filecoin-project/lotus/pull/11255)) - chore: slice loop replace (#11349) ([filecoin-project/lotus#11349](https://github.com/filecoin-project/lotus/pull/11349)) +- backport: docker build fix for v1.25.2 ([filecoin-project/lotus#11560](https://github.com/filecoin-project/lotus/pull/11560)) ## Contributors From 8d53c446fddae050d18635f831de9929fb65ab35 Mon Sep 17 00:00:00 2001 From: Phi Date: Wed, 10 Jan 2024 16:06:02 +0100 Subject: [PATCH 2/5] Update changelog Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6400fb38f4d..4fc5de4975b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,6 +114,7 @@ For more information on how to use SupraSeal PC2 with your `lotus-worker`, as we - fix: deps: stop using go-libp2p deprecated peer.ID.Pretty ([filecoin-project/lotus#11263](https://github.com/filecoin-project/lotus/pull/11263)) - chore:libp2p:update libp2p deps in release-v1.25.2 to v0.31.1 ([filecoin-project/lotus#11524](https://github.com/filecoin-project/lotus/pull/11524)) - deps: update go-multiaddr to v0.12.0 ([filecoin-project/lotus#11524](https://github.com/filecoin-project/lotus/pull/11558)) +- dep: go-multi-address to v0.12.1 ([filecoin-project/lotus#11564](https://github.com/filecoin-project/lotus/pull/11564)) ## Others - chore: update FFI (#11431) ([filecoin-project/lotus#11431](https://github.com/filecoin-project/lotus/pull/11431)) From 6fb300b4609c80d84c69586ac32610f549f8dde1 Mon Sep 17 00:00:00 2001 From: Jiaying Wang <42981373+jennijuju@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:13:10 +0800 Subject: [PATCH 3/5] Merge pull request #11565 from filecoin-project/asr/harden-sync feat: exchange: change GetBlocks to always fetch the requested number of tipsets --- chain/exchange/client.go | 54 ++++++++++++++++++++++++++---------- chain/exchange/interfaces.go | 4 +-- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/chain/exchange/client.go b/chain/exchange/client.go index 769c375ca93..9cbb4495517 100644 --- a/chain/exchange/client.go +++ b/chain/exchange/client.go @@ -284,16 +284,18 @@ func (c *client) validateCompressedIndices(chain []*BSTipSet) error { len(msgs.SecpkIncludes), blocksNum) } + blsLen := uint64(len(msgs.Bls)) + secpLen := uint64(len(msgs.Secpk)) for blockIdx := 0; blockIdx < blocksNum; blockIdx++ { for _, mi := range msgs.BlsIncludes[blockIdx] { - if int(mi) >= len(msgs.Bls) { + if mi >= blsLen { return xerrors.Errorf("index in BlsIncludes (%d) exceeds number of messages (%d)", mi, len(msgs.Bls)) } } for _, mi := range msgs.SecpkIncludes[blockIdx] { - if int(mi) >= len(msgs.Secpk) { + if mi >= secpLen { return xerrors.Errorf("index in SecpkIncludes (%d) exceeds number of messages (%d)", mi, len(msgs.Secpk)) } @@ -315,18 +317,36 @@ func (c *client) GetBlocks(ctx context.Context, tsk types.TipSetKey, count int) ) } - req := &Request{ - Head: tsk.Cids(), - Length: uint64(count), - Options: Headers, - } + var ret []*types.TipSet + start := tsk.Cids() + for len(ret) < count { + req := &Request{ + Head: start, + Length: uint64(count - len(ret)), + Options: Headers, + } - validRes, err := c.doRequest(ctx, req, nil, nil) - if err != nil { - return nil, err + validRes, err := c.doRequest(ctx, req, nil, nil) + if err != nil { + return nil, xerrors.Errorf("failed to doRequest: %w", err) + } + + if len(validRes.tipsets) == 0 { + return nil, xerrors.Errorf("doRequest fetched zero tipsets: %w", err) + } + + ret = append(ret, validRes.tipsets...) + + last := validRes.tipsets[len(validRes.tipsets)-1] + if last.Height() <= 1 { + // we've walked all the way up to genesis, return + break + } + + start = last.Parents().Cids() } - return validRes.tipsets, nil + return ret, nil } // GetFullTipSet implements Client.GetFullTipSet(). Refer to the godocs there. @@ -341,12 +361,16 @@ func (c *client) GetFullTipSet(ctx context.Context, peer peer.ID, tsk types.TipS validRes, err := c.doRequest(ctx, req, &peer, nil) if err != nil { - return nil, err + return nil, xerrors.Errorf("failed to doRequest: %w", err) + } + + fullTipsets := validRes.toFullTipSets() + + if len(fullTipsets) == 0 { + return nil, xerrors.New("unexpectedly got no tipsets in exchange") } - return validRes.toFullTipSets()[0], nil - // If `doRequest` didn't fail we are guaranteed to have at least - // *one* tipset here, so it's safe to index directly. + return fullTipsets[0], nil } // GetChainMessages implements Client.GetChainMessages(). Refer to the godocs there. diff --git a/chain/exchange/interfaces.go b/chain/exchange/interfaces.go index c95127929be..ff11b63eb63 100644 --- a/chain/exchange/interfaces.go +++ b/chain/exchange/interfaces.go @@ -28,8 +28,8 @@ type Server interface { // used by the Syncer. type Client interface { // GetBlocks fetches block headers from the network, from the provided - // tipset *backwards*, returning as many tipsets as the count parameter, - // or less. + // tipset *backwards*, returning as many tipsets as the count parameter. + // The ONLY case in which we return fewer than `count` tipsets is if we hit genesis. GetBlocks(ctx context.Context, tsk types.TipSetKey, count int) ([]*types.TipSet, error) // GetChainMessages fetches messages from the network, starting from the first provided tipset From 925a19bbbc26d68ee2f08a30f071317ce5e9aadc Mon Sep 17 00:00:00 2001 From: Phi Date: Thu, 11 Jan 2024 11:16:08 +0100 Subject: [PATCH 4/5] Update changelog with sync-fix-backport Update changelog with sync-fix-backport --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fc5de4975b..6f72f7fc9eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,6 +107,7 @@ For more information on how to use SupraSeal PC2 with your `lotus-worker`, as we - feat: syncer: optimize syncFork for one-epoch forks ([filecoin-project/lotus#11533](https://github.com/filecoin-project/lotus/pull/11533)) - fix: sync: do not include incoming in return of syncFork ([filecoin-project/lotus#11541](https://github.com/filecoin-project/lotus/pull/11541)) - fix: wdpost: fix vanilla proof indexes ([filecoin-project/lotus#11550](https://github.com/filecoin-project/lotus/pull/11550)) +- feat: exchange: change GetBlocks to always fetch the requested number of tipsets ([filecoin-project/lotus#11565](https://github.com/filecoin-project/lotus/pull/11565)) ## Dependencies - update go-libp2p to v0.31.0 ([filecoin-project/lotus#11225](https://github.com/filecoin-project/lotus/pull/11225)) From 369c8fd9f7cb1cf14a23839b3da45cf546e5e388 Mon Sep 17 00:00:00 2001 From: Phi Date: Thu, 11 Jan 2024 11:31:29 +0100 Subject: [PATCH 5/5] Change date for release in changelog Change date for release in changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f72f7fc9eb..5da28470283 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ ## Improvements -# v1.25.2 / 2024-01-10 +# v1.25.2 / 2024-01-11 -This is an optional but highly recommended feature release of Lotus, as it includes fixes for synchronizations issues that users have experienced. The feature release also introduces Lotus-Provider in its alpha testing phase, as well as the ability to call external PC2-binaries during the sealing process. +This is an optional but **highly recommended feature release** of Lotus, as it includes fixes for synchronizations issues that users have experienced. The feature release also introduces `Lotus-Provider` in its alpha testing phase, as well as the ability to call external PC2-binaries during the sealing process. ## ☢️ Upgrade Warnings ☢️