Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
nodes
rust
Duniter v2S
Commits
e46d711b
Commit
e46d711b
authored
3 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
fix (security): filtered calls should not enter the tx pool.
parent
77a8d0bb
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
runtime/common/src/apis.rs
+13
-8
13 additions, 8 deletions
runtime/common/src/apis.rs
runtime/g1/src/lib.rs
+2
-1
2 additions, 1 deletion
runtime/g1/src/lib.rs
runtime/gdev/src/lib.rs
+2
-1
2 additions, 1 deletion
runtime/gdev/src/lib.rs
runtime/gtest/src/lib.rs
+2
-1
2 additions, 1 deletion
runtime/gtest/src/lib.rs
with
19 additions
and
11 deletions
runtime/common/src/apis.rs
+
13
−
8
View file @
e46d711b
...
@@ -129,6 +129,11 @@ macro_rules! runtime_apis {
...
@@ -129,6 +129,11 @@ macro_rules! runtime_apis {
tx
:
<
Block
as
BlockT
>
::
Extrinsic
,
tx
:
<
Block
as
BlockT
>
::
Extrinsic
,
block_hash
:
<
Block
as
BlockT
>
::
Hash
,
block_hash
:
<
Block
as
BlockT
>
::
Hash
,
)
->
TransactionValidity
{
)
->
TransactionValidity
{
// Filtered calls should not enter the tx pool.
if
!<
Runtime
as
frame_system
::
Config
>
::
BaseCallFilter
::
contains
(
&
tx
.function
)
{
return
sp_runtime
::
transaction_validity
::
InvalidTransaction
::
Call
.into
();
}
Executive
::
validate_transaction
(
source
,
tx
,
block_hash
)
Executive
::
validate_transaction
(
source
,
tx
,
block_hash
)
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
runtime/g1/src/lib.rs
+
2
−
1
View file @
e46d711b
...
@@ -41,6 +41,7 @@ pub use sp_runtime::BuildStorage;
...
@@ -41,6 +41,7 @@ pub use sp_runtime::BuildStorage;
pub
use
sp_runtime
::{
KeyTypeId
,
Perbill
,
Permill
};
pub
use
sp_runtime
::{
KeyTypeId
,
Perbill
,
Permill
};
use
common_runtime
::
IdtyNameValidatorImpl
;
use
common_runtime
::
IdtyNameValidatorImpl
;
use
frame_support
::
traits
::
Contains
;
use
frame_system
::
EnsureRoot
;
use
frame_system
::
EnsureRoot
;
use
pallet_grandpa
::
fg_primitives
;
use
pallet_grandpa
::
fg_primitives
;
use
pallet_grandpa
::{
AuthorityId
as
GrandpaId
,
AuthorityList
as
GrandpaAuthorityList
};
use
pallet_grandpa
::{
AuthorityId
as
GrandpaId
,
AuthorityList
as
GrandpaAuthorityList
};
...
@@ -121,7 +122,7 @@ pub type Executive = frame_executive::Executive<
...
@@ -121,7 +122,7 @@ pub type Executive = frame_executive::Executive<
>
;
>
;
pub
struct
BaseCallFilter
;
pub
struct
BaseCallFilter
;
impl
frame_support
::
traits
::
Contains
<
Call
>
for
BaseCallFilter
{
impl
Contains
<
Call
>
for
BaseCallFilter
{
fn
contains
(
call
:
&
Call
)
->
bool
{
fn
contains
(
call
:
&
Call
)
->
bool
{
!
matches!
(
!
matches!
(
call
,
call
,
...
...
This diff is collapsed.
Click to expand it.
runtime/gdev/src/lib.rs
+
2
−
1
View file @
e46d711b
...
@@ -41,6 +41,7 @@ pub use sp_runtime::BuildStorage;
...
@@ -41,6 +41,7 @@ pub use sp_runtime::BuildStorage;
pub
use
sp_runtime
::{
KeyTypeId
,
Perbill
,
Permill
};
pub
use
sp_runtime
::{
KeyTypeId
,
Perbill
,
Permill
};
use
common_runtime
::
IdtyNameValidatorImpl
;
use
common_runtime
::
IdtyNameValidatorImpl
;
use
frame_support
::
traits
::
Contains
;
use
frame_system
::
EnsureRoot
;
use
frame_system
::
EnsureRoot
;
use
pallet_grandpa
::
fg_primitives
;
use
pallet_grandpa
::
fg_primitives
;
use
pallet_grandpa
::{
AuthorityId
as
GrandpaId
,
AuthorityList
as
GrandpaAuthorityList
};
use
pallet_grandpa
::{
AuthorityId
as
GrandpaId
,
AuthorityList
as
GrandpaAuthorityList
};
...
@@ -123,7 +124,7 @@ pub type Executive = frame_executive::Executive<
...
@@ -123,7 +124,7 @@ pub type Executive = frame_executive::Executive<
>
;
>
;
pub
struct
BaseCallFilter
;
pub
struct
BaseCallFilter
;
impl
frame_support
::
traits
::
Contains
<
Call
>
for
BaseCallFilter
{
impl
Contains
<
Call
>
for
BaseCallFilter
{
fn
contains
(
call
:
&
Call
)
->
bool
{
fn
contains
(
call
:
&
Call
)
->
bool
{
!
matches!
(
!
matches!
(
call
,
call
,
...
...
This diff is collapsed.
Click to expand it.
runtime/gtest/src/lib.rs
+
2
−
1
View file @
e46d711b
...
@@ -41,6 +41,7 @@ pub use sp_runtime::BuildStorage;
...
@@ -41,6 +41,7 @@ pub use sp_runtime::BuildStorage;
pub
use
sp_runtime
::{
KeyTypeId
,
Perbill
,
Permill
};
pub
use
sp_runtime
::{
KeyTypeId
,
Perbill
,
Permill
};
use
common_runtime
::
IdtyNameValidatorImpl
;
use
common_runtime
::
IdtyNameValidatorImpl
;
use
frame_support
::
traits
::
Contains
;
use
frame_system
::
EnsureRoot
;
use
frame_system
::
EnsureRoot
;
use
pallet_grandpa
::
fg_primitives
;
use
pallet_grandpa
::
fg_primitives
;
use
pallet_grandpa
::{
AuthorityId
as
GrandpaId
,
AuthorityList
as
GrandpaAuthorityList
};
use
pallet_grandpa
::{
AuthorityId
as
GrandpaId
,
AuthorityList
as
GrandpaAuthorityList
};
...
@@ -122,7 +123,7 @@ pub type Executive = frame_executive::Executive<
...
@@ -122,7 +123,7 @@ pub type Executive = frame_executive::Executive<
>
;
>
;
pub
struct
BaseCallFilter
;
pub
struct
BaseCallFilter
;
impl
frame_support
::
traits
::
Contains
<
Call
>
for
BaseCallFilter
{
impl
Contains
<
Call
>
for
BaseCallFilter
{
fn
contains
(
call
:
&
Call
)
->
bool
{
fn
contains
(
call
:
&
Call
)
->
bool
{
!
matches!
(
!
matches!
(
call
,
call
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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