Skip to content
Snippets Groups Projects
  1. Jul 08, 2020
  2. Jul 07, 2020
  3. Jul 04, 2020
    • André Silva's avatar
      babe: report equivocations (#6362) · a9c21b8b
      André Silva authored
      * slots: create primitives crate for consensus slots
      
      * offences: add method to check if an offence is unknown
      
      * babe: initial equivocation reporting implementation
      
      * babe: organize imports
      
      * babe: working equivocation reporting
      
      * babe: add slot number to equivocation proof
      
      * session: move duplicate traits to session primitives
      
      * babe: move equivocation stuff to its own file
      
      * offences: fix test
      
      * session: don't have primitives depend on frame_support
      
      * babe: use opaque type for key owner proof
      
      * babe: cleanup client equivocation reporting
      
      * babe: cleanup equivocation code in pallet
      
      * babe: allow sending signed equivocation reports
      
      * node: fix compilation
      
      * fix test compilation
      
      * babe: return bool on check_equivocation_proof
      
      * babe: add test for equivocation reporting
      
      * babe: add more tests
      
      * babe: add test for validate unsigned
      
      * babe: take slot number in generate_key_ownership_proof API
      
      * babe: add benchmark for equivocation proof checking
      
      * session: add benchmark for membership proof checking
      
      * offences: fix babe benchmark
      
      * babe: add weights based on benchmark results
      
      * babe: adjust weights after benchmarking on reference hardware
      
      * babe: reorder checks in check_and_report_equivocation
      a9c21b8b
  4. Jul 03, 2020
  5. Jul 02, 2020
  6. Jul 01, 2020
    • cheme's avatar
      Restrict `Protected` to some heap types. (#6471) · 424d5c72
      cheme authored
      * Restrict `Protected` to some heap types.
      
      * Comment abut Protected usage.
      
      * Remove Protected from crypto, use secrecy crate for existing uses.
      
      * use a parse function
      
      * fix error convert
      
      * Rename and move secretY string function.
      
      * std result
      424d5c72
    • David's avatar
      Fix mocking multiple http calls in the same function call (#6510) · d73de3be
      David authored
      
      * Fix mocking multiple http calls in the same function call
      
      Fixes an issue where a function call would perform more than one http request and wait for each to complete before proceeding. The `RequestId` comes from the length of the `requests` collection in the `OffchainState` and if a request is completed before the next one starts it will be removed and the "next expected" will be off by one. This PR tries to fix that by using a request counter that tracks how many requests have been performed so that we can `remove()` items from the `expected_requests` at the right index.
      
      I suspect that this is a sub-optimal soluton and perhaps requests and their mocks should live side by side in the same collection, e.g. in a tuple of `(PendingRequest, Option<ExpectedRequest>)`.
      
      * Update primitives/core/src/offchain/testing.rs
      
      Co-authored-by: default avatarBernhard Schuster <bernhard@ahoi.io>
      
      * Update primitives/core/src/offchain/testing.rs
      
      Co-authored-by: default avatarBernhard Schuster <bernhard@ahoi.io>
      
      * Panic on overflow
      
      * Update primitives/core/src/offchain/testing.rs
      
      Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
      
      * Use a Deque and push/pop expected requests
      
      * fix test
      
      Co-authored-by: default avatarBernhard Schuster <bernhard@ahoi.io>
      Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
      d73de3be
  7. Jun 30, 2020
    • André Silva's avatar
      grandpa: minor cleanups in communication module (#6371) · 4cf1b4fa
      André Silva authored
      * grandpa: replace Result<(), ()> with Option<()>
      
      * grandpa: replace &Option<T> with Option<&T>
      
      * grandpa: cleanup local id and keystore usages
      
      * grandpa: return bool on check_message_signature
      
      * grandpa: fix erroneous log message on startup
      
      * grandpa: fix test
      4cf1b4fa
    • Bastian Köcher's avatar
      Support synching of blocks that are not `new_best` (#6508) · 53be6ec5
      Bastian Köcher authored
      * Start
      
      * Remove debug println
      
      * Add tests
      53be6ec5
    • Ashley's avatar
      Remove the service, replacing it with a struct of individual chain components (#6352) · b832e35c
      Ashley authored
      * WIP
      
      * Making progress
      
      * Almost ready
      
      * Get service tests compiling
      
      * Fix node screenshot
      
      * Line widths
      
      * Fix node cli tests
      
      * Fix node cli warning
      
      * ChainComponents -> ServiceComponents, fix tests
      
      * make spawn_handle public
      
      * Remove spawnnamed impl for taskmanager
      
      * Move the keep alive stuff to the task manager
      
      * Move the telemetry, base path, rpc keep_alive to the service builder
      
      * Make the task manager keep alive an internal detail
      
      * Rewrite the browser start_client future
      
      * Remove run_node etc
      
      * Revert my personal changes to browser-demo/build.sh
      
      * use |config|
      
      * Add a runtime_version function to SubstrateCli
      
      * Reexport role and runtime version from sc cli
      
      * Update Cargo.lock
      
      * runtime_version -> native_runtime_version
      
      * Pass chain spec to native_runtime_version for polkadot
      
      * Fix line widths
      
      * Traitify ServiceComponents Client
      b832e35c
    • Bastian Köcher's avatar
      Fix tx-pool returning the same transaction multiple times (#6535) · 493d5d85
      Bastian Köcher authored
      
      * Fix tx-pool returning the same transaction multiple times
      
      This fixes a bug that lead to returning the same transaction multiple
      times when iterating the `ready` iterator. Internally the transaction
      was kept in the `best` list and could be duplicated in that list be
      re-inserting it again. This `best` list is using a `TransactionRef`
      which internally uses a `insertion_id`. This `insertion_id` could lead
      to the same transaction being inserted multiple times into the `best`
      list.
      
      * Update client/transaction-pool/src/testing/pool.rs
      
      Co-authored-by: default avatarNikolay Volf <nikvolf@gmail.com>
      
      Co-authored-by: default avatarNikolay Volf <nikvolf@gmail.com>
      493d5d85
    • Toralf Wittner's avatar
      Update to libp2p v0.20.1 (#6465) · 3de2a880
      Toralf Wittner authored
      
      * Update to libp2p-0.20.0
      
      * Update to `libp2p-0.20.1`.
      
      Co-authored-by: default avatarPierre Krieger <pierre.krieger1708@gmail.com>
      3de2a880
  8. Jun 26, 2020
  9. Jun 25, 2020
  10. Jun 24, 2020
  11. Jun 23, 2020
    • Cecile Tonglet's avatar
      Ensure the listen addresses are consistent with the transport (#6436) · 4bf044ea
      Cecile Tonglet authored
      * Initial commit
      
      Forked at: 82bdf1a8
      
      
      No parent branch.
      
      * Ensure the listen addresses are consistent with the transport
      
      * Update client/network/src/error.rs
      
      * Update client/network/src/service.rs
      
      * Better implementation
      
      * Fix bad previous impl
      
      * add boot_nodes
      
      * reserved nodes
      
      * test boot nodes
      
      * reserved nodes tests
      
      * add public_addresses and make specific error type
      
      * Update client/network/src/error.rs
      
      Co-authored-by: default avatarPierre Krieger <pierre.krieger1708@gmail.com>
      
      Co-authored-by: default avatarPierre Krieger <pierre.krieger1708@gmail.com>
      4bf044ea
    • Max Inden's avatar
      client/network/service: Add primary dimension to connection metrics (#6472) · bd79b3de
      Max Inden authored
      * client/network/service: Add primary dimension to connection metrics
      
      Two nodes can be interconnected via one or more connections. The first
      of those connections is called the primary connection.
      
      This commit adds another dimension to the
      `sub_libp2p_connections_{closed,opened}_total` metrics to differentiate
      primary and non-primary connections being opened / closed.
      
      By intuition more than one connection between two nodes is rare.
      Tracking the fact whether a connection is primary or not will help prove
      or disprove this intuition.
      
      * .maintain/monitoring: Ensure to sum over all connections_closed variants
      
      * client/network/service: Rename is_primary to is_first
      
      * client/network/service: Split by metric name with two additional metrics
      
      * Revert ".maintain/monitoring: Ensure to sum over all connections_closed variants"
      
      This reverts commit 2d2f93e414440b9fc9e8f7fae6fe48bd95af6b8f.
      
      * client/network/service: Remove labels from distinct metrics
      bd79b3de
    • Ashley's avatar
      Fix the browser node and ensure it doesn't colour the informant output (#6457) · d976f712
      Ashley authored
      * Fix browser informant
      
      * Fix documentation
      
      * Add an informant_output_format function to the cli config
      
      * Wrap informant output format in an option
      
      * Revert batch verifier
      
      * Remove wasm-timer from primitives io cargo lock
      
      * Drop informant_output_format function
      
      * derive debug for output format
      d976f712
    • Cecile Tonglet's avatar
      impl Debug for sc_service::Configuration (#6400) · 63793c8b
      Cecile Tonglet authored
      * Initial commit
      
      Forked at: 252416d3
      
      
      No parent branch.
      
      * Make sc_service::Configuration derive Debug
      
      * Replace task_executor fn's input by proper TaskExecutor type (cleaner)
      
      * impl From<Fn> for TaskExecutor
      
      * Update client/cli/src/runner.rs
      
      * Add some doc, examples and tests
      
      * Replace Deref by fn spawn as suggested
      
      Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
      63793c8b
    • pscott's avatar
      Optimize offchain worker api by re-using http-client (#6454) · ceb0fa63
      pscott authored
      * Fix typo in offchain's docs
      
      * Use Self keyword in AsyncApi::new()
      
      * Move httpclient to be part of OffchainWorkers to optimize block import
      
      * Fix compilation errors for tests
      
      * Add wrapper struct for HyperClient
      
      * Use lazy_static share SharedClient amongst OffchainWorkers. Remove the need to raise the fd limit
      
      * Revert "Use lazy_static share SharedClient amongst OffchainWorkers. Remove the need to raise the fd limit"
      
      This reverts commit 7af97498a2383b5d7405e27823db8fd97245da41.
      
      * Add lazy_static for tests
      ceb0fa63
    • Roman Borschel's avatar
      Avoid panic on dropping a `sc_network::service::out_events::Receiver`. (#6458) · 6aa8965f
      Roman Borschel authored
      * Avoid panic on dropping a `Receiver`.
      
      * CI
      6aa8965f
  12. Jun 22, 2020
  13. Jun 21, 2020
  14. Jun 19, 2020
    • Bastian Köcher's avatar
      Fix Babe secondary plain slots claiming (#6451) · 62ba0cc7
      Bastian Köcher authored
      We need to check that the public key of an authority exists in our
      keystore before we can successfully claim a plain secondary slot.
      62ba0cc7
    • Arkadiy Paronyan's avatar
      Validate encoding of extrinsics passed to runtime (#6442) · 7b344381
      Arkadiy Paronyan authored
      * Validate encoding of extrinsics passed to runtime
      
      * Bump codec version explicitly
      7b344381
    • Nikolay Volf's avatar
      add network propagated metrics (#6438) · 6e85555e
      Nikolay Volf authored
      6e85555e
    • Max Inden's avatar
      client/authority-discovery: Compare PeerIds and not Multihashes (#6414) · cbfbad6f
      Max Inden authored
      In order to tell whether an address is the local nodes address the
      authority discovery module previously compared the Multihash within the
      `p2p` Multiaddr protocol.
      
      rust-libp2p recently switched to a new PeerId representation (see [1]).
      Multihashes of the same PeerId in the new and the old format don't
      equal.
      
      Instead of comparing the Multihashes, this patch ensures the module
      compares the PeerIds
      
      [1] https://github.com/libp2p/rust-libp2p/issues/555
      cbfbad6f
    • Bastian Köcher's avatar
      Update sync chain info on own block import (#6424) · 7858828d
      Bastian Köcher authored
      Before we only updated the chain info of sync when we have imported
      something using the import queue. However, if you import your own
      blocks, this is not done using the import queue and so sync is not
      updated. If we don't do this, it can lead to sync switching to "major
      sync" mode because sync is not informed about new blocks. This
      especially happens on Cumulus, where a collator is selected multiple
      times to include its block into the relay chain and thus, sync switches
      to major sync mode while the node is still building blocks.
      7858828d
    • Cecile Tonglet's avatar
      More descriptive error message when invalid slot duration is used (#6430) · 2645659a
      Cecile Tonglet authored
      * Initial commit
      
      Forked at: 252416d3
      
      
      No parent branch.
      
      * Errors if slot_duration is zero
      
      * Errors if slot_duration is zero
      
      * Revert "Errors if slot_duration is zero"
      
      This reverts commit a9e9820e124571f73d3e498e969a74d01fd3fe96.
      
      * Update client/consensus/slots/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
      2645659a
    • Bastian Köcher's avatar
      Track last blocks in informant display (#6429) · 40e48684
      Bastian Köcher authored
      This implements tracking of the last seen blocks in informant display
      to prevent printing the import message twice. In Cumulus we first import
      blocks as part of the block building with `new_best == false` and set
      the best block after we know which one was included by the relay chain.
      This leads to printing the import messages two times. This pr solves the
      problem by track the latest seen blocks to not print the message twice.
      40e48684