mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Adder collator improvements (#1896)
* Fixes bug that collator wasn't sending `Declare` message * Set authority discovery config * Fixes bug that collator wasn't sending `Declare` message * Adds real overseer feature and makes the wasm_validation fail with a proper error * Adds README * Remove debug stuff * Add feature * Make adder collator use the correct parent when building a new block
This commit is contained in:
@@ -58,7 +58,7 @@ impl HeadData {
|
||||
}
|
||||
|
||||
/// Block data for this parachain.
|
||||
#[derive(Default, Clone, Encode, Decode)]
|
||||
#[derive(Default, Clone, Encode, Decode, Debug)]
|
||||
pub struct BlockData {
|
||||
/// State to begin from.
|
||||
pub state: u64,
|
||||
|
||||
@@ -32,15 +32,13 @@ pub extern fn validate_block(params: *const u8, len: usize) -> u64 {
|
||||
|
||||
let parent_hash = tiny_keccak::keccak256(¶ms.parent_head.0[..]);
|
||||
|
||||
match crate::execute(parent_hash, parent_head, &block_data) {
|
||||
Ok(new_head) => parachain::write_result(
|
||||
&ValidationResult {
|
||||
head_data: GenericHeadData(new_head.encode()),
|
||||
new_validation_code: None,
|
||||
upward_messages: sp_std::vec::Vec::new(),
|
||||
processed_downward_messages: 0,
|
||||
}
|
||||
),
|
||||
Err(_) => panic!("execution failure"),
|
||||
}
|
||||
let new_head = crate::execute(parent_hash, parent_head, &block_data).expect("Executes block");
|
||||
parachain::write_result(
|
||||
&ValidationResult {
|
||||
head_data: GenericHeadData(new_head.encode()),
|
||||
new_validation_code: None,
|
||||
upward_messages: sp_std::vec::Vec::new(),
|
||||
processed_downward_messages: 0,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user