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:
Bastian Köcher
2020-11-02 13:14:17 +01:00
committed by GitHub
parent 8cb049a75a
commit cfa078ae8a
15 changed files with 98 additions and 49 deletions
@@ -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(&params.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,
}
)
}