-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement HRMP #1900
Changes from 1 commit
ab14b90
c318044
130accb
e1e4eb0
8ef66ec
196c4a4
71bb7a6
3dacd77
6e7979b
8363874
e6a84dc
19f01ac
d61440b
71aa0bb
f4b03ce
0fe6c9a
0dce9f8
3555327
af77075
1b2368b
02945d9
8448078
ee5078f
37c1fdd
be1013c
e546c3c
9e6e3c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,12 +17,13 @@ | |
| //! WASM validation for adder parachain. | ||
|
|
||
| use crate::{HeadData, BlockData}; | ||
| use core::{intrinsics, panic}; | ||
| use core::panic; | ||
| use sp_std::vec::Vec; | ||
| use parachain::primitives::{ValidationResult, HeadData as GenericHeadData}; | ||
| use codec::{Encode, Decode}; | ||
|
|
||
| #[no_mangle] | ||
| pub extern fn validate_block(params: *const u8, len: usize) -> u64 { | ||
| pub extern "C" fn validate_block(params: *const u8, len: usize) -> u64 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be preferred to have platform independent integer width length for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, this won't harm, but note that this code is for wasm only and we assume that it's 32 bits only.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just a beartrap in the woods, soon to be forgotten of its existence, and somebody will step into it eventually - it might not be a 🐻
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| let params = unsafe { parachain::load_params(params, len) }; | ||
| let parent_head = HeadData::decode(&mut ¶ms.parent_head.0[..]) | ||
| .expect("invalid parent head format."); | ||
|
|
@@ -38,7 +39,9 @@ pub extern fn validate_block(params: *const u8, len: usize) -> u64 { | |
| head_data: GenericHeadData(new_head.encode()), | ||
| new_validation_code: None, | ||
| upward_messages: sp_std::vec::Vec::new(), | ||
| horizontal_messages: sp_std::vec::Vec::new(), | ||
| processed_downward_messages: 0, | ||
| hrmp_watermark: params.relay_chain_height, | ||
| } | ||
| ) | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.