Merge pull request #2489 from filecoin-project/fix/chainwatch/restore-block-reward

Restore base block reward; capture WinCount w header
This commit is contained in:
Łukasz Magiera 2020-07-21 01:21:00 +02:00 committed by GitHub
commit aba6eaf532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}
// TODO: Resolve Actor API shift
//rw.baseBlockReward = rewardActorState.LastPerEpochReward
//rw.baselinePower = rewardActorState.BaselinePower
rw.baseBlockReward = big.Zero()
rw.baselinePower = big.Zero()
rw.baseBlockReward = rewardActorState.ThisEpochReward
rw.baselinePower = rewardActorState.ThisEpochBaselinePower
out = append(out, rw)
}
}

View File

@ -110,7 +110,8 @@ create table if not exists blocks
miner text not null,
timestamp bigint not null,
ticket bytea not null,
eprof bytea,
election_proof bytea,
win_count bigint,
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 {
return err
}
for _, bh := range bhs {
var eprof interface{}
var eproof, winCount interface{}
if bh.ElectionProof != nil {
eprof = bh.ElectionProof.VRFProof
eproof = bh.ElectionProof.VRFProof
winCount = bh.ElectionProof.WinCount
}
if bh.Ticket == nil {
@ -428,7 +430,8 @@ create temp table b (like blocks excluding constraints) on commit drop;
bh.Miner.String(),
bh.Timestamp,
bh.Ticket.VRFProof,
eprof,
eproof,
winCount,
bh.ForkSignaling); err != nil {
log.Error(err)
}