Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output sealing state changes to the deal log #775

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion storagemarket/deal_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,16 @@ func (p *Provider) execDeal(deal *smtypes.ProviderDealState, dh *dealHandler) *d
return derr
}

p.dealLogger.Infow(deal.DealUuid, "deal execution completed successfully")
// deal has been sent for sealing -> we can cleanup the deal state now and simply watch the deal on chain
// to wait for deal completion/slashing and update the state in DB accordingly.
p.cleanupDeal(deal)
p.dealLogger.Infow(deal.DealUuid, "finished deal cleanup after successful execution")

// Watch the sealing status of the deal and fire events for each change
p.dealLogger.Infow(deal.DealUuid, "watching deal sealing state changes")
p.fireSealingUpdateEvents(dh, deal.DealUuid, deal.SectorID)
p.cleanupDealHandler(deal.DealUuid)
p.dealLogger.Infow(deal.DealUuid, "deal sealing reached termination state")

// TODO
// Watch deal on chain and change state in DB and emit notifications.
Expand Down Expand Up @@ -632,6 +633,7 @@ func (p *Provider) fireSealingUpdateEvents(dh *dealHandler, dealUuid uuid.UUID,
return si.State
}

p.dealLogger.Infow(dealUuid, "sealing state: %s", si.State)
p.fireEventDealUpdate(dh.Publisher, deal)
}
return si.State
Expand Down