Skip to content
  1. Feb 17, 2023
    • 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
  2. Feb 16, 2023
  3. Feb 15, 2023
    • Alexander Theißen's avatar
      contracts: Use `proof_size` from benchmarks (#13268) · 1c04ab0f
      Alexander Theißen authored
      
      
      * Avoid reading contract code when it is supplied in the extrinsic
      
      * Remove custom proof size injection from schedule
      
      * Set benchmarks pov_mode to Measure
      
      * Reduce overestimation of code size on re-instrument
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Do not override proof size from benchmark
      
      * Do not charge proof size for basic block
      
      * Incrase gas limit for tests
      
      * Fix deletion queue to also use `proof_size`
      
      * Fix tests
      
      * Update frame/contracts/src/schedule.rs
      
      Co-authored-by: default avatarCyrill Leutwiler <[email protected]>
      
      * Fix wrong schedule macro invocations
      
      * Remove stale docs
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Handle zero components
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Fix instruction weight
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarCyrill Leutwiler <[email protected]>
      1c04ab0f
  4. Feb 14, 2023
    • Sasha Gryaznov's avatar
      [contracts] make `debug_message` execution outcome invariant to node debug logging setting (#13197) · 53b77785
      Sasha Gryaznov authored
      
      
      * update benchmark for seal_debug_message
      
      * add seal_debug_message_per_kb benchmark
      
      * un-fallable debug buffer: silently drops excessive and wrong utf-8 encoded messages
      
      * charge debug_message per byte of the message
      
      * improved benchmark
      
      * cap debug_message
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * fix applied buggy suggestion
      
      * make sure i*1024 < MaxDebugBufferLen
      
      * fix schedule for our non-batched benchmark
      
      * Switch to a `wasmtime` fork with LTO linking failure workaround
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarJan Bujak <[email protected]>
      53b77785
    • Bastian Köcher's avatar
      pallet-timestamp: Remove `ValidAtTimestamp` error variant (#13346) · 4af64eb0
      Bastian Köcher authored
      
      
      * pallet-timestamp: Remove `ValidAtTimestamp` error variant
      
      The error variant wasn't that useful and it was also used wrongly in the code. In the code we
      returned this variant when the `timestamp < minimum`. The problem of this is that we waited on the
      node side some time, but then `set` function rejects the timestamp because of the same check (the
      timestamp in the block stays the same). We ensure that the timestamp isn't drifting too much in the
      future, but waiting for the timestamp to be "valid" would open some attack vector. The consensus
      protocols also compare the slots in the blocks to ensure that there isn't a block from the future
      and in the runtime we then ensure that `slot = timestamp / slot_duration`. So, we can just remove
      this variant and replace it with a new variant `TimeBetweenBlocksTooShort` to not even try importing
      a block which uses a too short delay since the last block.
      
      * Update primitives/timestamp/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Rename to `TooEarly`
      
      * FMT
      
      ---------
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      4af64eb0
  5. Feb 12, 2023
  6. Feb 11, 2023
  7. Feb 07, 2023
  8. Feb 06, 2023
  9. Feb 03, 2023
  10. Feb 02, 2023
  11. Jan 30, 2023
  12. Jan 29, 2023
  13. Jan 28, 2023
  14. Jan 26, 2023
  15. Jan 24, 2023
  16. Jan 19, 2023
  17. Jan 15, 2023
  18. Jan 13, 2023
  19. Jan 09, 2023
  20. Jan 06, 2023
  21. Jan 05, 2023
  22. Jan 04, 2023
  23. Jan 02, 2023
  24. Dec 28, 2022
  25. Dec 24, 2022
    • André Silva's avatar
      babe: allow skipping over empty epochs (#11727) · 017cf703
      André Silva authored
      
      
      * babe: allow skipping epochs in pallet
      
      * babe: detect and skip epochs on client
      
      * babe: cleaner epoch util functions
      
      * babe: add test for runtime handling of skipped epochs
      
      * babe: simpler implementation of client handling of skipped epochs
      
      * babe: test client-side handling of skipped epochs
      
      * babe: add comments on client-side skipped epochs
      
      * babe: remove emptyline
      
      * babe: make it resilient to forks
      
      * babe: typo
      
      * babe: overflow-safe math
      
      * babe: add test for skipping epochs across different forks
      
      * Fix tests
      
      * FMT
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      017cf703
  26. Dec 21, 2022
  27. Dec 20, 2022
    • Michal Kucharczyk's avatar
      `BlockId` removal: refactor: `HeaderBackend::header` (#12874) · 548955a7
      Michal Kucharczyk authored
      * BlockId removal: refactor: HeaderBackend::header
      
      It changes the arguments of:
      - `HeaderBackend::header`,
      - `Client::header`,
      - `PeersClient::header`
      - `ChainApi::block_header`
      
      methods from: `BlockId<Block>` to: `Block::Hash`
      
      This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
      
      * non-trivial usages of haeder(block_id) refactored
      
      This may required introduction of dedicated function:
      header_for_block_num
      
      * fmt
      
      * fix
      
      * doc fixed
      
      * ".git/.scripts/fmt.sh"
      
      * BlockId removal: refactor: HeaderBackend::expect_header
      
      It changes the arguments of `HeaderBackend::expect_header` method from: `BlockId<Block>` to: `Block::Hash`
      
      * ".git/.scripts/fmt.sh"
      
      * readme updated
      
      * ".git/.scripts/fmt.sh"
      
      * fix
      
      Co-authored-by: parity-processbot <>
      548955a7
  28. Dec 19, 2022
  29. Dec 14, 2022