Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Market actor accepts deals published from miner control addresses #1321

Merged
merged 2 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
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
14 changes: 11 additions & 3 deletions actors/builtin/market/market_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,17 @@ func (a Actor) PublishStorageDeals(rt Runtime, params *PublishStorageDealsParams
rt.Abortf(exitcode.ErrIllegalArgument, "deal provider is not a StorageMinerActor")
}

_, worker, _ := builtin.RequestMinerControlAddrs(rt, provider)
if worker != rt.Caller() {
rt.Abortf(exitcode.ErrForbidden, "caller is not provider %v", provider)
caller := rt.Caller()
_, worker, controllers := builtin.RequestMinerControlAddrs(rt, provider)
callerOk := caller == worker
for _, controller := range controllers {
if callerOk {
break
}
callerOk = caller == controller
}
if !callerOk {
rt.Abortf(exitcode.ErrForbidden, "caller %v is not worker or control address of provider %v", caller, provider)
}

resolvedAddrs := make(map[addr.Address]addr.Address, len(params.Deals))
Expand Down
Loading