From 726964b25444f6741fa128e3fc5ae7bdb48e5ab3 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 15 Oct 2024 17:56:12 +0400 Subject: [PATCH 1/2] check provider for ddo deals --- storagemarket/direct_deals_provider.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/storagemarket/direct_deals_provider.go b/storagemarket/direct_deals_provider.go index 1447b30ae..bff8f5077 100644 --- a/storagemarket/direct_deals_provider.go +++ b/storagemarket/direct_deals_provider.go @@ -149,6 +149,22 @@ func (ddp *DirectDealsProvider) Accept(ctx context.Context, entry *types.DirectD log.Infow("found allocation for client", "allocation", spew.Sdump(allocation)) + mid, err := address.IDFromAddress(ddp.Address) + if err != nil { + log.Warnw("failed to get miner ID from address", "err", err) + return &api.ProviderDealRejectionInfo{ + Accepted: false, + Reason: "server error: miner address to ID conversion", + }, nil + } + + if allocation.Provider != abi.ActorID(mid) { + return &api.ProviderDealRejectionInfo{ + Accepted: false, + Reason: fmt.Sprintf("allocation provider %s does not match miner address %s", allocation.Provider, ddp.Address), + }, nil + } + // If the TermMin is longer than initial sector duration, the deal will be dropped from the sector if allocation.TermMin > miner13types.MaxSectorExpirationExtension-policy.SealRandomnessLookback { return &api.ProviderDealRejectionInfo{ From 12951158e25f668395b3085fe94af6e307b42429 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 15 Oct 2024 18:33:29 +0400 Subject: [PATCH 2/2] github action don't fail early --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ceaaf4d49..5afa0e456 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,7 @@ jobs: runs-on: [self-hosted, docker] needs: [setup-params] strategy: + fail-fast: false # Continue running even if one test fails matrix: test-suite: - name: test-itest-dummydeal_offline