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
a08b46d6
Unverified
Commit
a08b46d6
authored
May 05, 2021
by
Tomasz Drwięga
Committed by
GitHub
May 05, 2021
Browse files
Merge pull request #2978 from paritytech/hc-bump-bridges-subtree-take-2
Bump Bridges Subtree
parents
a27a83e5
0c40898c
Pipeline
#137068
failed with stages
in 42 minutes and 47 seconds
Changes
82
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
bridges/.config/lingua.dic
0 → 100644
View file @
a08b46d6
90
annualised/MS
Apache-2.0/M
AccountId/MS
api/SM
auth
auths/SM
API/SM
APIs
arg
args
aren
async
Best/MS
BlockId
BFT/M
bitfield/MS
blake2/MS
blockchain/MS
borked
BridgeStorage
BlockNumber
BTC/S
CLI/MS
Chain1
Chain2
ChainSpec
ChainTime
chain_getBlock
choosen
config/MS
crypto/MS
customizable/B
debian/M
decodable/MS
DOT/S
doesn
dispatchables
ed25519
enum/MS
ERC-20
ethereum/MS
externality/MS
extrinsic/MS
extrinsics
fedora/M
FN
FinalizationError
GiB/S
GPL/M
GPLv3/M
Handler/MS
HeaderA
HeaderId
https
implementers
inherent/MS
initialize/RG
instantiate/B
intrinsic/MS
intrinsics
InitiateChange
isn
io
js
keccak256/M
KSM/S
Lane1
Lane2
Lane3
LaneId
kusama/S
KYC/M
keccak
Kovan
merkle/MS
MessageNonce
MessageNonces
Merklized
MaybeOrphan
MaybeExtra
MetricsParams
MessagePayload
misbehavior/SM
misbehaviors
MIN_SIZE
MIT/M
max_value
multivalidator/SM
natively
OldHeader
nonces
number
no_std
ok
oneshot/MS
others'
OutboundMessages
parablock/MS
parachain/MS
parameterize/D
pallet_message_lane
polkadot/MS
pov-block/MS
PoA
PoV/MS
precommit
promethius
promethius'
prune_end
prune_depth
provisioner/MS
redhat/M
repo/MS
receival
RPC/MS
RLP
runtime/MS
Runtime1
Runtime2
rustc/MS
ServiceFactory/MS
SignedExtension
SIZE_FACTOR
sr25519
SS58
SS58Prefix
src
S|N
SURI
source
struct/MS
Submitter1
submitters/MS
subsystem/MS
subsystems'
shouldn
synchronizer
taskmanager/MS
teleport/RG
teleportation/SM
teleporter/SM
teleporters
testnet/MS
trie/MS
trustless/Y
ThisChain
TCP
ubuntu/M
union/MSG
undeliverable
unfinalized
unpruned
unservable/B
unsynced
ve
vec
Vec
validator/SM
verifier
w3f/MS
wasm/M
WND/S
XCM/S
XCMP/M
include/BG
isolate/BG
Instance1
Instance2
Instance42
Pre
Rialto
stringified
Stringified
millau
Millau
bridges/.config/spellcheck.toml
0 → 100644
View file @
a08b46d6
[hunspell]
lang
=
"en_US"
search_dirs
=
["."]
extra_dictionaries
=
["lingua.dic"]
[hunspell.quirks]
# `Type`'s
# 5x
transform_regex
=
["^'([^\\s]
)
'$", "^[0-9]+(?:\\.[0-9]*)?x$", "^'
s$
", "
^
\\
+$
", "
[><+-]"]
allow_concatenation
=
true
allow_dashes
=
true
bridges/.dependabot/config.yml
deleted
100644 → 0
View file @
a27a83e5
version
:
1
update_configs
:
-
package_manager
:
"
rust:cargo"
directory
:
"
/"
update_schedule
:
"
weekly"
ignored_updates
:
-
match
:
dependency_name
:
"
sp-*"
-
match
:
dependency_name
:
"
sc-*"
-
match
:
dependency_name
:
"
substrate-*"
-
match
:
dependency_name
:
"
frame-*"
-
match
:
dependency_name
:
"
pallet-*"
-
match
:
dependency_name
:
"
node-inspect"
automerged_updates
:
-
match
:
update_type
:
"
all"
version_requirement_updates
:
"
auto"
bridges/.github/dependabot.yml
0 → 100644
View file @
a08b46d6
version
:
2
updates
:
-
package-ecosystem
:
cargo
directory
:
"
/"
schedule
:
interval
:
weekly
time
:
"
03:00"
timezone
:
Europe/Berlin
open-pull-requests-limit
:
20
ignore
:
-
dependency-name
:
frame-*
versions
:
-
"
>=
0"
-
dependency-name
:
node-inspect
versions
:
-
"
>=
0"
-
dependency-name
:
pallet-*
versions
:
-
"
>=
0"
-
dependency-name
:
sc-*
versions
:
-
"
>=
0"
-
dependency-name
:
sp-*
versions
:
-
"
>=
0"
-
dependency-name
:
substrate-*
versions
:
-
"
>=
0"
-
dependency-name
:
vergen
versions
:
-
4.0.1
-
4.0.2
-
4.1.0
-
4.2.0
-
dependency-name
:
jsonrpc-core
versions
:
-
17.0.0
-
dependency-name
:
finality-grandpa
versions
:
-
0.13.0
-
0.14.0
rebase-strategy
:
disabled
bridges/.github/workflows/lint.yml
View file @
a08b46d6
...
...
@@ -21,23 +21,45 @@ jobs:
env
:
RUST_BACKTRACE
:
full
steps
:
-
name
:
Cancel Previous Runs
uses
:
styfle/cancel-workflow-action@0.4.1
with
:
access_token
:
${{ github.token }}
-
name
:
Checkout sources & submodules
uses
:
actions/checkout@master
with
:
fetch-depth
:
5
submodules
:
recursive
-
name
:
Add rustfmt
run
:
rustup component add rustfmt
-
name
:
rust-fmt check
uses
:
actions-rs/cargo@master
with
:
command
:
fmt
args
:
--all -- --check
check-spellcheck
:
name
:
Check For Spelling and/or Grammar Mistakes
runs-on
:
ubuntu-latest
env
:
RUST_BACKTRACE
:
full
steps
:
-
name
:
Cancel Previous Runs
uses
:
styfle/cancel-workflow-action@0.4.1
with
:
access_token
:
${{ github.token }}
-
name
:
Checkout sources & submodules
uses
:
actions/checkout@master
with
:
fetch-depth
:
5
submodules
:
recursive
-
name
:
Add cargo-spellcheck
run
:
cargo install cargo-spellcheck
-
name
:
Run spellcheck
run
:
cargo spellcheck check -m 1 -vv $(find modules/currency-exchange/src -name "*.rs")
bridges/.github/workflows/rust.yml
View file @
a08b46d6
...
...
@@ -85,8 +85,8 @@ jobs:
matrix
:
toolchain
:
-
stable
#- beta
-
nightly
#- beta
-
nightly
-2021-04-10
runs-on
:
ubuntu-latest
env
:
RUST_BACKTRACE
:
full
...
...
bridges/Cargo.lock
View file @
a08b46d6
This diff is collapsed.
Click to expand it.
bridges/README.md
View file @
a08b46d6
...
...
@@ -126,8 +126,8 @@ both Substrate chains it must be run last.
```
bash
# In `parity-bridges-common` folder
./deployments/local-scripts/run-rialto-
bridge-
node.sh
./deployments/local-scripts/run-millau-
bridge-
node.sh
./deployments/local-scripts/run-rialto-node.sh
./deployments/local-scripts/run-millau-node.sh
./deployments/local-scripts/relay-millau-to-rialto.sh
```
...
...
bridges/bin/millau/node/Cargo.toml
View file @
a08b46d6
...
...
@@ -12,6 +12,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
jsonrpc-core
=
"15.1.0"
structopt
=
"0.3.21"
serde_json
=
"1.0.59"
# Bridge dependencies
...
...
@@ -46,6 +47,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-finality-grandpa
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
}
sp-inherents
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
}
sp-runtime
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
}
sp-timestamp
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
}
substrate-frame-rpc-system
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
}
[build-dependencies]
...
...
bridges/bin/millau/node/src/chain_spec.rs
View file @
a08b46d6
...
...
@@ -67,6 +67,18 @@ pub fn get_authority_keys_from_seed(s: &str) -> (AccountId, AuraId, GrandpaId) {
impl
Alternative
{
/// Get an actual chain config from one of the alternatives.
pub
(
crate
)
fn
load
(
self
)
->
ChainSpec
{
let
properties
=
Some
(
serde_json
::
json!
({
"tokenDecimals"
:
9
,
"tokenSymbol"
:
"MLAU"
,
"bridgeIds"
:
{
"Rialto"
:
bp_runtime
::
RIALTO_BRIDGE_INSTANCE
,
}
})
.as_object
()
.expect
(
"Map given; qed"
)
.clone
(),
);
match
self
{
Alternative
::
Development
=>
ChainSpec
::
from_genesis
(
"Development"
,
...
...
@@ -81,6 +93,9 @@ impl Alternative {
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Bob"
),
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Alice//stash"
),
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Bob//stash"
),
derive_account_from_rialto_id
(
bp_runtime
::
SourceAccount
::
Account
(
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Alice"
),
)),
],
true
,
)
...
...
@@ -88,7 +103,7 @@ impl Alternative {
vec!
[],
None
,
None
,
None
,
properties
,
None
,
),
Alternative
::
LocalTestnet
=>
ChainSpec
::
from_genesis
(
...
...
@@ -127,7 +142,13 @@ impl Alternative {
pallet_bridge_messages
::
DefaultInstance
,
>
::
relayer_fund_account_id
(),
derive_account_from_rialto_id
(
bp_runtime
::
SourceAccount
::
Account
(
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Dave"
),
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Alice"
),
)),
derive_account_from_rialto_id
(
bp_runtime
::
SourceAccount
::
Account
(
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Charlie"
),
)),
derive_account_from_rialto_id
(
bp_runtime
::
SourceAccount
::
Account
(
get_account_id_from_seed
::
<
sr25519
::
Public
>
(
"Eve"
),
)),
],
true
,
...
...
@@ -136,7 +157,7 @@ impl Alternative {
vec!
[],
None
,
None
,
None
,
properties
,
None
,
),
}
...
...
@@ -155,11 +176,11 @@ fn testnet_genesis(
)
->
GenesisConfig
{
GenesisConfig
{
frame_system
:
SystemConfig
{
code
:
WASM_BINARY
.to_vec
(),
code
:
WASM_BINARY
.
expect
(
"Millau development WASM not available"
)
.
to_vec
(),
changes_trie_config
:
Default
::
default
(),
},
pallet_balances
:
BalancesConfig
{
balances
:
endowed_accounts
.iter
()
.cloned
()
.map
(|
k
|
(
k
,
1
<<
5
0
))
.collect
(),
balances
:
endowed_accounts
.iter
()
.cloned
()
.map
(|
k
|
(
k
,
1
<<
4
0
))
.collect
(),
},
pallet_aura
:
AuraConfig
{
authorities
:
Vec
::
new
(),
...
...
bridges/bin/millau/node/src/cli.rs
View file @
a08b46d6
...
...
@@ -63,7 +63,7 @@ pub enum Subcommand {
Revert
(
sc_cli
::
RevertCmd
),
/// Inspect blocks or extrinsics.
Inspect
(
node_inspect
::
cli
::
InspectCmd
),
Inspect
(
node_inspect
::
cli
::
Inspect
Key
Cmd
),
/// Benchmark runtime pallets.
Benchmark
(
frame_benchmarking_cli
::
BenchmarkCmd
),
...
...
bridges/bin/millau/node/src/service.rs
View file @
a08b46d6
...
...
@@ -37,8 +37,8 @@ use sc_finality_grandpa::SharedVoterState;
use
sc_keystore
::
LocalKeystore
;
use
sc_service
::{
error
::
Error
as
ServiceError
,
Configuration
,
TaskManager
};
use
sc_telemetry
::{
Telemetry
,
TelemetryWorker
};
use
sp_consensus
::
SlotData
;
use
sp_consensus_aura
::
sr25519
::
AuthorityPair
as
AuraPair
;
use
sp_inherents
::
InherentDataProviders
;
use
std
::
sync
::
Arc
;
use
std
::
time
::
Duration
;
...
...
@@ -80,8 +80,6 @@ pub fn new_partial(
if
config
.keystore_remote
.is_some
()
{
return
Err
(
ServiceError
::
Other
(
"Remote Keystores are not supported."
.to_string
()));
}
let
inherent_data_providers
=
InherentDataProviders
::
new
();
let
telemetry
=
config
.telemetry_endpoints
.clone
()
...
...
@@ -124,14 +122,24 @@ pub fn new_partial(
let
aura_block_import
=
sc_consensus_aura
::
AuraBlockImport
::
<
_
,
_
,
_
,
AuraPair
>
::
new
(
grandpa_block_import
.clone
(),
client
.clone
());
let
import_queue
=
sc_consensus_aura
::
import_queue
::
<
AuraPair
,
_
,
_
,
_
,
_
,
_
>
(
ImportQueueParams
{
let
slot_duration
=
sc_consensus_aura
::
slot_duration
(
&*
client
)
?
.slot_duration
();
let
import_queue
=
sc_consensus_aura
::
import_queue
::
<
AuraPair
,
_
,
_
,
_
,
_
,
_
,
_
>
(
ImportQueueParams
{
block_import
:
aura_block_import
.clone
(),
justification_import
:
Some
(
Box
::
new
(
grandpa_block_import
)),
client
:
client
.clone
(),
inherent_data_providers
:
inherent_data_providers
.clone
(),
create_inherent_data_providers
:
move
|
_
,
()|
async
move
{
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
slot
=
sp_consensus_aura
::
inherents
::
InherentDataProvider
::
from_timestamp_and_duration
(
*
timestamp
,
slot_duration
,
);
Ok
((
timestamp
,
slot
))
},
spawner
:
&
task_manager
.spawn_essential_handle
(),
can_author_with
:
sp_consensus
::
CanAuthorWithNativeVersion
::
new
(
client
.executor
()
.clone
()),
slot_duration
:
sc_consensus_aura
::
slot_duration
(
&*
client
)
?
,
registry
:
config
.prometheus_registry
(),
check_for_equivocation
:
Default
::
default
(),
telemetry
:
telemetry
.as_ref
()
.map
(|
x
|
x
.handle
()),
...
...
@@ -145,7 +153,6 @@ pub fn new_partial(
keystore_container
,
select_chain
,
transaction_pool
,
inherent_data_providers
,
other
:
(
aura_block_import
,
grandpa_link
,
telemetry
),
})
}
...
...
@@ -167,7 +174,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
mut
keystore_container
,
select_chain
,
transaction_pool
,
inherent_data_providers
,
other
:
(
block_import
,
grandpa_link
,
mut
telemetry
),
}
=
new_partial
(
&
config
)
?
;
...
...
@@ -277,13 +283,25 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let
can_author_with
=
sp_consensus
::
CanAuthorWithNativeVersion
::
new
(
client
.executor
()
.clone
());
let
aura
=
sc_consensus_aura
::
start_aura
::
<
AuraPair
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
>
(
StartAuraParams
{
slot_duration
:
sc_consensus_aura
::
slot_duration
(
&*
client
)
?
,
client
:
client
.clone
(),
let
slot_duration
=
sc_consensus_aura
::
slot_duration
(
&*
client
)
?
;
let
raw_slot_duration
=
slot_duration
.slot_duration
();
let
aura
=
sc_consensus_aura
::
start_aura
::
<
AuraPair
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
>
(
StartAuraParams
{
slot_duration
,
client
,
select_chain
,
block_import
,
proposer_factory
,
inherent_data_providers
,
create_inherent_data_providers
:
move
|
_
,
()|
async
move
{
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
slot
=
sp_consensus_aura
::
inherents
::
InherentDataProvider
::
from_timestamp_and_duration
(
*
timestamp
,
raw_slot_duration
,
);
Ok
((
timestamp
,
slot
))
},
force_authoring
,
backoff_authoring_blocks
,
keystore
:
keystore_container
.sync_keystore
(),
...
...
@@ -394,14 +412,23 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
let
aura_block_import
=
sc_consensus_aura
::
AuraBlockImport
::
<
_
,
_
,
_
,
AuraPair
>
::
new
(
grandpa_block_import
.clone
(),
client
.clone
());
let
import_queue
=
sc_consensus_aura
::
import_queue
::
<
AuraPair
,
_
,
_
,
_
,
_
,
_
>
(
ImportQueueParams
{
let
slot_duration
=
sc_consensus_aura
::
slot_duration
(
&*
client
)
?
.slot_duration
();
let
import_queue
=
sc_consensus_aura
::
import_queue
::
<
AuraPair
,
_
,
_
,
_
,
_
,
_
,
_
>
(
ImportQueueParams
{
block_import
:
aura_block_import
,
justification_import
:
Some
(
Box
::
new
(
grandpa_block_import
)),
client
:
client
.clone
(),
inherent_data_providers
:
InherentDataProviders
::
new
(),
create_inherent_data_providers
:
move
|
_
,
()|
async
move
{
let
timestamp
=
sp_timestamp
::
InherentDataProvider
::
from_system_time
();
let
slot
=
sp_consensus_aura
::
inherents
::
InherentDataProvider
::
from_timestamp_and_duration
(
*
timestamp
,
slot_duration
,
);
Ok
((
timestamp
,
slot
))
},
spawner
:
&
task_manager
.spawn_essential_handle
(),
can_author_with
:
sp_consensus
::
NeverCanAuthor
,
slot_duration
:
sc_consensus_aura
::
slot_duration
(
&*
client
)
?
,
registry
:
config
.prometheus_registry
(),
check_for_equivocation
:
Default
::
default
(),
telemetry
:
telemetry
.as_ref
()
.map
(|
x
|
x
.handle
()),
...
...
bridges/bin/millau/runtime/Cargo.toml
View file @
a08b46d6
...
...
@@ -56,7 +56,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" ,
sp-version
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
,
default-features
=
false
}
[build-dependencies]
wasm-builder-runner
=
{
package
=
"
substrate-wasm-builder
-runner"
,
version
=
"
2
.0.0"
}
substrate-wasm-builder
=
"
3
.0.0"
[features]
default
=
["std"]
...
...
bridges/bin/millau/runtime/build.rs
View file @
a08b46d6
...
...
@@ -14,13 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
use
wasm_builder
_runner
::
WasmBuilder
;
use
substrate_
wasm_builder
::
WasmBuilder
;
fn
main
()
{
WasmBuilder
::
new
()
.with_current_project
()
.with_wasm_builder_from_crates
(
"1.0.11"
)
.export_heap_base
()
.import_memory
()
.export_heap_base
()
.build
()
}
bridges/bin/millau/runtime/src/lib.rs
View file @
a08b46d6
...
...
@@ -55,7 +55,7 @@ use sp_version::RuntimeVersion;
// A few exports that help ease life for downstream crates.
pub
use
frame_support
::{
construct_runtime
,
parameter_types
,
traits
::{
Currency
,
ExistenceRequirement
,
Imbalance
,
KeyOwnerProofSystem
,
Randomness
},
traits
::{
Currency
,
ExistenceRequirement
,
Imbalance
,
KeyOwnerProofSystem
},
weights
::{
constants
::
WEIGHT_PER_SECOND
,
DispatchClass
,
IdentityFee
,
RuntimeDbWeight
,
Weight
},
StorageValue
,
};
...
...
@@ -308,7 +308,6 @@ parameter_types! {
// Note that once this is hit the pallet will essentially throttle incoming requests down to one
// call per block.
pub
const
MaxRequests
:
u32
=
50
;
pub
const
WestendValidatorCount
:
u32
=
255
;
// Number of headers to keep.
//
...
...
@@ -478,10 +477,6 @@ impl_runtime_apis! {
)
->
sp_inherents
::
CheckInherentsResult
{
data
.check_extrinsics
(
&
block
)
}
fn
random_seed
()
->
<
Block
as
BlockT
>
::
Hash
{
RandomnessCollectiveFlip
::
random_seed
()
.0
}
}
impl
frame_system_rpc_runtime_api
::
AccountNonceApi
<
Block
,
AccountId
,
Index
>
for
Runtime
{
...
...
bridges/bin/millau/runtime/src/rialto_messages.rs
View file @
a08b46d6
...
...
@@ -31,7 +31,7 @@ use frame_support::{
weights
::{
DispatchClass
,
Weight
},
RuntimeDebug
,
};
use
sp_runtime
::{
FixedPointNumber
,
FixedU128
};
use
sp_runtime
::{
traits
::
Zero
,
FixedPointNumber
,
FixedU128
};
use
sp_std
::{
convert
::
TryFrom
,
ops
::
RangeInclusive
};
/// Initial value of `RialtoToMillauConversionRate` parameter.
...
...
@@ -214,7 +214,9 @@ impl TargetHeaderChain<ToRialtoMessagePayload, bp_rialto::AccountId> for Rialto
fn
verify_messages_delivery_proof
(
proof
:
Self
::
MessagesDeliveryProof
,
)
->
Result
<
(
LaneId
,
InboundLaneData
<
bp_millau
::
AccountId
>
),
Self
::
Error
>
{
messages
::
source
::
verify_messages_delivery_proof
::
<
WithRialtoMessageBridge
,
Runtime
>
(
proof
)
messages
::
source
::
verify_messages_delivery_proof
::
<
WithRialtoMessageBridge
,
Runtime
,
crate
::
RialtoGrandpaInstance
>
(