1. Jan 19, 2023
    • Gavin Wood's avatar
      Make DispatchError impl MEL (#13169) · 2d7fa18e
      Gavin Wood authored
      
      
      * Make DispatchError impl MEL
      
      * Upgrade SCALE codec to support `codec(skip)` for MEL
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      2d7fa18e
    • Sebastian Kunert's avatar
      Notification-based block pinning (#13157) · 9be65570
      Sebastian Kunert authored
      
      
      * Worker
      
      * Reorganize and unpin onnotification drop
      
      * Pin in state-db, pass block number
      
      * Pin blocks in blockchain db
      
      * Switch to reference counted LRU
      
      * Disable pinning when we keep all blocks
      
      * Fix pinning hint for state-db
      
      * Remove pinning from backend layer
      
      * Improve readability
      
      * Add justifications to test
      
      * Fix justification behaviour
      
      * Remove debug prints
      
      * Convert channels to tracing_unbounded
      
      * Add comments to the test
      
      * Documentation and Cleanup
      
      * Move task start to client
      
      * Simplify cache
      
      * Improve test, remove unwanted log
      
      * Add tracing logs, remove expect for block number
      
      * Cleanup
      
      * Add conversion method for unpin handle to Finalitynotification
      
      * Revert unwanted changes
      
      * Improve naming
      
      * Make clippy happy
      
      * Fix docs
      
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      
      * Use `NumberFor` instead of u64 in API
      
      * Hand over weak reference to unpin worker task
      
      * Unwanted
      
      * &Hash -> Hash
      
      * Remove number from interface, rename `_unpin_handle`, LOG_TARGET
      
      * Move RwLock one layer up
      
      * Apply code style suggestions
      
      * Improve comments
      
      * Replace lru crate by schnellru
      
      * Only insert values for pinned items + better docs
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Improve comments, log target and test
      
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      9be65570
    • Tsvetomir Dimitrov's avatar
      Expose `UnknownBlock` error via `ApiError` (#12707) · 7a1958ca
      Tsvetomir Dimitrov authored
      * Expose `UnknownBlock` error via `ApiError`
      
      In [certain cases](https://github.com/paritytech/polkadot/issues/5885
      
      ) a
      runtime api is called for an unknown block. For example a block which is
      already pruned or on an abandon fork.
      
      In such cases the correct error is returned but it is wrapped in
      `ApiError::Application` and the only way to figure out what is the
      problem is to inspect the actual message in the error. In polkadot for
      example this usually happens when the runtime api version is being
      queried. It's beneficial to be able to clearly separate such errors so i
      that when they occur the client side can handle them more gracefully.
      E.g. log less stressful error message than `State already discarded for
      BlockId` or cancel any pending work related on this block.
      
      * Update primitives/api/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      7a1958ca
  2. Jan 18, 2023
  3. Jan 17, 2023
  4. Jan 16, 2023
    • Michal Kucharczyk's avatar
      txpool: don't maintain the pool during major sync (#13004) · 5134dabb
      Michal Kucharczyk authored
      
      
      * txpool: don't maintain the pool during major sync
      
      Fix shall prevent from wasting the CPU during the major sync. No actions
      are actually required in transaction pool during the major sync.
      
      Fixes: #12903
      
      * passing sync_oracle to maintain method
      
      * fixed: builder, txpool tests
      
      * do not maintain tx-pool if node gone out of sync
      
      * EnactmentAction: all logic moved to EnactmentState
      
      Tests to be done.
      
      * maintain guard logic moved directly to MaintainedTransactionPool
      
      * minor fixes
      
      * EnactmentAction: all logic moved to EnactmentState (again)
      
      * SyncOracle fixes here and there
      
      * Update client/transaction-pool/src/enactment_state.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update client/transaction-pool/src/enactment_state.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * sync_oracle removed
      
      * spelling + fmt + doc
      
      * Review suggestions applied
      
      * log::info -> debug
      
      * Update client/transaction-pool/src/enactment_state.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      5134dabb
    • JP's avatar
      More improvements for the crate publishing pipeline (#13153) · 21141f5d
      JP authored
      * more improvements for the crate publishing pipeline
      
      * move default definitions to the publish-crates script
      
      * add script to check the crate publishing pipeline at the start
      
      * fix yaml references
      
      * move more variables to .crates-publishing-pipeline
      
      * separate .crates-publishing-pipeline from .crates-publishing-variables
      
      * clean up redundant and unused code
      21141f5d
    • Bastian Köcher's avatar
      pallet-offences-benchmarking: Box events in verify (#13151) · 52a56e5f
      Bastian Köcher authored
      * pallet-offences-benchmarking: Box events in verify
      
      Events in frame are represented by an enum in the pallet and the runtime. The size of an enum in
      Rust depends on the size of biggest variant. This means we always need to allocate memory for the
      biggest variant when allocating memory for an event. The offences benchmarking is verifying the
      benchmarking results by checking the events. To check the events it is generating all the expected
      events. With the recent changes in Polkadot the events are too big and lead to issues when running
      this verify functions. The solution is to box each event, as the vector holding all the events will
      then only need to hold fat pointers * expected events, instead of size_of(event) * expected events.
      This issue isn't a problem in production, as we never read the events on chain. When we are reading
      the events, it is done in an offchain context and they are only decoded one by one.
      
      Besides that this also enables the benchmarking verification for everyone running these benchmarks.
      
      * FMT
      
      * Disable checking again
      52a56e5f
  5. Jan 15, 2023
  6. Jan 13, 2023
  7. Jan 12, 2023
  8. Jan 11, 2023
  9. Jan 10, 2023
  10. Jan 09, 2023
  11. Jan 08, 2023
  12. Jan 07, 2023