Skip to content
  1. Feb 21, 2023
  2. Feb 20, 2023
    • Michal Kucharczyk's avatar
      `BlockId` removal: `runtime-api` refactor (#13255) · 7a101541
      Michal Kucharczyk authored
      
      
      * BlockId removal: refactor of runtime API
      
      It changes the arguments of:
      - `ApiExt` methods:  `has_api`, `has_api_with`, `api_version`
      - `CallApiAt` method: `runtime_version_at`
      from: `BlockId<Block>` to: `Block::Hash`
      
      It also changes the first argument of all generated runtime API calls from: `BlockId<Block>` to: `Block::Hash`
      
      This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
      
      * BlockId removal: refactor of runtime API - tests
      
      - tests adjusted to new runtime API,
      - some tests migrated from block number to block hash
      
      * benchmarking-cli: BlockId(0) migrated to info().genesis_hash
      
      `runtime_api.call()` now requires the block hash instead of BlockId::Number.
      To access the genesis hash widely used in benchmarking engine the Client
      was constrained to satisfy `sp_blockchain::HeaderBackend<Block>` trait
      which provides `info().genesis_hash`.
      
      * trivial: api.call(BlockId) -> api.call(Hash)
      
      - Migrated all `runtime_api.calls` to use Hash
      - Noteworthy (?):
      -- `validate_transaction_blocking` in transaction pool,
      
      * CallApiAtParams::at changed to Block::Hash
      
      * missed doc updated
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * BlockId removal: Benchmark::consumed_weight
      
      Little refactor around `Benchmark::consumed_weight`: `BlockId` removed.
      
      * at_hash renamed
      
      * wrong merge fixed
      
      * beefy worker: merged with master
      
      * beefy: tests: missing block problem fixed
      
      * Apply review suggestion
      
      * fix
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: command-bot <>
      7a101541
    • Adrian Catangiu's avatar
      client/beefy: drop justification on import if pallet not enabled (#13422) · bd8cb7ba
      Adrian Catangiu authored
      
      
      BEEFY pallet allows setting on-chain BEEFY genesis to some future
      block. Disregard any BEEFY justifications attached to imported blocks
      that predate configured BEEFY genesis.
      
      Signed-off-by: default avataracatangiu <[email protected]>
      bd8cb7ba
    • Dmitry Markin's avatar
      Use async/await instead of manual polling of `NetworkWorker` (#13219) · 8d033b6d
      Dmitry Markin authored
      
      
      * Convert `NetworkWorker::poll()` into async `next_action()`
      
      * Use `NetworkWorker::next_action` instead of `poll` in `sc-network-test`
      
      * Revert "Use `NetworkWorker::next_action` instead of `poll` in `sc-network-test`"
      
      This reverts commit 4b5d851ec864f78f9d083a18a618fbe117c896d2.
      
      * Fix `sc-network-test` to poll `NetworkWorker::next_action`
      
      * Fix `sc_network::service` tests to poll `NetworkWorker::next_action`
      
      * Fix docs
      
      * kick CI
      
      * Factor out `next_worker_message()` & `next_swarm_event()`
      
      * Error handling: replace `futures::pending!()` with `expect()`
      
      * Simplify stream polling in `select!`
      
      * Replace `NetworkWorker::next_action()` with `run()`
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * minor: comment
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Print debug log when network future is shut down
      
      * Evaluate `NetworkWorker::run()` future once before the loop
      
      * Fix client code to match new `NetworkService` interfaces
      
      * Make clippy happy
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Revert "Apply suggestions from code review"
      
      This reverts commit 9fa646d0ed613e5f8623d3d37d1d59ec0a535850.
      
      * Make `NetworkWorker::run()` consume `self`
      
      * Terminate system RPC future if RPC rx stream has terminated.
      
      * Rewrite with let-else
      
      * Fix comments
      
      * Get `best_seen_block` and call `on_block_finalized` via `ChainSync` instead of `NetworkService`
      
      * rustfmt
      
      * make clippy happy
      
      * Tests: schedule wake if `next_action()` returned true
      
      * minor: comment
      
      * minor: fix `NetworkWorker` rustdoc
      
      * minor: amend the rustdoc
      
      * Fix bug that caused `on_demand_beefy_justification_sync` test to hang
      
      * rustfmt
      
      * Apply review suggestions
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      8d033b6d
  3. Feb 18, 2023
    • Bastian Köcher's avatar
      state-db: Print warning when using large pruning window on RocksDb (#13414) · fdd5203a
      Bastian Köcher authored
      * state-db: Print warning when using large pruning window on RocksDb
      
      This pr changes state-db to print a warning when using a large pruning window and running with a
      database that isn't supporting ref-counting like RocksDb. This makes the user aware of potential out
      of memory errors because this option together with RocksDb etc puts the entire pruning window into
      memory. Besides that the pr introduces `LOG_TARGET` for having the target declared central!
      
      * Review comments
      fdd5203a
  4. Feb 17, 2023
    • Dmitry Markin's avatar
      Revert "network: Detect early that `NotificationOutSubstream` was closed by... · 4d720a92
      Dmitry Markin authored
      Revert "network: Detect early that `NotificationOutSubstream` was closed by the remote (#13396)" (#13409)
      
      This reverts commit b7e58e7c.
      4d720a92
    • Dmitry Markin's avatar
    • Adrian Catangiu's avatar
      BEEFY: implement equivocations detection, reporting and slashing (#13121) · c21f292a
      Adrian Catangiu authored
      
      
      * client/beefy: simplify self_vote logic
      
      * client/beefy: migrate to new state version
      
      * client/beefy: detect equivocated votes
      
      * fix typos
      
      * sp-beefy: add equivocation primitives
      
      * client/beefy: refactor vote processing
      
      * fix version migration for new rounds struct
      
      * client/beefy: track equivocations and create proofs
      
      * client/beefy: adjust tests for new voting logic
      
      * sp-beefy: fix commitment ordering and equality
      
      * client/beefy: simplify handle_vote() a bit
      
      * client/beefy: add simple equivocation test
      
      * client/beefy: submit equivocation proof - WIP
      
      * frame/beefy: add equivocation report runtime api - part 1
      
      * frame/beefy: report equivocation logic - part 2
      
      * frame/beefy: add pluggable Equivocation handler - part 3
      
      * frame/beefy: impl ValidateUnsigned for equivocations reporting
      
      * client/beefy: submit report equivocation unsigned extrinsic
      
      * primitives/beefy: fix tests
      
      * frame/beefy: add default weights
      
      * frame/beefy: fix tests
      
      * client/beefy: fix tests
      
      * frame/beefy-mmr: fix tests
      
      * frame/beefy: cross-check session index with equivocation report
      
      * sp-beefy: make test Keyring useable in pallet
      
      * frame/beefy: add basic equivocation test
      
      * frame/beefy: test verify equivocation results in slashing
      
      * frame/beefy: test report_equivocation_old_set
      
      * frame/beefy: add more equivocation tests
      
      * sp-beefy: fix docs
      
      * beefy: simplify equivocations and fix tests
      
      * client/beefy: address review comments
      
      * frame/beefy: add ValidateUnsigned to test/mock runtime
      
      * client/beefy: fixes after merge master
      
      * fix missed merge damage
      
      * client/beefy: add test for reporting equivocations
      
      Also validated there's no unexpected equivocations reported in the
      other tests.
      
      Signed-off-by: default avataracatangiu <[email protected]>
      
      * sp-beefy: move test utils to their own file
      
      * client/beefy: add negative test for equivocation reports
      
      * sp-beefy: move back MmrRootProvider - used in polkadot-service
      
      * impl review suggestions
      
      * client/beefy: add equivocation metrics
      
      ---------
      
      Signed-off-by: default avataracatangiu <[email protected]>
      Co-authored-by: parity-processbot <>
      c21f292a
  5. Feb 16, 2023
  6. Feb 15, 2023
  7. Feb 14, 2023
  8. Feb 13, 2023
  9. Feb 12, 2023
  10. Feb 11, 2023
  11. Feb 08, 2023
  12. Feb 07, 2023
  13. Feb 06, 2023
  14. Feb 03, 2023
  15. Feb 02, 2023
  16. Jan 29, 2023
  17. Jan 28, 2023
  18. Jan 27, 2023
  19. Jan 26, 2023
  20. Jan 25, 2023