|
7 | 7 | "fmt" |
8 | 8 | "maps" |
9 | 9 | "math" |
10 | | - "os" |
11 | | - "path/filepath" |
12 | 10 | "sort" |
13 | 11 | "sync" |
14 | 12 | "sync/atomic" |
@@ -264,21 +262,8 @@ func (pe *parallelExecutor) exec(ctx context.Context, execStage *StageState, u U |
264 | 262 | } |
265 | 263 | } |
266 | 264 | 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) |
282 | 267 | } |
283 | 268 | } |
284 | 269 | } |
|
0 commit comments