Add chain.basefee

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-08-07 23:53:11 +02:00
parent bf774fc29b
commit 239b5f547a
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -129,6 +129,12 @@ func RecordTipsetPoints(ctx context.Context, api api.FullNode, pl *PointList, ti
p = NewPoint("chain.blocktime", tsTime.Unix())
pl.AddPoint(p)
baseFeeBig := tipset.Blocks()[0].ParentBaseFee.Copy()
baseFeeRat := new(big.Rat).SetFrac(baseFeeBig.Int, new(big.Int).SetUint64(build.FilecoinPrecision))
baseFeeFloat, _ := baseFeeRat.Float64()
p = NewPoint("chain.basefee", baseFeeFloat)
pl.AddPoint(p)
for _, blockheader := range tipset.Blocks() {
bs, err := blockheader.Serialize()
if err != nil {