Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
91cbefc5
Commit
91cbefc5
authored
Jul 16, 2018
by
asynchronous rob
Committed by
Benjamin Kampmann
Jul 16, 2018
Browse files
hash random seed when using to choose round proposer (#336)
parent
3c273882
Changes
1
Hide whitespace changes
Inline
Side-by-side
consensus/src/lib.rs
View file @
91cbefc5
...
...
@@ -256,6 +256,8 @@ impl<C, N, P> bft::Environment<Block> for ProposerFactory<C, N, P>
authorities
:
&
[
AuthorityId
],
sign_with
:
Arc
<
ed25519
::
Pair
>
)
->
Result
<
(
Self
::
Proposer
,
Self
::
Input
,
Self
::
Output
),
Error
>
{
use
runtime_primitives
::
traits
::{
Hash
as
HashT
,
BlakeTwo256
};
const
DELAY_UNTIL
:
Duration
=
Duration
::
from_millis
(
5000
);
let
parent_hash
=
parent_header
.hash
()
.into
();
...
...
@@ -263,6 +265,7 @@ impl<C, N, P> bft::Environment<Block> for ProposerFactory<C, N, P>
let
id
=
BlockId
::
hash
(
parent_hash
);
let
duty_roster
=
self
.client
.duty_roster
(
&
id
)
?
;
let
random_seed
=
self
.client
.random_seed
(
&
id
)
?
;
let
random_seed
=
BlakeTwo256
::
hash
(
&*
random_seed
);
let
(
group_info
,
local_duty
)
=
make_group_info
(
duty_roster
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment