Skip to content

Commit d816bea

Browse files
committed
reinsert bal check
1 parent 3628943 commit d816bea

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

execution/stagedsync/exec3_parallel.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import (
77
"fmt"
88
"maps"
99
"math"
10-
"os"
11-
"path/filepath"
1210
"sort"
1311
"sync"
1412
"sync/atomic"
@@ -264,21 +262,8 @@ func (pe *parallelExecutor) exec(ctx context.Context, execStage *StageState, u U
264262
}
265263
}
266264
if headerBALHash != bal.Hash() {
267-
// Dump both computed and stored BAL for comparison
268-
balDir := filepath.Join(pe.cfg.dirs.DataDir, "bal")
269-
os.MkdirAll(balDir, 0755) //nolint:errcheck
270-
if dbBALBytes != nil {
271-
os.WriteFile(filepath.Join(balDir, fmt.Sprintf("stored_bal_%d.rlp", applyResult.BlockNum)), dbBALBytes, 0644) //nolint:errcheck
272-
storedBAL, decErr := types.DecodeBlockAccessListBytes(dbBALBytes)
273-
if decErr == nil && storedBAL != nil {
274-
os.WriteFile(filepath.Join(balDir, fmt.Sprintf("stored_bal_%d.txt", applyResult.BlockNum)), []byte(storedBAL.DebugString()), 0644) //nolint:errcheck
275-
}
276-
}
277-
computedBytes, _ := types.EncodeBlockAccessListBytes(bal)
278-
os.WriteFile(filepath.Join(balDir, fmt.Sprintf("computed_bal_%d.rlp", applyResult.BlockNum)), computedBytes, 0644) //nolint:errcheck
279-
os.WriteFile(filepath.Join(balDir, fmt.Sprintf("computed_bal_%d.txt", applyResult.BlockNum)), []byte(bal.DebugString()), 0644) //nolint:errcheck
280-
// TEMPORARY: warn instead of error to allow sync to continue for debugging
281-
log.Warn("BAL mismatch (continuing)", "block", applyResult.BlockNum, "computed", bal.Hash(), "expected", headerBALHash, "storedBAL", dbBALBytes != nil)
265+
log.Info(fmt.Sprintf("computed bal: %s", bal.DebugString()))
266+
return fmt.Errorf("%w, block=%d: block access list mismatch: got %s expected %s", rules.ErrInvalidBlock, applyResult.BlockNum, bal.Hash(), headerBALHash)
282267
}
283268
}
284269
}

0 commit comments

Comments
 (0)