Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4f03019
update basic_add wasm
rphmeier Jul 18, 2018
82def8c
Merge remote-tracking branch 'upstream/master' into basic-add-collator
rphmeier Jul 18, 2018
6d7a112
wasm feature and collator feature
rphmeier Jul 18, 2018
7a2b86a
move test parachains around a little
rphmeier Jul 20, 2018
78c0226
fix wasm build for basic_add
rphmeier Jul 20, 2018
18dfc62
move basic_add to adder, introduce README
rphmeier Jul 20, 2018
2bdcaf9
minimal basic_add collator
rphmeier Jul 23, 2018
9083847
ensure collator messages are sent in the right order
rphmeier Jul 23, 2018
c157c4c
more logging
rphmeier Jul 23, 2018
6b5f5ff
route consensus statements to all peers
rphmeier Jul 23, 2018
957f69e
minor bugfixes for parachains
rphmeier Jul 23, 2018
d9e1c77
genesis builder accounts for parachain heads
rphmeier Jul 23, 2018
53889d7
Merge remote-tracking branch 'upstream/master' into rh-simple-parachain
rphmeier Jul 24, 2018
d628c3d
fix parachains tests
rphmeier Jul 24, 2018
5653984
targets for txpool
rphmeier Jul 24, 2018
6888a5b
tweak runtime + collator
rphmeier Jul 25, 2018
beded4c
Merge remote-tracking branch 'upstream/master' into rh-simple-parachain
rphmeier Jul 26, 2018
ec68919
fix version in adder-collator
rphmeier Jul 27, 2018
5c633ea
Merge remote-tracking branch 'upstream/master' into rh-simple-parachain
rphmeier Jul 27, 2018
5625a81
consistency for overflowing
rphmeier Jul 27, 2018
b8e9dfc
Merge branch 'master' into rh-simple-parachain
gavofyork Jul 29, 2018
2e7d5c8
Merge remote-tracking branch 'upstream/master' into rh-simple-parachain
rphmeier Jul 30, 2018
55cbde1
Merge branch 'rh-simple-parachain' of github.com:paritytech/polkadot …
rphmeier Jul 30, 2018
1ebdd12
adjust comment
rphmeier Jul 30, 2018
65112b3
fix stable test run
rphmeier Jul 30, 2018
5e50c6a
remove dummy registration test
rphmeier Jul 30, 2018
b393ae9
final grumbles
rphmeier Jul 31, 2018
b1e3250
Merge remote-tracking branch 'upstream/master' into rh-simple-parachain
rphmeier Aug 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move test parachains around a little
  • Loading branch information
rphmeier committed Jul 20, 2018
commit 7a2b86a6d53bd2f7256cfe3fdb88e3903b465dc3
56 changes: 55 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ members = [
"polkadot/transaction-pool",
"polkadot/service",

"polkadot/test-parachains/basic-add",
"polkadot/test-parachains/basic-add/wasm",

"substrate/bft",
"substrate/client",
"substrate/client/db",
Expand Down Expand Up @@ -79,6 +82,10 @@ exclude = [
"substrate/test-runtime/wasm",
]

[profile.release]
panic = "abort"
lto = true

[badges]
travis-ci = { repository = "paritytech/polkadot", branch = "master" }
maintenance = { status = "actively-developed" }
Expand Down
32 changes: 0 additions & 32 deletions polkadot/parachain/test-chains/basic_add/Cargo.toml

This file was deleted.

52 changes: 0 additions & 52 deletions polkadot/parachain/test-chains/basic_add/src/lib.rs

This file was deleted.

9 changes: 9 additions & 0 deletions polkadot/test-parachains/basic-add/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "basic-add"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Test parachain which adds to a number as its state transition"

[dependencies]
polkadot-parachain = { path = "../../parachain/", default-features = false }
tiny-keccak = "1.4"
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ extern crate polkadot_parachain as parachain;
extern crate polkadot_collator as collator;
extern crate tiny_keccak;

use collator::ParachainContext;

mod common;

fn main() {
println!("Hello!");
::collator::run_collator(

)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Parity Technologies (UK) Ltd.
// Copyright 2017 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
Expand All @@ -14,7 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Data definitions for the basic_add parachain.
//! Basic parachain that adds a number as part of its state.

#![no_std]

extern crate polkadot_parachain as parachain;
extern crate tiny_keccak;

use parachain::codec::{Decode, Encode, Input, Output};

Expand Down
18 changes: 18 additions & 0 deletions polkadot/test-parachains/basic-add/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "basic-add-wasm"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
basic-add = { path = ".." }
polkadot-parachain = { path = "../../../parachain", default-features = false }
wee_alloc = { version = "0.4.1" }
pwasm-libc = { version = "0.2" }
tiny-keccak = "1.4"

[profile.release]
panic = "abort"
lto = true

[lib]
crate-type = ["cdylib"]
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,30 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Defines WASM module logic.
//! WASM validation for basic-add parachain.

use core::{intrinsics, panic, alloc};
use parachain::{self, ValidationResult};
#![no_std]

#![feature(
alloc, core_intrinsics, lang_items, panic_implementation, core_panic_info,
alloc_error_handler
)]

extern crate alloc;
extern crate wee_alloc;
extern crate pwasm_libc;
extern crate basic_add;
extern crate polkadot_parachain as parachain;
extern crate tiny_keccak;

// Define global allocator.
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

use core::{intrinsics, panic};
use parachain::ValidationResult;
use parachain::codec::{Encode, Decode};
use super::{HeadData, BlockData};
use basic_add::{HeadData, BlockData};

#[panic_implementation]
#[no_mangle]
Expand All @@ -31,7 +49,7 @@ pub fn panic(_info: &panic::PanicInfo) -> ! {

#[alloc_error_handler]
#[no_mangle]
pub fn oom(_: alloc::Layout) -> ! {
pub fn oom(_: ::core::alloc::Layout) -> ! {
unsafe {
intrinsics::abort();
}
Expand All @@ -48,9 +66,8 @@ pub extern fn validate(offset: usize, len: usize) -> usize {

let parent_hash = ::tiny_keccak::keccak256(&params.parent_head[..]);

match ::common::execute(parent_hash, parent_head, &block_data) {
match ::basic_add::execute(parent_hash, parent_head, &block_data) {
Ok(new_head) => parachain::write_result(ValidationResult { head_data: new_head.encode() }),
Err(_) => panic!("execution failure"),
}

}