Skip to content

Conversation

@RodrigoVillar
Copy link
Contributor

@RodrigoVillar RodrigoVillar commented Dec 2, 2025

Why this should be merged

As part of switching from using go bench to custom benchmarks in the reexecution tests (#4508), we'll need to export CreateBlockChanFromLevelDB() so that the reexecution test and the export block range tool can use this (as they'll be living in separate packages as executables).

This PR is a precursor to #4639.

How this works

Moves CreateBlockChanFromLevelDB() and BlockKey() to the reexecute package so that it's accessible to both the reexecution test and the export block range test.

How this was tested

CI + ran task export-cchain-block-range locally

Need to be documented in RELEASES.md?

No

@RodrigoVillar RodrigoVillar marked this pull request as ready for review December 2, 2025 17:15
Copilot AI review requested due to automatic review settings December 2, 2025 17:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the reexecution test utilities by moving CreateBlockChanFromLevelDB() and BlockKey() functions from the tests/reexecute/c package to the new tests/reexecute package, making them publicly accessible for reuse across multiple packages.

Key changes:

  • Created new tests/reexecute/db.go file with exported CreateBlockChanFromLevelDB() and BlockKey() functions
  • Updated tests/reexecute/c/vm_reexecute_test.go to use the newly exported functions from the reexecute package
  • Removed duplicate code by consolidating shared functionality into a single, reusable location

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/reexecute/db.go New file containing exported block database utilities with CreateBlockChanFromLevelDB(), BlockKey(), and BlockResult type
tests/reexecute/c/vm_reexecute_test.go Updated to import and use the refactored functions from the reexecute package, removing local implementations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aaronbuchwald aaronbuchwald added this pull request to the merge queue Dec 3, 2025
Merged via the queue into master with commit 70148ed Dec 3, 2025
40 checks passed
@aaronbuchwald aaronbuchwald deleted the rodrigo/export-create-block-chan branch December 3, 2025 22:11
@github-project-automation github-project-automation bot moved this to Done 🎉 in avalanchego Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done 🎉

Development

Successfully merging this pull request may close these issues.

4 participants