diff --git a/core/state/state_recon_writer.go b/core/state/state_recon_writer.go index 3a31b4c89..d833d7305 100644 --- a/core/state/state_recon_writer.go +++ b/core/state/state_recon_writer.go @@ -191,6 +191,12 @@ func (rs *ReconnWork) RollbackCount() uint64 { return rs.rollbackCount } +func (rs *ReconnWork) QueueLen() int { + rs.lock.RLock() + defer rs.lock.RUnlock() + return rs.queue.Len() +} + func (rs *ReconState) SizeEstimate() uint64 { rs.lock.RLock() defer rs.lock.RUnlock() diff --git a/eth/stagedsync/exec3.go b/eth/stagedsync/exec3.go index ecc98d70d..f2a55b2a7 100644 --- a/eth/stagedsync/exec3.go +++ b/eth/stagedsync/exec3.go @@ -781,7 +781,7 @@ func ReconstituteState(ctx context.Context, s *StageState, dirs datadir.Dirs, wo prevRollbackCount = rollbackCount log.Info("State reconstitution", "workers", workerCount, "progress", fmt.Sprintf("%.2f%%", progress), "tx/s", fmt.Sprintf("%.1f", speedTx), "workCh", fmt.Sprintf("%d/%d", len(workCh), cap(workCh)), - "repeat ratio", fmt.Sprintf("%.2f%%", repeatRatio), "blk", bn, + "repeat ratio", fmt.Sprintf("%.2f%%", repeatRatio), "queue.len", rs.QueueLen(), "blk", bn, "buffer", fmt.Sprintf("%s/%s", common.ByteCount(sizeEstimate), common.ByteCount(commitThreshold)), "alloc", common.ByteCount(m.Alloc), "sys", common.ByteCount(m.Sys)) if sizeEstimate >= commitThreshold { diff --git a/go.mod b/go.mod index 052db4257..2aa42807b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/gballet/go-verkle v0.0.0-20220829125900-a702d458d33c - github.com/ledgerwatch/erigon-lib v0.0.0-20221023074755-556ff6a55357 + github.com/ledgerwatch/erigon-lib v0.0.0-20221024025924-48ff56eead80 github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20221023043405-d157dec75e9a github.com/ledgerwatch/log/v3 v3.6.0 github.com/ledgerwatch/secp256k1 v1.0.0 diff --git a/go.sum b/go.sum index 0e2cfcade..d901b59d4 100644 --- a/go.sum +++ b/go.sum @@ -556,8 +556,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/ledgerwatch/erigon-lib v0.0.0-20221023074755-556ff6a55357 h1:L1QVgFHbqwaZQGit5Qm0PTEb6E9ijYcpgBnY19H8jdA= -github.com/ledgerwatch/erigon-lib v0.0.0-20221023074755-556ff6a55357/go.mod h1:jv4jmffliy8Us1wXdT6Q1f/nrrmC6Xrr6V70JxZRp48= +github.com/ledgerwatch/erigon-lib v0.0.0-20221024025924-48ff56eead80 h1:cXOkc2KEW0AMwXacC3h5Ugwm7np4etAQfN7xM7b3cSA= +github.com/ledgerwatch/erigon-lib v0.0.0-20221024025924-48ff56eead80/go.mod h1:jv4jmffliy8Us1wXdT6Q1f/nrrmC6Xrr6V70JxZRp48= github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20221023043405-d157dec75e9a h1:5Lw7NR/KWxtAokY11DKaMnrI6Zb04OzX8BQMbF8Lu/w= github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20221023043405-d157dec75e9a/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo= github.com/ledgerwatch/log/v3 v3.6.0 h1:JBUSK1epPyutUrz7KYDTcJtQLEHnehECRpKbM1ugy5M=