WIP: update sectorbuilder
This commit is contained in:
@@ -456,7 +456,7 @@ create temp table mh (like miner_heads excluding constraints) on commit drop;
|
||||
return xerrors.Errorf("prep temp: %w", err)
|
||||
}
|
||||
|
||||
stmt, err := tx.Prepare(`copy mh (head, addr, stateroot, sectorset, setsize, provingset, provingsize, owner, worker, peerid, sectorsize, power, active, ppe, slashed_at) from STDIN`)
|
||||
stmt, err := tx.Prepare(`copy mh (head, addr, stateroot, sectorset, setsize, provingset, provingsize, owner, worker, peerid, sectorsize, power, ppe) from STDIN`)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -473,10 +473,8 @@ create temp table mh (like miner_heads excluding constraints) on commit drop;
|
||||
i.info.Worker.String(),
|
||||
i.info.PeerId.String(),
|
||||
i.info.SectorSize,
|
||||
i.state.Power.String(), // TODO: SPA
|
||||
i.state.Active,
|
||||
i.power.String(), // TODO: SPA
|
||||
i.state.PoStState.ProvingPeriodStart,
|
||||
i.state.SlashedAt,
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -5,13 +5,15 @@ import (
|
||||
"container/list"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
"github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
"math"
|
||||
"sync"
|
||||
|
||||
"github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
"github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/specs-actors/actors/abi"
|
||||
"github.com/filecoin-project/specs-actors/actors/abi/big"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
@@ -56,6 +58,7 @@ type minerInfo struct {
|
||||
state miner.State
|
||||
info miner.MinerInfo
|
||||
|
||||
power big.Int
|
||||
ssize uint64
|
||||
psize uint64
|
||||
}
|
||||
@@ -268,6 +271,13 @@ func syncHead(ctx context.Context, api api.FullNode, st *storage, ts *types.TipS
|
||||
par(50, kvmaparr(miners), func(it func() (minerKey, *minerInfo)) {
|
||||
k, info := it()
|
||||
|
||||
pow, err := api.StateMinerPower(ctx, k.addr, types.EmptyTSK)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
// Not sure why this would fail, but its probably worth continuing
|
||||
}
|
||||
info.power = pow.MinerPower
|
||||
|
||||
sszs, err := api.StateMinerSectorCount(ctx, k.addr, types.EmptyTSK)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
|
||||
@@ -268,7 +268,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) {
|
||||
Owner: owner, // TODO: That is useful
|
||||
Worker: owner,
|
||||
SectorSize: abi.SectorSize(ssize),
|
||||
Peer: peer.ID("SETME"),
|
||||
Peer: peer.ID("SETME"),
|
||||
})
|
||||
if err != nil {
|
||||
w.WriteHeader(400)
|
||||
|
||||
Reference in New Issue
Block a user