Commit Graph

16393 Commits

Author SHA1 Message Date
Branislav Kontur d64815cdef Cleaning deps + satisfy `cargo build --release --all-targets --all-fe… (#1587)
* Cleaning deps + satisfy `cargo build --release --all-targets --all-features`

* PR fixes
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 43afa02372 Read extrinsic dispatch result for mined transaction (#1582)
* read extrinsic dispatch result for mined transaction

* commit for the history

* Revert "commit for the history"

This reverts commit 99341b04750639db296172cc1432bd70e458ef4b.

* Revert "read extrinsic dispatch result for mined transaction"

This reverts commit 662b776cbf992be9f1637e52f023b782e8c441d1.

* check for successfult transaction in finality relay

* check for successful transaction in parachains relay

* TrackedTransactionStatus ->TrackedTransactionStatus<HeaderId>

* check for successful transaction in messages relay

* fix compilation

* message_lane_loop_is_able_to_recover_from_unsuccessful_transaction

* fixed too-complex-type clippy error

* aaand compilation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 1abd5cb60d restart relay loop when proof genration fails (#1585) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 5ff36549f1 remove unnecessary consts (#1586) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 0f79d1e86e fail if transaction submit has failed (#1584) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky e534e90193 use transaction tracker in messages relay (#1581) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 86be60ad40 use transaction tracker in parachains relay (#1575)
* use transaction tracker in parachains relay

* actually return tx tracker from target client implementation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 6ab6a876a1 fix spelling (#1580) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 415f28fac8 Do not wait for tx status forever (#1578)
* do not wait for tx status forever

* more logging
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 70d6e91f20 TransactionInvalidationTracker (#1544)
* TransactionInvalidationTracker

* TransacitonInvalidationTracker -> TransactionTracker

* change sign_transaction method

* clippy and spelling

* removed comment

* more transactiontracker tests

* stalls_when_transaction_tracker_returns_error

* remove test code

* remove "impl TransactionTracker for ()"

* enum TrackedTransactionStatus

* test TransactionTracker in on_transaction_status

* do_wait
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 58fe2749d2 Expand docs on ParasPalletName (#1571)
* expand docs on ParasPalletName

* fmt
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 653ff6ef0d Add events to the bridge parachains pallet (#1568)
* add events to the bridge parachains pallet

* clippy + spellcheck

* fix compilation

* untracked is not a word?
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 95c30c780c update Substrate/Polkadot/Cumulus refs (#1562)
* update Substrate/Polkadot/Cumulus refs

* finality-grandpa 0.16

* fix miillau-runtime compilation

* fix rialto runtime compilation

* fixed rialto-parachain runtime compilation

* backport GRANDPA test fixes

* helper instead of removed record_all_keys

* substrate-relay is compiling

* millau-bridge-node at least compiles

* rialto-bridge-node at least compiles

* rialto-parachain-collator compiles

* fixings tests (wip)

* fmt

* fixed BEEFY alert

* clippy

* removed unused dep

* -extra var

* move Leaf to mod mmr

* fix benchmarks
2024-04-10 10:28:37 +02:00
Serban Iorga ad38cdb873 Follow-up on #1068 (#1567)
* BestParaHead small changes

Signed-off-by: Serban Iorga <serban@parity.io>

* Renamings

Signed-off-by: Serban Iorga <serban@parity.io>

* Use ParaInfo in parachains loop

Signed-off-by: Serban Iorga <serban@parity.io>

* Define StorageMapKeyProvider

Signed-off-by: Serban Iorga <serban@parity.io>

* CR fixes

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Branislav Kontur 1c94fbeafc Get paraId from configured SOURCE_PARACHAIN_PARA_ID (#1564) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky f35b4f4897 Extract unsigned tx from the SignParam structure (#1561)
* change sign_transaction method

* clippy

* rustup update && clippy

* remove redudnant clone
2024-04-10 10:28:37 +02:00
Branislav Kontur effe0f11c8 Unnecessery clones + removed unused Enum value (#1557)
* Unnecessary clone

* Removed unused Enum value

* Client - ConnectionParams wrapped with Arc + removed unnecessery clone

* Client - ConnectionParams wrapped with Arc + removed unnecessery clone
2024-04-10 10:28:37 +02:00
Branislav Kontur 793321fcfc Reexport paste from sp-runtime in bp-runtime to aviod including paste dependency everywhere (#1556)
* Reexport paste from `sp-runtime` in `bp-runtime` to aviod including `paste` dependency everywhere

* Add import `bp_runtime` to macro calls: decl_bridge_finality_runtime_apis/decl_bridge_messages_runtime_apis
2024-04-10 10:28:37 +02:00
Serban Iorga f3a151feeb Split decl_bridge_runtime_apis!() (#1553)
Signed-off-by: Serban Iorga <serban@parity.io>

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Branislav Kontur 7ad5b0fe56 Bump codec version 3.0.0 -> 3.1.5 + unify parity-scale-codec vs codec (#1552) 2024-04-10 10:28:37 +02:00
Serban Iorga 682fafdf56 Follow-up on #1536 (#1549)
* Make RelayStrategy::final_decision() sync

Signed-off-by: Serban Iorga <serban@parity.io>

* Move logic from RelayStrategy to RelayReference

Signed-off-by: Serban Iorga <serban@parity.io>

* Rename RelayStrategy::final_decision()

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Branislav Kontur 260dad5110 Bko cosmetics (#1550)
* Bump log version to 0.4.17

* Removed unnecesseray dependency + rename BridgeGrandpaMillauCall to BridgeGrandpaCall
2024-04-10 10:28:37 +02:00
Serban Iorga 59c168e89b Declare declare_bridge_chain_runtime_apis! macro
Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga 5cc874e7b8 relayers pallet - small changes (#1547)
Signed-off-by: Serban Iorga <serban@parity.io>

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
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