Skip to content
  1. Apr 10, 2024
    • Hernando Castano's avatar
      High-Level Documentation (#565) · d47658c9
      Hernando Castano authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * High level docs - start.
      
      * Clean up README
      
      * Start adding details to high level docs
      
      * More docs on the header sync pallet
      
      * Testing scenarios document.
      
      * Add some scenarios.
      
      * Add multi-sig scenario.
      
      * Start writing about message dispatch pallet
      
      * Move content from old README into PoA specific doc
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndreas Doerr <[email protected]>
      
      * GRANDPA for consistency.
      
      * Describe scenario steps.
      
      * WiP
      
      * Add notes about block production and forks
      
      * Update.
      
      * Add sequence diagram for Millau to Rialto transfer
      
      * Clean up header sync pallet overview
      
      * Remove leftover example code
      
      * Clean up testing scenarios and amend sequence diagram.
      
      * Linking docs.
      
      * Add some more docs.
      
      * Do a bit of cleanup on the high-level docs
      
      * Clean up the testing scenario
      
      * Fix typos in flow charts
      
      * Fix small typo
      
      * Fix indentation of Rust block
      
      * Another attempt at rendering block correctly
      
      * TIL about lazy list numbering in Markdown
      
      * Add list numbers across sections
      
      * Start counting from correct number
      
      * Update README to use correct path to local scripts
      
      * Wrap ASCII art in code block
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      Co-authored-by: default avatarAndreas Doerr <[email protected]>
      d47658c9
    • Svyatoslav Nikolsky's avatar
      Polkadot integration (#542) · 2d08a9d2
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * kusama primitives + client
      
      * polkadot primitives + client
      
      * lost Chain definitions
      
      * fix compilation and fmt
      
      * Update primitives/runtime/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      2d08a9d2
    • Hernando Castano's avatar
      Add Derived Account Origins to Dispatcher (#519) · 951aa36c
      Hernando Castano authored and Bastian Köcher's avatar Bastian Köcher committed
      * Update some docs
      
      * Add derived account origin
      
      * Add tests for derived origin
      
      * Do a little bit of cleanup
      
      * Change Origin type to use AccountIds instead of Public keys
      
      * Update (most) tests to use new Origin types
      
      * Remove redundant test
      
      * Update `runtime-common` tests to use new Origin types
      
      * Remove unused import
      
      * Fix documentation around origin verification
      
      * Update config types to use AccountIds in runtime
      
      * Update Origin type used in message relay
      
      * Use correct type when verifying message origin
      
      * Make CallOrigin docs more consistent
      
      * Use AccountIds instead of Public keys in Runtime types
      
      * Introduce trait for converting AccountIds
      
      * Bring back standalone function for deriving account IDs
      
      * Remove AccountIdConverter configuration trait
      
      * Remove old bridge_account_id derivation function
      
      * Handle target ID decoding errors more gracefully
      
      * Update message-lane to use new AccountId derivation
      
      * Update merged code to use new Origin types
      
      * Use explicit conversion between H256 and AccountIds
      
      * Make relayer fund account a config option in `message-lane` pallet
      
      * Add note about deriving the same account on different chains
      
      * Fix test weight
      
      * Use AccountId instead of Public key when signing Calls
      
      * Semi-hardcode relayer fund address into Message Lane pallet
      951aa36c
    • Svyatoslav Nikolsky's avatar
      Millau -> Rialto messages relay (#399) · d4fc7beb
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * Millau messages -> Rialto relay
      
      * prepare for custom race strategy of delivery race
      
      * custom strategy for delivery race
      
      * update TODOs
      
      * add reference to issue 457
      
      * impl reconnect
      
      * clippy
      
      * fix check in test
      
      * fmt
      
      * removed obsolete TODO
      
      * fixed another TODOs
      
      * fmt
      
      * use MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE const from primitives
      
      * Update relays/messages-relay/src/message_lane_loop.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * added SubstrateMessagesProof typedef
      
      * fix test
      
      * removed comment
      
      * additional_proof_required -> ProofParameters
      
      * typo
      
      * multiline literal
      
      * clippy
      
      * fix typo
      
      * and_then -> await
      
      * update_source_latest_confirmed_nonce
      
      * Update relays/messages-relay/src/message_race_delivery.rs
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      d4fc7beb
    • Svyatoslav Nikolsky's avatar
      Parse substrate message proof (#479) · 2d7eacf6
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      * parse substrate message proof
      
      * unfinalized_header
      2d7eacf6
    • Svyatoslav Nikolsky's avatar
      Rialto -> Millau headers relay (#477) · 3e45356a
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * Rialto -> Millau headers relay
      
      * removed more constraints
      
      * removed file from other PR
      
      * Update primitives/rialto/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      3e45356a
    • Svyatoslav Nikolsky's avatar
      Substrate relay guards (#470) · b027c812
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * substrate relay guards
      
      * checked time condition
      
      * ChainWithBalances
      
      * removed obsolete comment
      
      * Update relays/substrate-client/src/chain.rs
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      
      * trailing space
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      b027c812
    • Hernando Castano's avatar
      Support Tracking Forks in Substrate Pallet (#409) · a6048bca
      Hernando Castano authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * Support multiple "best headers" from different forks
      
      * Update the name of a test
      
      * Add note about multiple scheduled changes
      
      * Disallow multiple scheduled authority set changes
      
      * Return multiple best headers from Runtime APIs
      
      * Remove invalid test write-up
      
      * Add some sketch-ups of test scenarios
      
      * Clean up test scenarios
      
      * Add module for testing forks
      
      * Write headers to storage
      
      * Add way to check expected outcome for header imports
      
      * Add support for importing finality proofs
      
      * Support importing headers which schedule changes
      
      * Write out test scenario using new framework
      
      * Map authority set changes across forks
      
      Gets all the tests in the `forks` module passing
      
      * Remove basic tests
      
      These were used when working on the initial test helper
      
      * Prevent multiple pending set changes on the same fork
      
      * Remove old test which allowed imports past unfinalized header
      
      * Ignore failing test (for now)
      
      * Rewrite `if` comparison using `match` and `cmp`
      
      Fixes Clippy warning: `comparison_chain`
      
      * Add helper for writing test headers with default characteristics
      
      * Fix test that checked authority set updates
      
      * Make note about importing headers on different unfinalized fork
      
      * Perform some cleanup on the fork module
      
      * Fix Clippy complaints
      
      * Provide list of unfinalized headers to Runtime APIs
      
      * Add proofs to expect() calls
      
      * Make tests the focus of the forks module
      
      * Allow specific errors to be checked in fork tests
      
      * Remove unused method
      
      * Replace unreachable() statement with expect()
      
      * Rename storage `unfinalized_headers() `to make its purpose more clear
      
      * Update Runtime API name in relayer to match pallet
      
      * Commit `unfinalized_headers` changes I forgot to add
      
      * Rename ChainTipHeight to BestHeight
      
      * Make schedule_next_set_change require a mutable reference
      
      * Remove check for key when enacting authority set
      
      We only expect to take the happy-path in the pallet anyways, so this check
      to save ourselves the time spent decoding the entry isn't really used.
      
      * Clear justification set when writing headers to storage
      
      * Clarify why we only allow one set change per fork
      
      * Change best_headers() to return HeaderIDs
      
      Prevents us from returning full headers (which are more expensive to
      get from storage) since we only care about header IDs (number, hash)
      anyways.
      
      * Fix Clippy complaint
      
      * Make note about equivocations
      
      * Use HeaderIds when returning incomplete headers
      
      This change stops returning full headers which are more expensive
      to get from storage than header Ids (number, hash) are. Clients likely
      don't need the full header anyways which is why this change is fine.
      
      * Introduce HeaderId type to reduce type complexity
      
      * Add signal hash to storage during genesis config
      
      * Return error instead of expect()-ing
      
      * Fix Clippy lint about `ok_or` fn call
      
      * Rename `forks` module to indicate that it's for testing
      
      * Use `const` for `expect()` proofs
      
      * Remove check that key exists before `kill`-ing value
      
      Co-authored-by: default avatarSvyatoslav Nikolsky <[email protected]>
      a6048bca
    • Svyatoslav Nikolsky's avatar
      Integrate message-lane module RPCs into Rialto/Millau nodes (#458) · 74249a08
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      * integrate message-lane RPCs into Millau and Rialto runtime
      
      * fmt
      
      * use instance in InboundLanes
      
      * moved RialtoMessageLaneKeys/MillauMessageLaneKeys inside rpc_extensions_builder to ease Substrate refs update
      74249a08
    • Svyatoslav Nikolsky's avatar
      Integrate Rialto <-> Millau message lanes into Millau/Rialto runtimes (#386) · e2d9b639
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * millau -> rialto lanes integration
      
      * extrace common message-lane integration types into bridge-runtime-common
      
      * rialto_messages.rs in Millau runtime
      
      * tests
      
      * Update bin/rialto/runtime/src/millau_messages.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * RELAYER_INTEREST_PERCENT -> RELAYER_FEE_PERCENT
      
      * Update bin/runtime-common/src/messages.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * estimate_message_dispatch_and_delivery_fee returns Result
      
      * Update bin/rialto/runtime/src/millau_messages.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update bin/rialto/runtime/src/millau_messages.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update bin/rialto/runtime/src/millau_messages.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * fmt
      
      * mowed weight formula to primitives
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      e2d9b639
    • Svyatoslav Nikolsky's avatar
      Move Chain trait to runtime primitives (#403) · 9e9ac8df
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      * extract ChainBase to bp-runtime
      
      * post-merge fixes
      
      * cargo fmt --all
      
      * compilation fixes
      
      * reexport BlockNumberOf, HashOf, HeaderOf
      9e9ac8df
    • Tomasz Drwięga's avatar
      Initial version of `Call::decode` dispatch. (#300) · 85894005
      Tomasz Drwięga authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * Initial version of call dispatch.
      
      * cargo fmt --all
      
      * Remove unused stuff.
      
      * cargo fmt --all
      
      * weight is part of msg + events
      
      * should_fail_on_weight_mismatch
      
      * plug into runtime
      
      * cargo fmt --all
      
      * fix benchmarks compilation?
      
      * expected/actual values in events
      
      * return actual weight from MessageDispatch::dispatch()
      
      * MessageOrigin -> InstanceId + move bridge_account_id to bp-runtime
      
      * fix benchmarks again
      
      * cargo fmt --all
      
      * clippy
      
      Co-authored-by: default avatarSvyatoslav Nikolsky <[email protected]>
      85894005
    • Svyatoslav Nikolsky's avatar
      Custom RPC methods for DummyOrdered pallet (#317) · c7437c7d
      Svyatoslav Nikolsky authored and Bastian Köcher's avatar Bastian Köcher committed
      
      
      * RPC for DummyOrdered
      
      * add test for RPC
      
      * proof returned by RPC is Vec<<Vec<u8>>>.encode()
      
      * retrieval -> receiving
      
      * bp-runtime crate
      
      * bp-runtime supports no_std
      
      * cargo fmt --all
      
      * jsonrpc_core::BoxFuture
      
      * Update modules/message-lane/rpc/Cargo.toml
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update modules/message-lane/rpc/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * messageLane_ prefix for RPC methods
      
      * Update primitives/runtime/Cargo.toml
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update primitives/runtime/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update modules/message-lane/rpc/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update modules/message-lane/rpc/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Update modules/message-lane/rpc/src/lib.rs
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      c7437c7d
    • Serban Iorga's avatar
      Remove bridges subtree · 9a3e2c8c
      Serban Iorga authored and Bastian Köcher's avatar Bastian Köcher committed
      9a3e2c8c
  2. Mar 26, 2024
    • Dcompoze's avatar
      Fix spelling mistakes across the whole repository (#3808) · 002d9260
      Dcompoze authored
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      002d9260
  3. Mar 13, 2024
  4. Mar 04, 2024
    • Gavin Wood's avatar
      FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280) · fd5f9292
      Gavin Wood authored
      Closes #2160
      
      First part of [Extrinsic
      Horizon](https://github.com/paritytech/polkadot-sdk/issues/2415
      
      )
      
      Introduces a new trait `TransactionExtension` to replace
      `SignedExtension`. Introduce the idea of transactions which obey the
      runtime's extensions and have according Extension data (né Extra data)
      yet do not have hard-coded signatures.
      
      Deprecate the terminology of "Unsigned" when used for
      transactions/extrinsics owing to there now being "proper" unsigned
      transactions which obey the extension framework and "old-style" unsigned
      which do not. Instead we have __*General*__ for the former and
      __*Bare*__ for the latter. (Ultimately, the latter will be phased out as
      a type of transaction, and Bare will only be used for Inherents.)
      
      Types of extrinsic are now therefore:
      - Bare (no hardcoded signature, no Extra data; used to be known as
      "Unsigned")
      - Bare transactions (deprecated): Gossiped, validated with
      `ValidateUnsigned` (deprecated) and the `_bare_compat` bits of
      `TransactionExtension` (deprecated).
        - Inherents: Not gossiped, validated with `ProvideInherent`.
      - Extended (Extra data): Gossiped, validated via `TransactionExtension`.
        - Signed transactions (with a hardcoded signature).
        - General transactions (without a hardcoded signature).
      
      `TransactionExtension` differs from `SignedExtension` because:
      - A signature on the underlying transaction may validly not be present.
      - It may alter the origin during validation.
      - `pre_dispatch` is renamed to `prepare` and need not contain the checks
      present in `validate`.
      - `validate` and `prepare` is passed an `Origin` rather than a
      `AccountId`.
      - `validate` may pass arbitrary information into `prepare` via a new
      user-specifiable type `Val`.
      - `AdditionalSigned`/`additional_signed` is renamed to
      `Implicit`/`implicit`. It is encoded *for the entire transaction* and
      passed in to each extension as a new argument to `validate`. This
      facilitates the ability of extensions to acts as underlying crypto.
      
      There is a new `DispatchTransaction` trait which contains only default
      function impls and is impl'ed for any `TransactionExtension` impler. It
      provides several utility functions which reduce some of the tedium from
      using `TransactionExtension` (indeed, none of its regular functions
      should now need to be called directly).
      
      Three transaction version discriminator ("versions") are now
      permissible:
      - 0b000000100: Bare (used to be called "Unsigned"): contains Signature
      or Extra (extension data). After bare transactions are no longer
      supported, this will strictly identify an Inherents only.
      - 0b100000100: Old-school "Signed" Transaction: contains Signature and
      Extra (extension data).
      - 0b010000100: New-school "General" Transaction: contains Extra
      (extension data), but no Signature.
      
      For the New-school General Transaction, it becomes trivial for authors
      to publish extensions to the mechanism for authorizing an Origin, e.g.
      through new kinds of key-signing schemes, ZK proofs, pallet state,
      mutations over pre-authenticated origins or any combination of the
      above.
      
      ## Code Migration
      
      ### NOW: Getting it to build
      
      Wrap your `SignedExtension`s in `AsTransactionExtension`. This should be
      accompanied by renaming your aggregate type in line with the new
      terminology. E.g. Before:
      
      ```rust
      /// The SignedExtension to the basic transaction logic.
      pub type SignedExtra = (
      	/* snip */
      	MySpecialSignedExtension,
      );
      /// Unchecked extrinsic type as expected by this runtime.
      pub type UncheckedExtrinsic =
      	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
      ```
      
      After:
      
      ```rust
      /// The extension to the basic transaction logic.
      pub type TxExtension = (
      	/* snip */
      	AsTransactionExtension<MySpecialSignedExtension>,
      );
      /// Unchecked extrinsic type as expected by this runtime.
      pub type UncheckedExtrinsic =
      	generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
      ```
      
      You'll also need to alter any transaction building logic to add a
      `.into()` to make the conversion happen. E.g. Before:
      
      ```rust
      fn construct_extrinsic(
      		/* snip */
      ) -> UncheckedExtrinsic {
      	let extra: SignedExtra = (
      		/* snip */
      		MySpecialSignedExtension::new(/* snip */),
      	);
      	let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
      	let signature = payload.using_encoded(|e| sender.sign(e));
      	UncheckedExtrinsic::new_signed(
      		/* snip */
      		Signature::Sr25519(signature),
      		extra,
      	)
      }
      ```
      
      After:
      
      ```rust
      fn construct_extrinsic(
      		/* snip */
      ) -> UncheckedExtrinsic {
      	let tx_ext: TxExtension = (
      		/* snip */
      		MySpecialSignedExtension::new(/* snip */).into(),
      	);
      	let payload = SignedPayload::new(call.clone(), tx_ext.clone()).unwrap();
      	let signature = payload.using_encoded(|e| sender.sign(e));
      	UncheckedExtrinsic::new_signed(
      		/* snip */
      		Signature::Sr25519(signature),
      		tx_ext,
      	)
      }
      ```
      
      ### SOON: Migrating to `TransactionExtension`
      
      Most `SignedExtension`s can be trivially converted to become a
      `TransactionExtension`. There are a few things to know.
      
      - Instead of a single trait like `SignedExtension`, you should now
      implement two traits individually: `TransactionExtensionBase` and
      `TransactionExtension`.
      - Weights are now a thing and must be provided via the new function `fn
      weight`.
      
      #### `TransactionExtensionBase`
      
      This trait takes care of anything which is not dependent on types
      specific to your runtime, most notably `Call`.
      
      - `AdditionalSigned`/`additional_signed` is renamed to
      `Implicit`/`implicit`.
      - Weight must be returned by implementing the `weight` function. If your
      extension is associated with a pallet, you'll probably want to do this
      via the pallet's existing benchmarking infrastructure.
      
      #### `TransactionExtension`
      
      Generally:
      - `pre_dispatch` is now `prepare` and you *should not reexecute the
      `validate` functionality in there*!
      - You don't get an account ID any more; you get an origin instead. If
      you need to presume an account ID, then you can use the trait function
      `AsSystemOriginSigner::as_system_origin_signer`.
      - You get an additional ticket, similar to `Pre`, called `Val`. This
      defines data which is passed from `validate` into `prepare`. This is
      important since you should not be duplicating logic from `validate` to
      `prepare`, you need a way of passing your working from the former into
      the latter. This is it.
      - This trait takes two type parameters: `Call` and `Context`. `Call` is
      the runtime call type which used to be an associated type; you can just
      move it to become a type parameter for your trait impl. `Context` is not
      currently used and you can safely implement over it as an unbounded
      type.
      - There's no `AccountId` associated type any more. Just remove it.
      
      Regarding `validate`:
      - You get three new parameters in `validate`; all can be ignored when
      migrating from `SignedExtension`.
      - `validate` returns a tuple on success; the second item in the tuple is
      the new ticket type `Self::Val` which gets passed in to `prepare`. If
      you use any information extracted during `validate` (off-chain and
      on-chain, non-mutating) in `prepare` (on-chain, mutating) then you can
      pass it through with this. For the tuple's last item, just return the
      `origin` argument.
      
      Regarding `prepare`:
      - This is renamed from `pre_dispatch`, but there is one change:
      - FUNCTIONALITY TO VALIDATE THE TRANSACTION NEED NOT BE DUPLICATED FROM
      `validate`!!
      - (This is different to `SignedExtension` which was required to run the
      same checks in `pre_dispatch` as in `validate`.)
      
      Regarding `post_dispatch`:
      - Since there are no unsigned transactions handled by
      `TransactionExtension`, `Pre` is always defined, so the first parameter
      is `Self::Pre` rather than `Option<Self::Pre>`.
      
      If you make use of `SignedExtension::validate_unsigned` or
      `SignedExtension::pre_dispatch_unsigned`, then:
      - Just use the regular versions of these functions instead.
      - Have your logic execute in the case that the `origin` is `None`.
      - Ensure your transaction creation logic creates a General Transaction
      rather than a Bare Transaction; this means having to include all
      `TransactionExtension`s' data.
      - `ValidateUnsigned` can still be used (for now) if you need to be able
      to construct transactions which contain none of the extension data,
      however these will be phased out in stage 2 of the Transactions Horizon,
      so you should consider moving to an extension-centric design.
      
      ## TODO
      
      - [x] Introduce `CheckSignature` impl of `TransactionExtension` to
      ensure it's possible to have crypto be done wholly in a
      `TransactionExtension`.
      - [x] Deprecate `SignedExtension` and move all uses in codebase to
      `TransactionExtension`.
        - [x] `ChargeTransactionPayment`
        - [x] `DummyExtension`
        - [x] `ChargeAssetTxPayment` (asset-tx-payment)
        - [x] `ChargeAssetTxPayment` (asset-conversion-tx-payment)
        - [x] `CheckWeight`
        - [x] `CheckTxVersion`
        - [x] `CheckSpecVersion`
        - [x] `CheckNonce`
        - [x] `CheckNonZeroSender`
        - [x] `CheckMortality`
        - [x] `CheckGenesis`
        - [x] `CheckOnlySudoAccount`
        - [x] `WatchDummy`
        - [x] `PrevalidateAttests`
        - [x] `GenericSignedExtension`
        - [x] `SignedExtension` (chain-polkadot-bulletin)
        - [x] `RefundSignedExtensionAdapter`
      - [x] Implement `fn weight` across the board.
      - [ ] Go through all pre-existing extensions which assume an account
      signer and explicitly handle the possibility of another kind of origin.
      - [x] `CheckNonce` should probably succeed in the case of a non-account
      origin.
      - [x] `CheckNonZeroSender` should succeed in the case of a non-account
      origin.
      - [x] `ChargeTransactionPayment` and family should fail in the case of a
      non-account origin.
        - [ ] 
      - [x] Fix any broken tests.
      
      ---------
      
      Signed-off-by: default avatargeorgepisaltu <[email protected]>
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      Signed-off-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatarNikhil Gupta <[email protected]>
      Co-authored-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: default avatarChevdor <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarMaciej <[email protected]>
      Co-authored-by: default avatarJavier Viola <[email protected]>
      Co-authored-by: default avatarMarcin S. <[email protected]>
      Co-authored-by: default avatarTsvetomir Dimitrov <[email protected]>
      Co-authored-by: default avatarJavier Bullrich <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: Vladimir Istyufeev's avatarVladimir Istyufeev <[email protected]>
      Co-authored-by: default avatarRoss Bulat <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarSvyatoslav Nikolsky <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatars0me0ne-unkn0wn <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      Co-authored-by: default avatarJulian Eager <[email protected]>
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarDónal Murray <[email protected]>
      Co-authored-by: default avataryjh <[email protected]>
      Co-authored-by: default avatarTom Mi <[email protected]>
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      Co-authored-by: default avatarWill | Paradox | ParaNodes.io <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarPG Herveou <[email protected]>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarJuan Girini <[email protected]>
      Co-authored-by: default avatarbader y <[email protected]>
      Co-authored-by: default avatarJames Wilson <[email protected]>
      Co-authored-by: default avatarjoe petrowski <[email protected]>
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      Co-authored-by: default avatarParth <[email protected]>
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      Co-authored-by: default avatarJonathan Udd <[email protected]>
      Co-authored-by: default avatarSerban Iorga <[email protected]>
      Co-authored-by: default avatarEgor_P <[email protected]>
      Co-authored-by: default avatarBranislav Kontur <[email protected]>
      Co-authored-by: default avatarEvgeny Snitko <[email protected]>
      Co-authored-by: default avatarJust van Stam <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      Co-authored-by: default avatargupnik <[email protected]>
      Co-authored-by: default avatardzmitry-lahoda <[email protected]>
      Co-authored-by: default avatarzhiqiangxu <[email protected]>
      Co-authored-by: default avatarNazar Mokrynskyi <[email protected]>
      Co-authored-by: default avatarAnwesh <[email protected]>
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarSam Johnson <[email protected]>
      Co-authored-by: default avatarkianenigma <[email protected]>
      Co-authored-by: default avatarJegor Sidorenko <[email protected]>
      Co-authored-by: default avatarMuharem <[email protected]>
      Co-authored-by: default avatarjoepetrowski <[email protected]>
      Co-authored-by: default avatarAlexandru Gheorghe <[email protected]>
      Co-authored-by: default avatarGabriel Facco de Arruda <[email protected]>
      Co-authored-by: default avatarSquirrel <[email protected]>
      Co-authored-by: default avatarAndrei Sandu <[email protected]>
      Co-authored-by: default avatargeorgepisaltu <[email protected]>
      Co-authored-by: command-bot <>
      fd5f9292
  5. Jan 19, 2024
  6. Dec 21, 2023
  7. Dec 18, 2023
  8. Nov 15, 2023
  9. Nov 01, 2023
  10. Oct 03, 2023
  11. Sep 11, 2023
    • Serban Iorga's avatar
      Update bridges subtree (#1392) · 142a11ad
      Serban Iorga authored
      * Move the bridges subtree under root
      
      * Squashed 'bridges/' changes from 277f0d5496..e50398d1c5
      
      e50398d1c5 bridges subtree fixes (#2528)
      99af07522d Markdown linter (#1309) (#2526)
      733ff0fe7a `polkadot-staging` branch: Use polkadot-sdk dependencies (#2524)
      e8a59f141e Fix benchmark with new XCM::V3 `MAX_INSTRUCTIONS_TO_DECODE` (#2514)
      62b185de15 Backport `polkadot-sdk` changes to `polkadot-staging` (#2518)
      d9658f4d5b Fix equivocation detection containers startup (#2516) (#2517)
      d65db28a8f Backport: building images from locally built binaries (#2513)
      5fdbaf45f6 Start the equivocation detection loop from the complex relayer (#2507) (#2512)
      7fbb67de46 Backport: Implement basic equivocations detection loop (#2375)
      cb7efe245c Manually update deps in polkadot staging (#2371)
      d17981fc33 #2351 to polkadot-staging (#2359)
      
      git-subtree-dir: bridges
      git-subtree-split: e50398d1c594e4e96df70b0bd376e565d17e8558
      
      * Reapply diener workspacify
      
      * Fix Cargo.toml
      
      * Fix test
      
      * Adjustments
      142a11ad