Skip to content

Commit

Permalink
Restores memory footage report (#1194)
Browse files Browse the repository at this point in the history
* restore memory footage report

* Fix aida-sdb extension order
  • Loading branch information
wsodsong authored Oct 17, 2024
1 parent 9a4ee70 commit c4f770a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/aida-sdb/trace/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func (p operationProcessor) runTransaction(block uint64, operations []operation.
func replay(cfg *utils.Config, provider executor.Provider[[]operation.Operation], processor executor.Processor[[]operation.Operation], extra []executor.Extension[[]operation.Operation], aidaDb db.BaseDB) error {
var extensionList = []executor.Extension[[]operation.Operation]{
profiler.MakeCpuProfiler[[]operation.Operation](cfg),
statedb.MakeStateDbManager[[]operation.Operation](cfg, ""),
profiler.MakeMemoryUsagePrinter[[]operation.Operation](cfg),
profiler.MakeMemoryProfiler[[]operation.Operation](cfg),
statedb.MakeStateDbManager[[]operation.Operation](cfg, ""),
logger.MakeProgressLogger[[]operation.Operation](cfg, 0),
primer.MakeStateDbPrimer[[]operation.Operation](cfg),
}
Expand Down
14 changes: 8 additions & 6 deletions state/carmen.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,14 @@ func (s *carmenHeadState) GetArchiveBlockHeight() (uint64, bool, error) {
}

func (s *carmenStateDB) GetMemoryUsage() *MemoryUsage {
// todo waiting for implementation from carmen side
//usage := s.db.GetMemoryFootprint()
//if usage == nil {
// return &MemoryUsage{uint64(0), nil}
//}
return &MemoryUsage{uint64(0), nil}
if s.db == nil {
return &MemoryUsage{uint64(0), nil}
}
usage := s.db.GetMemoryFootprint()
if usage == nil {
return &MemoryUsage{uint64(0), nil}
}
return &MemoryUsage{uint64(usage.Total()), usage}
}

func (s *carmenStateDB) GetShadowDB() StateDB {
Expand Down

0 comments on commit c4f770a

Please sign in to comment.