Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 committed Nov 16, 2024
1 parent 2d8504f commit 54800fe
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions cl/phase1/core/state/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ func (b *CachingBeaconState) InitBeaconState() error {
if b.Version() >= clparams.Phase0Version {
return b._initializeValidatorsPhase0()
}

return nil
}

Expand Down
4 changes: 1 addition & 3 deletions cl/phase1/core/state/raw/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ func New(cfg *clparams.BeaconChainConfig) *BeaconState {
}

func (b *BeaconState) init() error {
if b.touchedLeaves == nil {
b.touchedLeaves = make([]atomic.Uint32, StateLeafSize)
}
b.touchedLeaves = make([]atomic.Uint32, StateLeafSize)
return nil
}

Expand Down
1 change: 0 additions & 1 deletion cl/phase1/forkchoice/fork_choice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func TestForkChoiceBasic(t *testing.T) {
require.Equal(t, headSlot, uint64(3))
require.Equal(t, headRoot, libcommon.HexToHash("0x744cc484f6503462f0f3a5981d956bf4fcb3e57ab8687ed006467e05049ee033"))
// last block
fmt.Println("X")
require.NoError(t, store.OnBlock(ctx, block0xd4, false, true, false))
require.Equal(t, store.Time(), uint64(36))
require.Equal(t, store.ProposerBoostRoot(), libcommon.HexToHash("0x744cc484f6503462f0f3a5981d956bf4fcb3e57ab8687ed006467e05049ee033"))
Expand Down
4 changes: 2 additions & 2 deletions cl/phase1/forkchoice/fork_graph/fork_graph_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@ func (f *forkGraphDisk) GetState(blockRoot libcommon.Hash, out *state.CachingBea
}
}
blocksInTheWay = append(blocksInTheWay, block)

currentIteratorRoot = block.Block.ParentRoot
}

// Traverse the blocks from top to bottom.
for i := len(blocksInTheWay) - 1; i >= 0; i-- {
if err := transition.TransitionState(copyReferencedState, blocksInTheWay[i], nil, false); err != nil {
return nil, err
return nil, fmt.Errorf("GetState: %w, blockRoot; %x", err, blockRoot)
}
}
return copyReferencedState, nil
Expand Down

0 comments on commit 54800fe

Please sign in to comment.