Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restores memory footage report #1194

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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