Skip to content

feat(engine): add engine_getPayloadV4Hacked for megablock benchmarking#21092

Closed
gakonst wants to merge 1 commit intomainfrom
feat/engine-get-payload-v4-hacked
Closed

feat(engine): add engine_getPayloadV4Hacked for megablock benchmarking#21092
gakonst wants to merge 1 commit intomainfrom
feat/engine-get-payload-v4-hacked

Conversation

@gakonst
Copy link
Copy Markdown
Member

@gakonst gakonst commented Jan 15, 2026

Summary

Add engine_getPayloadV4Hacked endpoint for compatibility with Nethermind's execution-payloads-benchmarks tool.

This enables building megablocks (blocks with transactions from multiple source blocks merged together) for benchmarking execution client performance.

Background

Nethermind created the cber/get-payload-hacked branch (Oct 2025) as a quick solution for megablock benchmarking. This was later formalized as testing_buildBlockV1 spec (execution-apis #710).

This PR adds the hacked endpoint for backward compatibility with existing tooling, while reth already supports the standard testing_buildBlockV1.

Implementation

  • Adds EngineApiHacked trait with getPayloadV4Hacked method in engine namespace
  • Reuses TestingApi's block building logic (build_megablock())
  • Auto-derives parent and payload attributes from current head
  • Registers on auth RPC when testing module is enabled

How to use

Start reth with --http.api testing to enable both:

  • testing_buildBlockV1 on regular RPC
  • engine_getPayloadV4Hacked on auth RPC

API

{
  "method": "engine_getPayloadV4Hacked",
  "params": [["0x02f8...", "0x02f8..."]],  // raw tx RLP bytes
  "id": 1
}

Returns ExecutionPayloadEnvelopeV4 with execution requests.

Add engine_getPayloadV4Hacked endpoint for compatibility with Nethermind's
execution-payloads-benchmarks tool. This enables building megablocks
(blocks with transactions from multiple source blocks) for benchmarking.

The implementation:
- Adds EngineApiHacked trait with getPayloadV4Hacked method
- Reuses TestingApi's block building logic
- Auto-derives parent and payload attributes from current head
- Registers on auth RPC when testing module is enabled

This matches Nethermind's cber/get-payload-hacked branch implementation
that was a precursor to the testing_buildBlockV1 spec (execution-apis #710).
Copy link
Copy Markdown
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

unsure if we want to add this and #21082 or just #21082

Comment on lines +102 to +103
let gas_used =
builder.execute_transaction(tx).map_err(Eth::Error::from_eth_err)?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should skip invalid transactions like on this pr

https://github.com/paradigmxyz/reth/pull/21082/changes#diff-5319b461dfcf9b728e4d55a19e98a9a87f0bbd8000fca063732a6221a997c780R203

basically gracful handle the execute, if this is an invalid transaction, simply skip the transaction

similar to:

best_txs.mark_invalid(&pool_tx, &InvalidPoolTransactionError::Eip4844(error));

@mattsse
Copy link
Copy Markdown
Collaborator

mattsse commented Jan 15, 2026

superseded by #21094

@mattsse mattsse closed this Jan 15, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Reth Tracker Jan 15, 2026
@emmajam emmajam deleted the feat/engine-get-payload-v4-hacked branch May 1, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants