Skip to content

Commit c44210b

Browse files
committed
reduce comments
1 parent 4d21752 commit c44210b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

block/internal/common/replay.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ func (s *Replayer) replayBlock(ctx context.Context, height uint64) error {
151151
var prevState types.State
152152
if height == s.genesis.InitialHeight {
153153
// For the first block, use genesis state.
154-
// The header.AppHash contains the previous state's app hash (i.e., the genesis app hash).
155-
// This is what ExecuteTxs needs as input.
156154
prevState = types.State{
157155
ChainID: s.genesis.ChainID,
158156
InitialHeight: s.genesis.InitialHeight,
@@ -161,15 +159,12 @@ func (s *Replayer) replayBlock(ctx context.Context, height uint64) error {
161159
AppHash: header.AppHash, // Genesis app hash (input to first block execution)
162160
}
163161
} else {
164-
// Get previous state from store.
165162
// GetStateAtHeight(height-1) returns the state AFTER block height-1 was executed,
166163
// which contains the correct AppHash to use as input for executing block at 'height'.
167164
prevState, err = s.store.GetStateAtHeight(ctx, height-1)
168165
if err != nil {
169166
return fmt.Errorf("failed to get previous state: %w", err)
170167
}
171-
// Note: prevState.AppHash is already correct - it's the result of executing block height-1,
172-
// which is what we need as input for executing block at 'height'.
173168
}
174169

175170
// Prepare transactions
@@ -217,8 +212,7 @@ func (s *Replayer) replayBlock(ctx context.Context, height uint64) error {
217212
Str("app_hash", hex.EncodeToString(newAppHash)).
218213
Msg("replayBlock: app hash verified against stored state")
219214
} else {
220-
// State doesn't exist yet - this is expected during replay.
221-
// We trust the execution result since we're replaying validated blocks.
215+
// State doesn't exist yet, we trust the execution result since we're replaying validated blocks.
222216
s.logger.Debug().
223217
Uint64("height", height).
224218
Str("app_hash", hex.EncodeToString(newAppHash)).

0 commit comments

Comments
 (0)