Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 committed Dec 14, 2024
1 parent 098b916 commit 921206f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cl/phase1/forkchoice/fork_graph/fork_graph_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ func (f *forkGraphDisk) GetState(blockRoot libcommon.Hash, alwaysCopy bool) (*st
}

func (f *forkGraphDisk) getState(blockRoot libcommon.Hash, alwaysCopy bool, addChainSegment bool) (*state.CachingBeaconState, error) {
// if f.currentState != nil && !alwaysCopy {
// currentStateBlockRoot, err := f.currentState.BlockRoot()
// if err != nil {
// return nil, err
// }
// if currentStateBlockRoot == blockRoot {
// return f.currentState, nil
// }
// }
if f.currentState != nil && !alwaysCopy {
currentStateBlockRoot, err := f.currentState.BlockRoot()
if err != nil {
return nil, err
}
if currentStateBlockRoot == blockRoot {
return f.currentState, nil
}
}

// collect all blocks between greatest extending node path and block.
blocksInTheWay := []*cltypes.SignedBeaconBlock{}
Expand Down
1 change: 1 addition & 0 deletions cl/phase1/forkchoice/fork_graph/fork_graph_disk_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (f *forkGraphDisk) readBeaconStateFromDisk(blockRoot libcommon.Hash, out *s
var file afero.File
f.stateDumpLock.Lock()
defer f.stateDumpLock.Unlock()
fmt.Println("getState")

file, err = f.fs.Open(getBeaconStateFilename(blockRoot))
if err != nil {
Expand Down

0 comments on commit 921206f

Please sign in to comment.