From 5d9c6cd02c9c8ad8ef1cc67b8c63700eabf0f70d Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 28 Jul 2020 15:11:41 +0200 Subject: [PATCH] Add proof info to gas trace Signed-off-by: Jakub Sztandera --- chain/vm/gas_v0.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/chain/vm/gas_v0.go b/chain/vm/gas_v0.go index 068726d74..878ce8123 100644 --- a/chain/vm/gas_v0.go +++ b/chain/vm/gas_v0.go @@ -176,7 +176,18 @@ func (pl *pricelistV0) OnVerifySeal(info abi.SealVerifyInfo) GasCharge { // OnVerifyPost 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