Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable bad block hook in new tree #10425

Closed
Tracked by #10405
Rjected opened this issue Aug 21, 2024 · 3 comments
Closed
Tracked by #10405

Configurable bad block hook in new tree #10425

Rjected opened this issue Aug 21, 2024 · 3 comments
Assignees
Labels
A-blockchain-tree Related to sidechains, reorgs and pending blocks A-consensus Related to the consensus engine C-enhancement New feature or request

Comments

@Rjected
Copy link
Member

Rjected commented Aug 21, 2024

ref #10405

We currently do not have a good way of inspecting block output if it is a bad block. We cannot call RPC methods like debug_executionWitness or debug_traceBlock because the block failed validation. Instead, we need a way to run a user-defined method after a block errors because it is an invalid block.

If we wanted to be exhaustive, the hook would be run after this line:

let validation_err = error.ensure_validation_error()?;

However, then we would not be able to use the outputs of the block. Instead, we should run it if validation fails here:

if state_root != block.state_root {

Or here:

self.consensus.validate_block_post_execution(

It should be possible for the hook to re-execute the block with traces and get the witness + witness preimages.

@Rjected Rjected added C-enhancement New feature or request A-consensus Related to the consensus engine A-blockchain-tree Related to sidechains, reorgs and pending blocks labels Aug 21, 2024
@malik672
Copy link
Contributor

@Rjected assign me

@Rjected Rjected self-assigned this Aug 21, 2024
@Rjected
Copy link
Member Author

Rjected commented Aug 21, 2024

@Rjected assign me

Thanks, but I will actually be taking this issue

@Rjected
Copy link
Member Author

Rjected commented Sep 5, 2024

This was completed with #10432

@Rjected Rjected closed this as completed Sep 5, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-tree Related to sidechains, reorgs and pending blocks A-consensus Related to the consensus engine C-enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants