Measure the payload copy in the engine request, and share the block if it shows

オープン
#819 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
performance

調査の方向性

Read crates/blockchain/src/beacon_engine.rs and the changes in lambdaclass/ethlambda#755 to understand NewPayloadRequest::into_owned and the engine import phase metric. Measure request construction on a live node with an execution client for typical and transaction-heavy blocks, comparing it with the roughly 157 ms transition time cited in the issue. If the copy is material, apply the outlined Arc ownership approach; done means the measurement is reported and any resulting change avoids the actor-thread copy while preserving the block for on_block_speculative.

索引モデルが issue の本文から書いたものです。

説明

Since lambdaclass/ethlambda#755, a pre-gloas beacon import with an execution client sends engine_newPayloadV4 from a spawned task while the chain actor computes the block's state transition. The task cannot borrow the block, so NewPayloadRequest::into_owned (crates/blockchain/src/beacon_engine.rs) clones the block's ExecutionPayload, transactions included, on the actor thread before the request is spawned. Three automated reviewers raised the copy across two review rounds of that PR.

Its cost has not been measured, neither typically nor for a transaction-heavy worst case, so it is not known how it compares with the transition it overlaps (~157 ms at the docs' p50). Since #755 the engine import phase (lean_block_import_phase_seconds{phase="engine"}) includes building the request, so the copy is visible there on a live node: the phase's floor, for blocks whose answer arrived before the transition finished, is roughly the request construction.

Measuring it was out of scope for #755, since it needs a live node with an execution client.

What a fix would look like, if the floor is material:

  • Move the block into an Arc for the duration of the question.
  • Have the task build the request from its clone, so nothing is copied on the actor.
  • Take the block back with Arc::unwrap_or_clone before on_block_speculative. The task has finished by then, so this does not clone in practice.

OwnedNewPayloadRequest and into_owned would then go away.

主要言語
Rust
スター
86
フォーク
34
平均マージ
9日 20時間
マージ済み PR(30日)
77

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lambdaclass/ethlambda のほかの issue

lambdaclass/ethlambda の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。