From 347ed154b8a568cb17be29d4494e7ef70f565780 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Mon, 10 Aug 2020 16:22:02 -0700 Subject: [PATCH] more informative chain list --- chain/blocksync/client.go | 2 +- cli/chain.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chain/blocksync/client.go b/chain/blocksync/client.go index 87cb41d44..bc1826527 100644 --- a/chain/blocksync/client.go +++ b/chain/blocksync/client.go @@ -393,7 +393,7 @@ func (client *BlockSync) sendRequestToPeer( &res) if err != nil { client.peerTracker.logFailure(peer, build.Clock.Since(connectionStart)) - return nil, err + return nil, xerrors.Errorf("failed to read blocksync response: %w", err) } // FIXME: Move all this together at the top using a defer as done elsewhere. diff --git a/cli/chain.go b/cli/chain.go index 12f632b36..28a55c313 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -419,7 +419,8 @@ var chainListCmd = &cli.Command{ } tss = otss for i, ts := range tss { - fmt.Printf("%d: %d blocks\n", ts.Height(), len(ts.Blocks())) + pbf := ts.Blocks()[0].ParentBaseFee + fmt.Printf("%d: %d blocks (baseFee: %s -> maxFee: %s)\n", ts.Height(), len(ts.Blocks()), ts.Blocks()[0].ParentBaseFee, types.FIL(types.BigMul(pbf, types.NewInt(build.BlockGasLimit)))) for _, b := range ts.Blocks() { msgs, err := api.ChainGetBlockMessages(ctx, b.Cid()) @@ -445,7 +446,7 @@ var chainListCmd = &cli.Command{ avgpremium = big.Div(psum, big.NewInt(int64(lenmsgs))) } - fmt.Printf("\t%s: \t%d msgs, gasLimit: %d / %d (%0.2f%%), avgPrice: %s\n", b.Miner, len(msgs.BlsMessages)+len(msgs.SecpkMessages), limitSum, build.BlockGasLimit, 100*float64(limitSum)/float64(build.BlockGasLimit), avgpremium) + fmt.Printf("\t%s: \t%d msgs, gasLimit: %d / %d (%0.2f%%), avgPremium: %s\n", b.Miner, len(msgs.BlsMessages)+len(msgs.SecpkMessages), limitSum, build.BlockGasLimit, 100*float64(limitSum)/float64(build.BlockGasLimit), avgpremium) } if i < len(tss)-1 { msgs, err := api.ChainGetParentMessages(ctx, tss[i+1].Blocks()[0].Cid())