mirror of
https://github.com/serai-dex/serai.git
synced 2025-03-12 09:26:51 +00:00
Move documentation to the top of the file
This commit is contained in:
parent
2cf1573c52
commit
56afb13ed5
1 changed files with 13 additions and 15 deletions
|
@ -1,4 +1,16 @@
|
|||
use std::{marker::PhantomData, sync::Arc, collections::HashMap};
|
||||
// The Tendermint machine will call add_block for any block which is committed to, regardless of
|
||||
// validity. To determine validity, it expects a validate function, which Substrate doesn't
|
||||
// directly offer, and an add function. In order to comply with Serai's modified view of inherent
|
||||
// transactions, validate MUST check inherents, yet add_block must not.
|
||||
//
|
||||
// In order to acquire a validate function, any block proposed by a legitimate proposer is
|
||||
// imported. This performs full validation and makes the block available as a tip. While this would
|
||||
// be incredibly unsafe thanks to the unchecked inherents, it's defined as a tip with less work,
|
||||
// despite being a child of some parent. This means it won't be moved to nor operated on by the
|
||||
// node.
|
||||
//
|
||||
// When Tendermint completes, the block is finalized, setting it as the tip regardless of work.
|
||||
|
||||
use sp_core::Decode;
|
||||
use sp_inherents::CreateInherentDataProviders;
|
||||
|
@ -19,6 +31,7 @@ use sc_consensus::{
|
|||
use tendermint_machine::ext::*;
|
||||
|
||||
use crate::signature_scheme::TendermintSigner;
|
||||
const CONSENSUS_ID: [u8; 4] = *b"tend";
|
||||
|
||||
struct TendermintBlockImport<
|
||||
B: Block,
|
||||
|
@ -48,21 +61,6 @@ impl<
|
|||
}
|
||||
}
|
||||
|
||||
// The Tendermint machine will call add_block for any block which is committed to, regardless of
|
||||
// validity. To determine validity, it expects a validate function, which Substrate doesn't
|
||||
// directly offer, and an add function. In order to comply with Serai's modified view of inherent
|
||||
// transactions, validate MUST check inherents, yet add_block must not.
|
||||
//
|
||||
// In order to acquire a validate function, any block proposed by a legitimate proposer is
|
||||
// imported. This performs full validation and makes the block available as a tip. While this would
|
||||
// be incredibly unsafe thanks to the unchecked inherents, it's defined as a tip with less work,
|
||||
// despite being a child of some parent. This means it won't be moved to nor operated on by the
|
||||
// node.
|
||||
//
|
||||
// When Tendermint completes, the block is finalized, setting it as the tip regardless of work.
|
||||
|
||||
const CONSENSUS_ID: [u8; 4] = *b"tend";
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl<
|
||||
B: Block,
|
||||
|
|
Loading…
Reference in a new issue