Queued pipe payloads can be silently dropped at stage time after passing the send-time size check

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

Start with pipe.rs send-time size checks, runtime.rs outbox staging, and the protocol session stage() implementations in panetiere.rs, panetiere_scheduled.rs, adcnet.rs, and noop.rs. Read config.rs and scheduler_core.rs to trace the Scheduled Panetiere limit mismatch. Reproduce both queued-frame cases, then verify accepted payloads are delivered or produce a clear failure signal.

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

説明

Summary

Pipe::send checks payload size once, when the payload is queued, and returns Ok(()) (pipe.rs:176-193). The frame then waits in the node-wide outbox until a round's participation draw takes it in sync_client_round and hands it to the client session's stage() (runtime.rs:1576-1588). Each protocol's session checks size again there, against its own limit. If that second check fails, the frame is thrown away: it isn't put back in the outbox, and the sender is never told. Two cases trigger this.

Case 1: Message size shrinks in a config update while a frame is queued

  1. The node runs a config where the smallest message_size across runnable subnets is, say, 1024.
  2. A pipe sends a 1000-byte payload. check_size_against passes and the frame is queued.
  3. The frame waits in the outbox for one or more rounds, either because no subnet was drawn yet or because other frames are ahead of it.
  4. A new config lowers message_size to 512. apply_config replaces the worker, because the protocol config is part of subnet_sig. The outbox is not re-checked.
  5. The new worker's sync_client_round pops the frame and calls stage(), which drops it.

This affects every protocol, each in its own way:

  • Panetiere: stage() logs an error and drops the frame (panetiere.rs:2013-2023).
  • Scheduled Panetiere: reserve_message returns an error, and stage() discards it with let _ = (panetiere_scheduled.rs:835), so nothing is logged.
  • ADCNet: contribute fails, which is only logged at debug level, and the payload is lost (adcnet.rs:1075, adcnet.rs:1104).
  • Noop: begin_round returns nothing for an oversized payload (noop.rs:47-51).

Case 2: The send-time and stage-time limits disagree (Scheduled Panetiere)

The pipe checks against ProtocolConfig::message_size(), which is message_size for Scheduled Panetiere (config.rs:238). The session checks against vector_bytes.min(u16::MAX) (panetiere_scheduled.rs:793). validate_structure rejects message_size > u16::MAX and vector_bytes == 0, but it does not require message_size <= vector_bytes (scheduler_core.rs:247-262).

With message_size = 1024 and vector_bytes = 512, any payload between about 513 and 1024 bytes passes the send check. It is then dropped every time, without a log line.

Expected

A payload that send accepts is either delivered, or the sender is clearly told it failed. Nothing is dropped silently.

Possible fixes

  • Case 2: require message_size <= vector_bytes in validate_structure, or have ProtocolConfig::message_size() return the effective limit for Scheduled Panetiere.
  • Case 1: re-check the outbox in apply_config and drop oversized frames with a warning or an event. Or have stage() return a result, so sync_client_round can log the drop and report it.
  • In both cases, log the dropped frame in Scheduled Panetiere's stage() instead of discarding the error.
主要言語
Rust
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

flashbots/anymone のほかの issue

flashbots/anymone の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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