fix(chainwatch): Restore base block reward metric capture

This commit is contained in:
Mike Greenberg 2020-07-20 17:31:27 -04:00
parent deb1d6812e
commit cf917fc426
2 changed files with 10 additions and 10 deletions

View File

@ -118,11 +118,8 @@ func (p *Processor) processRewardActors(ctx context.Context, rewardTips ActorTip
return nil, xerrors.Errorf("unmarshal state (@ %s): %w", rw.common.stateroot.String(), err) return nil, xerrors.Errorf("unmarshal state (@ %s): %w", rw.common.stateroot.String(), err)
} }
// TODO: Resolve Actor API shift rw.baseBlockReward = rewardActorState.ThisEpochReward
//rw.baseBlockReward = rewardActorState.LastPerEpochReward rw.baselinePower = rewardActorState.ThisEpochBaselinePower
//rw.baselinePower = rewardActorState.BaselinePower
rw.baseBlockReward = big.Zero()
rw.baselinePower = big.Zero()
out = append(out, rw) out = append(out, rw)
} }
} }

View File

@ -110,7 +110,8 @@ create table if not exists blocks
miner text not null, miner text not null,
timestamp bigint not null, timestamp bigint not null,
ticket bytea not null, ticket bytea not null,
eprof bytea, election_proof bytea,
win_count bigint,
forksig bigint not null forksig bigint not null
); );
@ -401,15 +402,16 @@ create temp table b (like blocks excluding constraints) on commit drop;
} }
} }
stmt2, err := tx.Prepare(`copy b (cid, parentWeight, parentStateRoot, height, miner, "timestamp", ticket, eprof, forksig) from stdin`) stmt2, err := tx.Prepare(`copy b (cid, parentWeight, parentStateRoot, height, miner, "timestamp", ticket, election_proof, win_count, forksig) from stdin`)
if err != nil { if err != nil {
return err return err
} }
for _, bh := range bhs { for _, bh := range bhs {
var eprof interface{} var eproof, winCount interface{}
if bh.ElectionProof != nil { if bh.ElectionProof != nil {
eprof = bh.ElectionProof.VRFProof eproof = bh.ElectionProof.VRFProof
winCount = bh.ElectionProof.WinCount
} }
if bh.Ticket == nil { if bh.Ticket == nil {
@ -428,7 +430,8 @@ create temp table b (like blocks excluding constraints) on commit drop;
bh.Miner.String(), bh.Miner.String(),
bh.Timestamp, bh.Timestamp,
bh.Ticket.VRFProof, bh.Ticket.VRFProof,
eprof, eproof,
winCount,
bh.ForkSignaling); err != nil { bh.ForkSignaling); err != nil {
log.Error(err) log.Error(err)
} }