No digest item for a custom consensus engine

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

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

評価

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

調査の方向性

core/src/common/empty_block/inherents/providers.rs から始め、特に SmartInherentProvider と 129-140 行付近の digest 構築を確認してください。BABE と AURA がどのように処理されているか、および参照されている検証パスを確認してください。カスタムコンセンサスエンジン ID(SPIN など)が期待される digest item を提供できる、サポートされた方法を確立してテストできれば完了です。

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

説明

Hello! I work on a Substrate-based chain with a custom consensus engine and as suggested in https://github.com/paritytech/try-runtime-cli/blob/b45be7dfce89fd881be27171d3ea114ef19d832c/core/src/common/empty_block/inherents/providers.rs#L96-L98 reporting a case when SmartInherentProvider doesn't work for me.

Currently, providers.rs only accounts for BABE and AURA when constructing the digest for the empty block. In my case for QF Network's blockchain node QuantumFusion-network/qf-solochain we are developing a custom consensus engine called SPIN with its own engine ID SPIN_ENGINE_ID. Because of this there is no slot with the expected engine ID in the empty block and the slot number validation fails during try-runtime usage.

It is easy to add custom engine ID in a fork project like:

// core/src/common/empty_block/inherents/providers.rs#L128
let digest = vec![
    DigestItem::PreRuntime(
        BABE_ENGINE_ID,
        PreDigest::SecondaryPlain(SecondaryPlainPreDigest {
            slot,
            authority_index: 0,
        })
        .encode(),
    ),
    DigestItem::PreRuntime(AURA_ENGINE_ID, slot.encode()),
    DigestItem::PreRuntime(*b"spin", slot.encode()),
];

But perhaps there are some recommendations on how to properly support custom engine IDs in the digest? Thank you.

主要言語
Rust
スター
25
フォーク
29
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

paritytech/try-runtime-cli のほかの issue

paritytech/try-runtime-cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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