-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Collator for the "adder" (formerly basic-add) parachain and various small fixes #438
Conversation
polkadot/test-parachains/build.sh
Outdated
|
|
||
| for i in adder | ||
| do | ||
| cd $i/wasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces
Cargo.toml
Outdated
|
|
||
| "polkadot/test-parachains/adder", | ||
| "polkadot/test-parachains/adder/collator", | ||
| "polkadot/test-parachains/adder/wasm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this in members but other wasm projects in exclude?
| // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //! Defines WASM module logic. | ||
| //! WASM validation for basic-add parachain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's adder now
polkadot/collator/src/lib.rs
Outdated
| E: IntoFuture<Item=(),Error=()>, | ||
| E::Future: Send + Clone + 'static, | ||
| I: IntoIterator<Item=T>, | ||
| T: Into<std::ffi::OsString> + Clone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes it to be called T? : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following convention of the rest of the files using args. I wasn't trying to write PEE IT...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure : ) Just wonder if we can do something, since one letter type names go unweildy if there are more than about 3 or more of them
| /// State to begin from. | ||
| pub state: u64, | ||
| /// Amount to add (overflowing) | ||
| pub add: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it overflowing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to specify!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean what makes it overflowing? Like, we don't do anything like summing with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, did you mean that it is %-ed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is meant to be an overflowing add
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah now it makes sense
| return Err(StateMismatch); | ||
| } | ||
|
|
||
| let new_state = block_data.state.saturating_add(block_data.add); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't it wrapping? : )
| }; | ||
|
|
||
| let next_body = AdderBody { | ||
| state: last_body.state + last_body.add, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this isn't saturating (like in adder::execute)?
| ::tiny_keccak::keccak256(state.encode().as_slice()) | ||
| } | ||
|
|
||
| /// Start state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, did you mean to write something different? : )
3baa94a to
b393ae9
Compare
* master: Collator for the "adder" (formerly basic-add) parachain and various small fixes (#438) Storage changes subscription (#464) Wasm execution optimizations (#466) Fix the --key generation (#475) Fix typo in service.rs (#472) Fix session phase in early-exit (#453) Make ping unidirectional (#458) Update README.adoc
* Add runtime version in release note * Extract spec version using script * . * . * . * . * Rename to dump_spec_version.py * .
…ry-genesis-block Skip processing the genesis primary block on executor
…ritytech#438) * apply std feature to runtime to avoid static assertion error * std is a default feature anyway
cargo run -p adder-collator -- --bootnodes '...'to connect to a validator or two, then if the parachain is registered (assumes ID 100), it'll begin to collate.