Add proof info to gas trace

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-07-28 15:11:41 +02:00
parent 2cbe8fd707
commit 5d9c6cd02c
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -176,7 +176,18 @@ func (pl *pricelistV0) OnVerifySeal(info abi.SealVerifyInfo) GasCharge {
// OnVerifyPost // OnVerifyPost
func (pl *pricelistV0) OnVerifyPost(info abi.WindowPoStVerifyInfo) GasCharge { func (pl *pricelistV0) OnVerifyPost(info abi.WindowPoStVerifyInfo) GasCharge {
return newGasCharge("OnVerifyPost", pl.verifyPostBase, 0).WithExtra(len(info.ChallengedSectors)) sectorSize := "unknown"
if len(info.ChallengedSectors) != 0 {
ss, err := info.ChallengedSectors[0].SealProof.SectorSize()
if err == nil {
sectorSize = ss.ShortString()
}
}
return newGasCharge("OnVerifyPost", pl.verifyPostBase, 0).
WithExtra(map[string]interface{}{
"type": sectorSize,
"size": len(info.ChallengedSectors),
})
} }
// OnVerifyConsensusFault // OnVerifyConsensusFault