Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Enable Offchain Equalise #5683

Merged
merged 13 commits into from
Apr 27, 2020
Merged

Enable Offchain Equalise #5683

merged 13 commits into from
Apr 27, 2020

Conversation

kianenigma
Copy link
Contributor

@kianenigma kianenigma commented Apr 17, 2020

Following: #5452

Just enables to offchain worker code that submits the solution back to run a random number of iterations (capped by type MaxIterations). Rest of the changes pertain to fuzzing and testing.

polkadot companion: paritytech/polkadot#1039

@kianenigma kianenigma added the A0-please_review Pull request needs code review. label Apr 17, 2020
@kianenigma kianenigma requested a review from gavofyork April 17, 2020 12:47
@gui1117
Copy link
Contributor

gui1117 commented Apr 20, 2020

why does it includes #5686 ?

@kianenigma
Copy link
Contributor Author

pushed by mistake. I will revert.

@@ -363,6 +364,8 @@ impl pallet_staking::Trait for Runtime {
type ElectionLookahead = ElectionLookahead;
type Call = Call;
type SubmitTransaction = TransactionSubmitterOf<()>;
type Randomness = RandomnessCollectiveFlip;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Babe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ow I didn't know Babe also implements it. What are the differences? I don't think the randomness that Staking needs is in any sense consensus critical.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babe provides "real" randomness, while the one provided by collective flip is based on the last 80? block hashes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a local (non-deterministic) rand() function for offchain workers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll switch to that then 👍

@gavofyork gavofyork added A8-mergeoncegreen and removed A0-please_review Pull request needs code review. labels Apr 24, 2020
@gavofyork
Copy link
Member

Needs a companion PR.

@kianenigma kianenigma requested a review from NikVolf as a code owner April 27, 2020 08:57
@gavofyork
Copy link
Member

bot merge

@gavofyork gavofyork merged commit 05275e8 into master Apr 27, 2020
@gavofyork gavofyork deleted the kiz-enable-equialize-offchain-2 branch April 27, 2020 16:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants