Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
6722a83b
Commit
6722a83b
authored
4 years ago
by
Bastian Köcher
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Forward storage changes in manual seal (#7614)
This prevents nodes from executing the same block 2 times.
parent
07c173af
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
substrate/client/consensus/manual-seal/src/lib.rs
+5
-5
5 additions, 5 deletions
substrate/client/consensus/manual-seal/src/lib.rs
substrate/client/consensus/manual-seal/src/seal_block.rs
+5
-4
5 additions, 4 deletions
substrate/client/consensus/manual-seal/src/seal_block.rs
with
10 additions
and
9 deletions
substrate/client/consensus/manual-seal/src/lib.rs
+
5
−
5
View file @
6722a83b
...
...
@@ -163,10 +163,10 @@ pub async fn run_manual_seal<B, BI, CB, E, C, A, SC, CS>(
C
:
HeaderBackend
<
B
>
+
Finalizer
<
B
,
CB
>
+
ProvideRuntimeApi
<
B
>
+
'static
,
CB
:
ClientBackend
<
B
>
+
'static
,
E
:
Environment
<
B
>
+
'static
,
E
::
Error
:
std
::
fmt
::
Display
,
<
E
::
Proposer
as
Proposer
<
B
>>
::
Error
:
std
::
fmt
::
Display
,
E
::
Proposer
:
Proposer
<
B
,
Transaction
=
TransactionFor
<
C
,
B
>>
,
CS
:
Stream
<
Item
=
EngineCommand
<<
B
as
BlockT
>
::
Hash
>>
+
Unpin
+
'static
,
SC
:
SelectChain
<
B
>
+
'static
,
TransactionFor
<
C
,
B
>
:
'static
,
{
while
let
Some
(
command
)
=
commands_stream
.next
()
.await
{
match
command
{
...
...
@@ -230,9 +230,9 @@ pub async fn run_instant_seal<B, BI, CB, E, C, A, SC>(
C
:
HeaderBackend
<
B
>
+
Finalizer
<
B
,
CB
>
+
ProvideRuntimeApi
<
B
>
+
'static
,
CB
:
ClientBackend
<
B
>
+
'static
,
E
:
Environment
<
B
>
+
'static
,
E
::
Error
:
std
::
fmt
::
Display
,
<
E
::
Proposer
as
Proposer
<
B
>>
::
Error
:
std
::
fmt
::
Display
,
SC
:
SelectChain
<
B
>
+
'static
E
::
Proposer
:
Proposer
<
B
,
Transaction
=
TransactionFor
<
C
,
B
>>
,
SC
:
SelectChain
<
B
>
+
'static
,
TransactionFor
<
C
,
B
>
:
'static
,
{
// instant-seal creates blocks as soon as transactions are imported
// into the transaction pool.
...
...
This diff is collapsed.
Click to expand it.
substrate/client/consensus/manual-seal/src/seal_block.rs
+
5
−
4
View file @
6722a83b
...
...
@@ -87,10 +87,10 @@ pub async fn seal_block<B, BI, SC, C, E, P>(
+
Send
+
Sync
+
'static
,
C
:
HeaderBackend
<
B
>
+
ProvideRuntimeApi
<
B
>
,
E
:
Environment
<
B
>
,
<
E
as
Environment
<
B
>>
::
Error
:
std
::
fmt
::
Display
,
<
E
::
Proposer
as
Proposer
<
B
>>
::
Error
:
std
::
fmt
::
Display
,
E
::
Proposer
:
Proposer
<
B
,
Transaction
=
TransactionFor
<
C
,
B
>>
,
P
:
txpool
::
ChainApi
<
Block
=
B
>
,
SC
:
SelectChain
<
B
>
,
TransactionFor
<
C
,
B
>
:
'static
,
{
let
future
=
async
{
if
pool
.validated_pool
()
.status
()
.ready
==
0
&&
!
create_empty
{
...
...
@@ -111,7 +111,7 @@ pub async fn seal_block<B, BI, SC, C, E, P>(
};
let
proposer
=
env
.init
(
&
parent
)
.map_err
(|
err
|
Error
::
StringError
(
format!
(
"{}"
,
err
)))
.await
?
;
.map_err
(|
err
|
Error
::
StringError
(
format!
(
"{
:?
}"
,
err
)))
.await
?
;
let
id
=
inherent_data_provider
.create_inherent_data
()
?
;
let
inherents_len
=
id
.len
();
...
...
@@ -122,7 +122,7 @@ pub async fn seal_block<B, BI, SC, C, E, P>(
};
let
proposal
=
proposer
.propose
(
id
.clone
(),
digest
,
Duration
::
from_secs
(
MAX_PROPOSAL_DURATION
),
false
.into
())
.map_err
(|
err
|
Error
::
StringError
(
format!
(
"{}"
,
err
)))
.await
?
;
.map_err
(|
err
|
Error
::
StringError
(
format!
(
"{
:?
}"
,
err
)))
.await
?
;
if
proposal
.block
.extrinsics
()
.len
()
==
inherents_len
&&
!
create_empty
{
return
Err
(
Error
::
EmptyTransactionPool
)
...
...
@@ -133,6 +133,7 @@ pub async fn seal_block<B, BI, SC, C, E, P>(
params
.body
=
Some
(
body
);
params
.finalized
=
finalize
;
params
.fork_choice
=
Some
(
ForkChoiceStrategy
::
LongestChain
);
params
.storage_changes
=
Some
(
proposal
.storage_changes
);
if
let
Some
(
digest_provider
)
=
digest_provider
{
digest_provider
.append_block_import
(
&
parent
,
&
mut
params
,
&
id
)
?
;
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment