fix(lotus-sim): return error from walk
This commit is contained in:
parent
500fae6a52
commit
fbaffe86da
@ -126,7 +126,7 @@ var infoCommitGasSimCommand = &cli.Command{
|
|||||||
var gasAggMax, proofsAggMax uint64
|
var gasAggMax, proofsAggMax uint64
|
||||||
var gasSingle, proofsSingle uint64
|
var gasSingle, proofsSingle uint64
|
||||||
|
|
||||||
sim.Walk(cctx.Context, cctx.Int64("lookback"), func(
|
err = sim.Walk(cctx.Context, cctx.Int64("lookback"), func(
|
||||||
sm *stmgr.StateManager, ts *types.TipSet, stCid cid.Cid,
|
sm *stmgr.StateManager, ts *types.TipSet, stCid cid.Cid,
|
||||||
messages []*simulation.AppliedMessage,
|
messages []*simulation.AppliedMessage,
|
||||||
) error {
|
) error {
|
||||||
@ -162,6 +162,9 @@ var infoCommitGasSimCommand = &cli.Command{
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
idealGassUsed := float64(gasAggMax) / float64(proofsAggMax) * float64(proofsAgg+proofsSingle)
|
idealGassUsed := float64(gasAggMax) / float64(proofsAggMax) * float64(proofsAgg+proofsSingle)
|
||||||
|
|
||||||
fmt.Printf("Gas usage efficiency in comparison to all 819: %f%%\n", 100*idealGassUsed/float64(gasAgg+gasSingle))
|
fmt.Printf("Gas usage efficiency in comparison to all 819: %f%%\n", 100*idealGassUsed/float64(gasAgg+gasSingle))
|
||||||
|
Loading…
Reference in New Issue
Block a user