Serban Iorga
e0b42dfae7
Follow-up on #1518 ( #1546 )
...
* Adjustments for the xcm messages sending logic
Signed-off-by: Serban Iorga <serban@parity.io >
* Deduplicate XCM destination
Signed-off-by: Serban Iorga <serban@parity.io >
* [send_message] small changes
Signed-off-by: Serban Iorga <serban@parity.io >
* Define CustomNetworkId
Right now we use some associations between Rialto, RialtoParachain and
Millau chains and chains defined in the NetworkId enum. But if we are
not carreful we might do mistakes like:
In Millau:
pub const ThisNetwork: NetworkId = Kusama;
pub const RialtoNetwork: NetworkId = Polkadot;
In Rialto:
pub const ThisNetwork: NetworkId = Kusama;
pub const MillauNetwork: NetworkId = Polkadot;
We're introducing CustomNetworkId to have a centralized mapping between
NetworkId chains and our custom chains.
Signed-off-by: Serban Iorga <serban@parity.io >
* Revert "Deduplicate XCM destination"
This reverts commit 3a0a950e1d7484e3ecac45f5c00b152f0485cd11.
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
050b12f3aa
Call To*InboundLaneApi::message_details() with batched messages ( #1545 )
...
* generated_message_details() -> Simplifications
- avoid using a HashMap for `messages_to_refine`. It seems that a vec is
enough
- minimize the number of conversions between `OutboundMessageDetails` and
`MessageDetails`
- use references where possible in order to minimize the number of
intermediary Vecs
- simplify `make_message_details_map()` logic, reduce its scope and rename
it to `validate_out_msgs_details()`
Signed-off-by: Serban Iorga <serban@parity.io >
* Define typed_state_call()
Signed-off-by: Serban Iorga <serban@parity.io >
* Call To*InboundLaneApi::message_details() with single messages
Signed-off-by: Serban Iorga <serban@parity.io >
* Call To*InboundLaneApi::message_details() with batched messages
Signed-off-by: Serban Iorga <serban@parity.io >
* validate_out_msgs_details() -> change check
* Define split_msgs_to_refine()
Signed-off-by: Serban Iorga <serban@parity.io >
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
5b23fd0f9e
Unprofitable message delivery tx metric ( #1536 )
...
* unprofitable message delivery tx metric
* proper impl
* send Rialto -> Millau messages using XCM pallet
* use altruistic relays in Rialto <> Millau bridge
* add unprofitable transactions dashboard
* fix + logging
* fix test
2024-04-10 10:28:37 +02:00
Serban Iorga
1723c1e004
[Complex Relayers] Deduplicate l2r and r2l logic ( #1535 )
...
* [Complex Relayers] Deduplicate l2r and r2l logic
Signed-off-by: Serban Iorga <serban@parity.io >
* Renamings
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
e7a7396616
Use jsonrpsee subscriptions ( #1533 )
...
* splitted Substrate RPC trait
* introduce subscription methods
* removed commented code
* removed commented code
2024-04-10 10:28:37 +02:00
Serban Iorga
77af92b17b
Follow-up on #1419 ( #1531 )
...
* Parachains source cosmetic changes
- Make `ParaHashAtSource` more generic
- Modify `on_chain_parachain_header` to return `HeaderId`
- Shortening variable names
Signed-off-by: Serban Iorga <serban@parity.io >
* Change ParachainsSource::max_head_id type
Change ParachainsSource::max_head_id to Arc<Mutex<NoopOption>>
Signed-off-by: Serban Iorga <serban@parity.io >
* code review changes
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
dd9debed3c
Bump jsonrpsee ( #1530 )
...
* switch to jsonrpsee 0.15
* use client_bounds marker
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
86b5a0ee6a
fix truncated doc ( #1529 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
176d87cdd8
refund relayer if parachain head has not been updated ( #1528 )
2024-04-10 10:28:37 +02:00
Serban Iorga
01a1cab815
Remove unneeded error conversion ( #1527 )
2024-04-10 10:28:37 +02:00
Serban Iorga
7969459d07
Change Runtime APIs best_finalized() signature
...
Change Runtime APIs best_finalized() signature to return Option<HeaderId>
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
f13211344b
Small cosmetic changes
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
c131a5e3c8
Send messages using xcm pallet ( #1518 )
...
* send messages using xcm pallet
* XcmBridge && XcmBridgeAdapter + (untested) config in RialtoParachain
* impl encode_send_xcm for the rest
* remove duplicate code
* some fixes
* cleanup
* some more tests
* cleanup
* cleanup
* send Rialto -> Millau messages using bridge-messages pallet
* fmt
* some clippy fixes
* more clippy
2024-04-10 10:28:37 +02:00
Serban Iorga
b21790b769
Log error instead of returning it
...
Log error when `best_parachain_block_at_target` can't be updated instead
of propagating it.
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
cd36d1e15f
Define StorageDoubleMapKeyProvider
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
f9af3f2d6e
Remove unneeded variable
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
69809f8be4
Deduplicate parachains validation
...
Deduplicate the logic that validates the updated parachain heads.
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
5d9bd1d0b5
Reduce the number of macros used for SignedExtensions
...
Reduce the number of macros used for SignedExtensions
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
057fd6cab2
reuse lane_id variable ( #1517 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
7590abd1a3
Introduce bridge relayers pallet ( #1513 )
...
* introduce relayers pallet
* add MessageDeliveryAndDispatchPaymentAdapter
* plug in pallet into test runtimes
* tests prototype
* tests for the relayers pallet
* tests for payment adapter
* mint_reward_payment_procedure_actually_mints_tokens
* benchmarks
* remove irrelevant todo
* remove redundant clone
2024-04-10 10:28:37 +02:00
Serban Iorga
1e0c2a6e02
Follow-up on #1487 ( #1511 )
...
* Remove unused trait implementations
Signed-off-by: Serban Iorga <serban@parity.io >
* Define encoded_size_hint_u32()
Signed-off-by: Serban Iorga <serban@parity.io >
* Define TransactionEstimationParams trait
Signed-off-by: Serban Iorga <serban@parity.io >
* Rework TransactionEstimation
Signed-off-by: Serban Iorga <serban@parity.io >
* Docs + Renamings
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
dc38e3d079
Define HeaderIdProvider trait
...
Define HeaderIdProvider trait
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
2b03f4e9e9
More relay processes in rialtoParachain<>Millau bridge ( #1500 )
...
* more relay processes in rialtoParachain<>Millau bridge
* fix dashboards
* fix dump-logs
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
ea1f46ff45
Add another condition to the reject-obsolete-parachain-heads extension ( #1505 )
...
* add another condition to the reject-obsolete-parachain-heads extension
* add tracing to obsolete-tx-extensions
* fix tests
* extension_rejects_header_from_new_relay_block_with_same_hash
* fmt
* fix benchmarks
2024-04-10 10:28:37 +02:00
Dan Shields
e9d7adf8fd
rm substrate.dev homepage ( #1506 )
...
new docs page
2024-04-10 10:28:37 +02:00
Serban Iorga
a2dcb1b4ad
Move bridge definitions
...
Move bridge definitions to their specific folder.
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
e1fd877b80
CLI refactoring
...
* [CLI] Make bridge definitions more complete
* [CLI] Refactor relay_headers_and_messages
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
ceefd1b05d
remove account derivation functions ( #1498 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
d327b25724
Change account names to something meaningful ( #1497 )
...
* change testnets account "names" to something meaningful
* fixes
* fix doc
* fmt
* account names as consts
* fmt
* spelling
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
00f1225b19
Fix and update benchmarks ( #1494 )
...
* decrease parameters range in grandpa benchmarks
* fix messages benchmarks
* update all weights
* dealing with failed test (WiP)
* Revert "dealing with failed test (WiP)"
This reverts commit 0379d24bcf0692da5813968d83e0cbc918ac4691.
* proper tests fix
2024-04-10 10:28:37 +02:00
Serban Iorga
f89eeb920a
[CLI] remove select_full_bridge!() macro
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
88e95388bb
Remove obsolete bridges ( #1491 )
...
* remove Rococo<>Wococo bridge mentions
* remove Kusama <> Polkadot bridge mentions
* fmt
* remove unneeded mocked runtimes && trait impls for obsolete bridges
* remove unused deps
2024-04-10 10:28:37 +02:00
Serban Iorga
46c0400f26
[CLI] Remove some macros
...
Refactor the implementations for the following CLI methods in order to
avoid using macros:
- init_bridge
- relay_headers
- relay_parachains
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
4929493f83
backport named events PR ( #1489 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
7d97e576d0
Remove without_storage_info for messages pallet ( #1487 )
...
* draft: remove without_storage_info for messages pallet
* some cleanup
2024-04-10 10:28:37 +02:00
Serban Iorga
60edd0c436
[parachains pallet] implement genesis_build
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
66754581ac
[parachains pallet] add unit test
...
Add unit test in order to check that the submit_parachain_heads() call
returns an error when the pallet is halted.
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
2a4174db18
Add owner calls to the parachains pallet
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
ec76490ddb
Test pallet owner calls using macro
...
Define macro that generates tests for set_owner() and set_operating_mode()
in order to avoid duplicate code.
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
6b67d6b262
Define const LOG_TARGET for bridge pallets
...
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
852f629d78
Sync Westmint to Millau ( #1482 )
...
* sync Westmint to Millau
* "Westend parachains at Millau" dashboard
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
d11d9fd0b7
Parachain loop metrics ( #1484 )
...
* parachain loop metrics
* some fixes
* mini refactoring
* add tests
2024-04-10 10:28:37 +02:00
Serban Iorga
f8ff3c9142
Unify the operating mode for bridge pallets ( #1483 )
...
Unify the operating mode for bridge pallets
- define the OperationMode trait and BasicOperatingMode enum
- use the OperationMode trait in all the bridge pallets
- use BasicOperatingMode instead of IsHalted for the Grandpa pallet
- use BasicOperatingMode as part of MessagesOperatingMode
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Serban Iorga
ff342fafa9
Avoid duplicate function definitions
...
Avoid duplicate function definitions for:
- ensure_owner_or_root()
- ensure_not_halted()
- set_owner()
- set_operating_mode() / set_operational()
Signed-off-by: Serban Iorga <serban@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
a97dedb50f
Store both block number and hash in best finalized storage value ( #1475 )
...
* store both block number and hash in BestFinalized
* also fix relay code
* spelling
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
c0880d810a
remove local images refs ( #1470 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
31a2be845c
Fix on-different-forks metrics during initialization ( #1468 )
...
* fix on-different-forks metrics during initialization
* "initialize" parachain finality pallet in on-demand parachains relay
* decrease converstion rate requests count
* more error logging
* fix compilation
* clippy
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
418942826d
Separate signers for different complex relay layers ( #1465 )
...
* separate accounts for different complex relay layers
* fix clippy issue
* cleanup + expose relay accounts balance metrics
* expose messages pallet owner balance metric
* use new metrics in maintenance dashboard
* tests + use separate accounts to sign RialtoHeaders -> Millau transactions in RialtoParachain<>Millau bridge
* clippy + fmt + spellcheck
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
4bbef37a12
use Millau //Iden for RialtoParachain -> Millau transactions ( #1460 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
9988a7ac99
actually use RialtoParachainMessagesToMillauUpdateConversionRateCallBuilder ( #1456 )
2024-04-10 10:28:37 +02:00