paritytech / paritytech/try-runtime-cli

No digest item for a custom consensus engine

Đang mở
#116 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Rust
Star
25
Fork
29
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong core/src/common/empty_block/inherents/providers.rs, đặc biệt là SmartInherentProvider và phần xây dựng digest quanh các dòng 129-140. Xem xét cách BABE và AURA được xử lý cũng như đường dẫn xác thực được tham chiếu; công việc được xem là hoàn tất khi đã thiết lập và kiểm thử một cách được hỗ trợ để các ID engine đồng thuận tùy chỉnh như SPIN cung cấp mục digest mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
blockchain
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.