mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
print_stages: bor snaps info (#9008)
This commit is contained in:
parent
379a5f8ea1
commit
4eecd8c86c
@ -42,7 +42,7 @@ var cmdResetState = &cobra.Command{
|
||||
defer borSn.Close()
|
||||
defer agg.Close()
|
||||
|
||||
if err := db.View(ctx, func(tx kv.Tx) error { return printStages(tx, sn, agg) }); err != nil {
|
||||
if err := db.View(ctx, func(tx kv.Tx) error { return printStages(tx, sn, borSn, agg) }); err != nil {
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
logger.Error(err.Error())
|
||||
}
|
||||
@ -58,7 +58,7 @@ var cmdResetState = &cobra.Command{
|
||||
|
||||
// set genesis after reset all buckets
|
||||
fmt.Printf("After reset: \n")
|
||||
if err := db.View(ctx, func(tx kv.Tx) error { return printStages(tx, sn, agg) }); err != nil {
|
||||
if err := db.View(ctx, func(tx kv.Tx) error { return printStages(tx, sn, borSn, agg) }); err != nil {
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
logger.Error(err.Error())
|
||||
}
|
||||
@ -97,7 +97,7 @@ func init() {
|
||||
rootCmd.AddCommand(cmdClearBadBlocks)
|
||||
}
|
||||
|
||||
func printStages(tx kv.Tx, snapshots *freezeblocks.RoSnapshots, agg *state.AggregatorV3) error {
|
||||
func printStages(tx kv.Tx, snapshots *freezeblocks.RoSnapshots, borSn *freezeblocks.BorRoSnapshots, agg *state.AggregatorV3) error {
|
||||
var err error
|
||||
var progress uint64
|
||||
w := new(tabwriter.Writer)
|
||||
@ -121,18 +121,16 @@ func printStages(tx kv.Tx, snapshots *freezeblocks.RoSnapshots, agg *state.Aggre
|
||||
}
|
||||
fmt.Fprintf(w, "--\n")
|
||||
fmt.Fprintf(w, "prune distance: %s\n\n", pm.String())
|
||||
fmt.Fprintf(w, "blocks.v2: %t, blocks=%d, segments=%d, indices=%d\n\n", snapshots.Cfg().Enabled, snapshots.BlocksAvailable(), snapshots.SegmentsMax(), snapshots.IndicesMax())
|
||||
fmt.Fprintf(w, "blocks.v2: %t, blocks=%d, segments=%d, indices=%d\n", snapshots.Cfg().Enabled, snapshots.BlocksAvailable(), snapshots.SegmentsMax(), snapshots.IndicesMax())
|
||||
fmt.Fprintf(w, "blocks.bor.v2: segments=%d, indices=%d\n\n", borSn.SegmentsMax(), borSn.IndicesMax())
|
||||
h3, err := kvcfg.HistoryV3.Enabled(tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lastK, lastV, err := rawdbv3.Last(tx, kv.MaxTxNum)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, lastBlockInHistSnap, _ := rawdbv3.TxNums.FindBlockNum(tx, agg.EndTxNumMinimax())
|
||||
fmt.Fprintf(w, "history.v3: %t, idx steps: %.02f, lastMaxTxNum=%d->%d, lastBlockInSnap=%d\n\n", h3, rawdbhelpers.IdxStepsCountV3(tx), u64or0(lastK), u64or0(lastV), lastBlockInHistSnap)
|
||||
_lb, _lt, _ := rawdbv3.TxNums.Last(tx)
|
||||
fmt.Fprintf(w, "history.v3: %t, idx steps: %.02f, lastBlockInSnap=%d, TxNums_Index(%d,%d)\n\n", h3, rawdbhelpers.IdxStepsCountV3(tx), lastBlockInHistSnap, _lb, _lt)
|
||||
s1, err := tx.ReadSequence(kv.EthTx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -1271,7 +1271,7 @@ func stageHistory(db kv.RwDB, ctx context.Context, logger log.Logger) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = printStages(tx, sn, agg)
|
||||
_ = printStages(tx, sn, borSn, agg)
|
||||
} else {
|
||||
if err := stagedsync.SpawnAccountHistoryIndex(stageAcc, tx, cfg, ctx, logger); err != nil {
|
||||
return err
|
||||
@ -1342,7 +1342,7 @@ func printAllStages(db kv.RoDB, ctx context.Context, logger log.Logger) error {
|
||||
defer sn.Close()
|
||||
defer borSn.Close()
|
||||
defer agg.Close()
|
||||
return db.View(ctx, func(tx kv.Tx) error { return printStages(tx, sn, agg) })
|
||||
return db.View(ctx, func(tx kv.Tx) error { return printStages(tx, sn, borSn, agg) })
|
||||
}
|
||||
|
||||
func printAppliedMigrations(db kv.RwDB, ctx context.Context, logger log.Logger) error {
|
||||
|
Loading…
Reference in New Issue
Block a user