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
d805f3d5
Unverified
Commit
d805f3d5
authored
Apr 05, 2020
by
Gavin Wood
Committed by
GitHub
Apr 05, 2020
Browse files
Update for using Mandatory inherents (#967)
* Update for using Mandatory inherents. * use
parent
0e30fd63
Pipeline
#86449
failed with stages
in 5 minutes and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
runtime/common/src/attestations.rs
View file @
d805f3d5
...
...
@@ -131,7 +131,7 @@ decl_module! {
type
Error
=
Error
<
T
>
;
/// Provide candidate receipts for parachains, in ascending order by id.
#[weight
=
frame_support::weights::SimpleDispatchInfo::
default(
)]
#[weight
=
frame_support::weights::SimpleDispatchInfo::
FixedMandatory(
10_000
)]
fn
more_attestations
(
origin
,
_more
:
MoreAttestations
)
->
DispatchResult
{
ensure_none
(
origin
)
?
;
ensure!
(
!
DidUpdate
::
exists
(),
Error
::
<
T
>
::
TooManyAttestations
);
...
...
runtime/common/src/parachains.rs
View file @
d805f3d5
...
...
@@ -399,7 +399,7 @@ decl_module! {
type
Error
=
Error
<
T
>
;
/// Provide candidate receipts for parachains, in ascending order by id.
#[weight
=
SimpleDispatchInfo::Fixed
Normal
(
1_000_000
)]
#[weight
=
SimpleDispatchInfo::Fixed
Mandatory
(
1_000_000
)]
pub
fn
set_heads
(
origin
,
heads
:
Vec
<
AttestedCandidate
>
)
->
DispatchResult
{
ensure_none
(
origin
)
?
;
ensure!
(
!<
DidUpdate
>
::
exists
(),
Error
::
<
T
>
::
TooManyHeadUpdates
);
...
...
validation/src/block_production.rs
View file @
d805f3d5
...
...
@@ -277,7 +277,16 @@ impl<Client, TxPool, Backend> CreateProposalData<Client, TxPool, Backend> where
{
let
inherents
=
runtime_api
.inherent_extrinsics
(
&
self
.parent_id
,
inherent_data
)
?
;
for
inherent
in
inherents
{
block_builder
.push
(
inherent
)
?
;
match
block_builder
.push
(
inherent
)
{
Err
(
sp_blockchain
::
Error
::
ApplyExtrinsicFailed
(
sp_blockchain
::
ApplyExtrinsicFailed
::
Validity
(
e
)))
if
e
.exhausted_resources
()
=>
{
warn!
(
"⚠️ Dropping non-mandatory inherent from overweight block."
);
}
Err
(
e
)
=>
{
warn!
(
"❗️ Inherent extrinsic returned unexpected error: {}. Dropping."
,
e
);
}
Ok
(
_
)
=>
{}
}
}
let
mut
unqueue_invalid
=
Vec
::
new
();
...
...
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