Skip to content
  1. Feb 15, 2021
    • Sergey Pepyakin's avatar
      Mitigation of SIGBUS (#2440) · 5c68e6f9
      Sergey Pepyakin authored
      * Update shared-memory to new version & refactor
      
      This two are combined in a single commit because the new version of
      shared-memory doesn't provide the used functionality anymore.
      
      Therefore in order to update the version of this crate we implement the
      functionality that we need by ourselves, providing a cleaner API along
      the way.
      
      * Significantly decrease the required memory for a workspace
      
      For some reason it was allocating an entire GiB of memory. I suspect
      this has something to do with the current memory size limit of a PVF
      execution environment (the prior name suggests that). However, we don't
      need so much memory anywhere near that amount.
      
      In fact, we could reduce the allocated size even more, but that maybe
      for the next time.
      
      * Unlink shmem just after opening
      
      That will make sure that we don't leak the shmem accidentally.
      
      * Do not compile workspace mod for androind and wasm
      
      * Address some review comments
      
      * Fix the test runner
      
      * Fix missed +1 for the attached flag
      
      * Use .expect rather than .unwrap
      
      * Add a rustdoc for the workspace module
      
      * fixup! Use .expect rather than .unwrap
      
      * Add some doc comments to pub members
      
      * Warn on error removing shm_unlink
      
      * Change the alignment implementation
      
      * Fix the comment nit
      5c68e6f9
    • André Silva's avatar
      node: migrate grandpa voting rule to async api (#2422) · 4503346c
      André Silva authored
      
      
      * node: migrate grandpa voting rule to async api
      
      * node: fix grandpa voting rule tests
      
      * "Update Substrate"
      
      * update Substrate
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      4503346c
    • Bastian Köcher's avatar
      Polkadot companion for 8114 (#2437) · 22f85c80
      Bastian Köcher authored
      * Polkadot companion for 8114
      
      https://github.com/paritytech/substrate/pull/8114
      
      * "Update Substrate"
      
      Co-authored-by: parity-processbot <>
      22f85c80
    • Pierre Krieger's avatar
      Companion for substrate#8079 (#2408) · dc45c2d2
      Pierre Krieger authored
      * Companion for substrate#8079
      
      * More changes
      
      * "Update Substrate"
      
      Co-authored-by: parity-processbot <>
      dc45c2d2
  2. Feb 14, 2021
    • Bastian Köcher's avatar
      Notify collators about seconded collation (#2430) · 4975521d
      Bastian Köcher authored
      * Notify collators about seconded collation
      
      This pr adds functionality to inform a collator that its collation was
      seconded by a parachain validator. Before this signed statement was only
      gossiped over the validation substream. Now, we explicitly send the
      seconded statement to the collator after it was validated successfully.
      
      Besides that it changes the `CollatorFn` to return an optional result
      sender that is informed when the build collation was seconded by a
      parachain validator.
      
      * Add test
      
      * Make sure we only send `Seconded` statements
      
      * Make sure we only receive valid statements
      
      * Review feedback
      4975521d
  3. Feb 12, 2021
  4. Feb 11, 2021
    • asynchronous rob's avatar
      Implement Approval Voting Subsystem (#2112) · e48c6875
      asynchronous rob authored
      
      
      * skeleton
      
      * skeleton aux-schema module
      
      * start approval types
      
      * start aux schema with aux store
      
      * doc
      
      * finish basic types
      
      * start approval types
      
      * doc
      
      * finish basic types
      
      * write out schema types
      
      * add debug and codec impls to approval types
      
      * add debug and codec impls to approval types
      
      also add some key computation
      
      * add debug and codec impls to approval types
      
      * getters for block and candidate entries
      
      * grumbles
      
      * remove unused AssignmentId
      
      * load_decode utility
      
      * implement DB clearing
      
      * function for adding new block entry to aux store
      
      * start `canonicalize` implementation
      
      * more skeleton
      
      * finish implementing canonicalize
      
      * tag TODO
      
      * implement a test AuxStore
      
      * add allow(unused)
      
      * basic loading and deleting test
      
      * block_entry test function
      
      * add a test for `add_block_entry`
      
      * ensure range is exclusive at end
      
      * test clear()
      
      * test that add_block sets children
      
      * add a test for canonicalize
      
      * extract Pre-digest from header
      
      * utilities for extracting RelayVRFStory from the header-chain
      
      * add approval voting message types
      
      * approval distribution message type
      
      * subsystem skeleton
      
      * state struct
      
      * add futures-timer
      
      * prepare service for babe slot duration
      
      * more skeleton
      
      * better integrate AuxStore
      
      * RelayVRF -> RelayVRFStory
      
      * canonicalize
      
      * implement some tick functionality
      
      * guide: tweaks
      
      * check_approval
      
      * more tweaks and helpers
      
      * guide: add core index to candidate event
      
      * primitives: add core index to candidate event
      
      * runtime: add core index to candidate events
      
      * head handling (session window)
      
      * implement `determine_new_blocks`
      
      * add TODO
      
      * change error type on functions
      
      * compute RelayVRFModulo assignments
      
      * compute RelayVRFDelay assignments
      
      * fix delay tranche calc
      
      * assignment checking
      
      * pluralize
      
      * some dummy code for fetching assignments
      
      * guide: add babe epoch runtime API
      
      * implement a current_epoch() runtime API
      
      * compute assignments
      
      * candidate events get backing group
      
      * import blocks and assignments into DB
      
      * push block approval meta
      
      * add message types, no overseer integration yet
      
      * notify approval distribution of new blocks
      
      * refactor import into separate functions
      
      * impl tranches_to_approve
      
      * guide: improve function signatures
      
      * guide: remove Tick from ApprovalEntry
      
      * trigger and broadcast assignment
      
      * most of approval launching
      
      * remove byteorder crate
      
      * load blocks back to finality, except on startup
      
      * check unchecked assignments
      
      * add claimed core to approval voting message
      
      * fix checks
      
      * assign only to backing group
      
      * remove import_checked_assignment from guide
      
      * newline
      
      * import assignments
      
      * abstract out a bit
      
      * check and import approvals
      
      * check full approvals from assignment import too
      
      * comment
      
      * create a Transaction utility
      
      * must_use
      
      * use transaction in `check_full_approvals`
      
      * wire up wakeups
      
      * add Ord to CandidateHash
      
      * wakeup refactoring
      
      * return candidate info from add_block_entry
      
      * schedule wakeups
      
      * background task: do candidate validation
      
      * forward candidate validation requests
      
      * issue approval votes when requested
      
      * clean up a couple TODOs
      
      * fix up session caching
      
      * clean up last unimplemented!() items
      
      * fix remaining warnings
      
      * remove TODO
      
      * implement handle_approved_ancestor
      
      * update Cargo.lock
      
      * fix runtime API tests
      
      * guide: cleanup assignment checking
      
      * use claimed candidate index instead of core
      
      * extract time to a trait
      
      * tests module
      
      * write a mock clock for testing
      
      * allow swapping out the clock
      
      * make abstract over assignment criteria
      
      * add some skeleton tests and simplify params
      
      * fix backing group check
      
      * do backing group check inside check_assignment_cert
      
      * write some empty test functions to implement
      
      * add a test for non-backing
      
      * test that produced checks pass
      
      * some empty test ideas
      
      * runtime/inclusion: remove outdated TODO
      
      * fix compilation
      
      * av-store: fix tests
      
      * dummy cert
      
      * criteria tests
      
      * move `TestStore` to main tests file
      
      * fix unused warning
      
      * test harness beginnings
      
      * resolve slots renaming fallout
      
      * more compilation fixes
      
      * wip: extract pure data into a separate module
      
      * wip: extract pure data into a separate module
      
      * move types completely to v1
      
      * add persisted_entries
      
      * add conversion trait impls
      
      * clean up some warnings
      
      * extract import logic to own module
      
      * schedule wakeups
      
      * experiment with Actions
      
      * uncomment approval-checking
      
      * separate module for approval checking utilities
      
      * port more code to use actions
      
      * get approval pipeline using actions
      
      * all logic is uncommented
      
      * main loop processes actions
      
      * all loop logic uncommented
      
      * separate function for handling actions
      
      * remove last unimplemented item
      
      * clean up warnings
      
      * State gives read-only access to underlying DB
      
      * tests for approval checking
      
      * tests for approval criteria
      
      * skeleton test module for import
      
      * list of import tests to do
      
      * some test glue code
      
      * test reject bad assignment
      
      * test slot too far in future
      
      * test reject assignment with unknown candidate
      
      * remove loads_blocks tests
      
      * determine_new_blocks back to finalized & harness
      
      * more coverage for determining new blocks
      
      * make `imported_block_info` have less reliance on State
      
      * candidate_info tests
      
      * tests for session caching
      
      * remove println
      
      * extricate DB and main TestStores
      
      * rewrite approval checking logic to counteract early delays
      
      * move state out of function
      
      * update approval-checking tests
      
      * tweak wakeups & scheduling logic
      
      * rename check_full_approvals
      
      * test that assignment import updates candidate
      
      * some approval import tests
      
      * some tests for check_and_apply_approval
      
      * add 'full' qualifier to avoid confusion
      
      * extract should-trigger logic to separate function
      
      * some tests for all triggering
      
      * tests for when we trigger assignments
      
      * test wakeups
      
      * add block utilities for testing
      
      * some more tests for approval updates
      
      * approved_ancestor tests
      
      * new action type for launch approval
      
      * process-wakeup tests
      
      * clean up some warnings
      
      * fix in_future test
      
      * approval checking tests
      
      * tighten up too-far-in-future
      
      * special-case genesis when caching sessions
      
      * fix bitfield len
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      e48c6875
    • Sergey Pepyakin's avatar
      Introduce PerPeerSet utility that allows to segrate based on PeerSet (#2420) · 09eadfc9
      Sergey Pepyakin authored
      * Introduce PerPeerSet utility that allows to segrate based on PeerSet
      
      * Remove `repr(usize)` from PeerSet
      09eadfc9
  5. Feb 09, 2021
  6. Feb 08, 2021
    • ordian's avatar
      validator_discovery: pass PeerSet to the request (#2372) · 6981a1c3
      ordian authored
      
      
      * validator_discovery: pass PeerSet to the request
      
      * validator_discovery: track PeerSet of connected peers
      
      * validator_discovery: fix tests
      
      * validator_discovery: fix long line
      
      * some fixes
      
      * some validator_discovery logs
      
      * log validator discovery request
      
      * Also connect to validators on `DistributePoV`.
      
      * validator_discovery: store the whole state per peer_set
      
      * bump spec versions in kusama, polkadot and westend
      
      * Correcting doc.
      
      * validator_discovery: bump channel capacity
      
      * pov-distribution: some cleanup
      
      * this should fix the test, but it does not
      
      * I just got some brain damage while fixing this
      
      Why are you even reading this???
      
      * wrap long line
      
      * address some review nits
      
      Co-authored-by: default avatarRobert Klotzner <[email protected]>
      6981a1c3
  7. Feb 06, 2021
  8. Feb 04, 2021
  9. Feb 03, 2021
    • Robert Klotzner's avatar
      Generic request/response infrastructure for Polkadot (#2352) · 0cb1ccd1
      Robert Klotzner authored
      * Move NetworkBridgeEvent to subsystem::messages.
      
      It is not protocol related at all, it is in fact only part of the
      subsystem communication as it gets wrapped into messages of each
      subsystem.
      
      * Request/response infrastructure is taking shape.
      
      WIP: Does not compile.
      
      * Multiplexer variant not supported by Rusts type system.
      
      * request_response::request type checks.
      
      * Cleanup.
      
      * Minor fixes for request_response.
      
      * Implement request sending + move multiplexer.
      
      Request multiplexer is moved to bridge, as there the implementation is
      more straight forward as we can specialize on `AllMessages` for the
      multiplexing target.
      
      Sending of requests is mostly complete, apart from a few `From`
      instances. Receiving is also almost done, initializtion needs to be
      fixed and the multiplexer needs to be invoked.
      
      * Remove obsolete multiplexer.
      
      * Initialize bridge with multiplexer.
      
      * Finish generic request sending/receiving.
      
      Subsystems are now able to receive and send requests and responses via
      the overseer.
      
      * Doc update.
      
      * Fixes.
      
      * Link issue for not yet implemented code.
      
      * Fixes suggested by @ordian
      
       - thanks!
      
      - start encoding at 0
      - don't crash on zero protocols
      - don't panic on not yet implemented request handling
      
      * Update node/network/protocol/src/request_response/v1.rs
      
      Use index 0 instead of 1.
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      
      * Update node/network/protocol/src/request_response.rs
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      
      * Fix existing tests.
      
      * Better avoidance of division by zoro errors.
      
      * Doc fixes.
      
      * send_request -> start_request.
      
      * Fix missing renamings.
      
      * Update substrate.
      
      * Pass TryConnect instead of true.
      
      * Actually import `IfDisconnected`.
      
      * Fix wrong import.
      
      * Update node/network/bridge/src/lib.rs
      
      typo
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      * Update node/network/bridge/src/multiplexer.rs
      
      Remove redundant import.
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      * Stop doing tracing from within `From` instance.
      
      Thanks for the catch @tomaka
      
      !
      
      * Get rid of redundant import.
      
      * Formatting cleanup.
      
      * Fix tests.
      
      * Add link to issue.
      
      * Clarify comments some more.
      
      * Fix tests.
      
      * Formatting fix.
      
      * tabs
      
      * Fix link
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      
      * Use map_err.
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      
      * Improvements inspired by suggestions by @drahnr.
      
      - Channel size is now determined by function.
      - Explicitely scope NetworkService::start_request.
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      0cb1ccd1
    • Arkadiy Paronyan's avatar
      Companion for #7963 (IPFS server) (#2315) · c7db9ca5
      Arkadiy Paronyan authored
      * Add missing extrincis function
      
      * "Update Substrate"
      
      Co-authored-by: parity-processbot <>
      c7db9ca5
  10. Feb 02, 2021
    • Sergey Pepyakin's avatar
      Log unknown collator (#2367) · 8a0c8cc4
      Sergey Pepyakin authored
      8a0c8cc4
    • Sergey Pepyakin's avatar
      Clean up PersistedValidationData (#2353) · d4fdbf7d
      Sergey Pepyakin authored
      * PVD: `block_number`->`relay_parent_number`
      
      * ValidationParams: `relay_chain_height`->`relay_parent_number`
      
      * Expose DMQ MQC hash as a well-known-key
      
      This way the relay storage merkle proofs will be able to obtain the DMQ
      MQC hash and we will be able to remove the it from the
      PersistedValidationData struct.
      
      * PersistedValidationData: Remove HRMP MQC heads
      
      * PersistedValidationData: Remove `dmq_mqc_head`
      
      * Expose the HRMP ingress channel index as a well-known-key
      
      This way a parachain (PVF and collator) can find all the parachains that
      have an outbound channel to the given one. That allows in turn to find
      all the inbound channels for the given para.
      
      Having access to that allows the parachain to get the same information
      as the hrmp_mqc_heads now provide.
      
      * Rename `relay_storage_root` to `relay_parent_storage_root`
      d4fdbf7d
    • Bastian Köcher's avatar
      16b250d7
  11. Jan 29, 2021
  12. Jan 28, 2021
    • Bastian Köcher's avatar
      Companion for #7997 (#2345) · 7f019517
      Bastian Köcher authored
      
      
      * Companion for #7997
      
      https://github.com/paritytech/substrate/pull/7997
      
      * rename slot_number to slot
      
      * rename SlotNumber type in overseer docs
      
      * "Update Substrate"
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: parity-processbot <>
      7f019517
    • Peter Goodspeed-Niklaus's avatar
      misbehavior: report multiple offenses per validator as necessary (#2222) · 25cfb884
      Peter Goodspeed-Niklaus authored
      * use proper descriptive generic type names
      
      * cleanup
      
      * Table stores a list of detected misbehavior per authority
      
      * add Table::drain_misbehaviors_for
      
      * WIP: unify misbehavior types; report multiple misbehaviors per validator
      
      Code checks, but tests don't yet pass.
      
      * update drain_misbehaviors: return authority id as well as specific misbehavior
      
      * enable unchecked construction of Signed structs in tests
      
      * remove test-features feature & unnecessary generic
      
      * fix backing tests
      
      This took a while to figure out, because where we'd previously been
      passing around `SignedFullStatement`s, we now needed to construct
      those on the fly within the test, to take advantage of the signature-
      checking in the constructor. That, in turn, necessitated changing the
      iterable type of `drain_misbehaviors` to return the validator index,
      and passing that validator index along within the misbehavior report.
      
      Once that was sorted, however, it became relatively straightforward:
      just needed to add appropriate methods to deconstruct the misbehavior
      reports, and then we could construct the signed statements directly.
      
      * fix bad merge
      25cfb884
    • dependabot[bot]'s avatar
      Bump serde from 1.0.121 to 1.0.123 (#2339) · e3504ee7
      dependabot[bot] authored
      
      
      Bumps [serde](https://github.com/serde-rs/serde) from 1.0.121 to 1.0.123.
      - [Release notes](https://github.com/serde-rs/serde/releases)
      - [Commits](https://github.com/serde-rs/serde/compare/v1.0.121...v1.0.123)
      
      Signed-off-by: default avatardependabot[bot] <[email protected]>
      
      Co-authored-by: default avatardependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
      e3504ee7
  13. Jan 27, 2021
  14. Jan 26, 2021
  15. Jan 25, 2021
    • ordian's avatar
      impl approval distribution (#2160) · 3f1e1a6f
      ordian authored
      * initial impl approval distribution
      
      * initial tests and fixes
      
      * batching seems difficult: different peers have different needs
      
      * bridge: fix test after merge
      
      * some guide updates
      
      * only send assignments to peers who know about the block
      
      * fix a test, add approvals test
      
      * simplify
      
      * do not send assignment to peers for finalized blocks
      
      * guide: protocol input and output
      
      * one more test
      
      * more comments, logs, initial metrics
      
      * fix a typo
      
      * one more thing: early return when reimporting a thing locally
      3f1e1a6f
    • Bastian Köcher's avatar
      Add a `convert_payload` function to `Signed` (#2320) · fa6e4b44
      Bastian Köcher authored
      * Add a `convert_payload` function to `Signed`
      
      * Review feedback
      fa6e4b44
    • Will Pankiewicz's avatar
      Remove Old Bootnodes (#2319) · b210850d
      Will Pankiewicz authored
      * removes old bootnodes from kusama chainspec
      
      * removes old bootnodes from polkadot chainspec
      b210850d
    • Bastian Köcher's avatar
      Put parachain head hash into `CandidateDescriptor` (#2310) · 9563652b
      Bastian Köcher authored
      * Put parachain head hash into `CandidateDescriptor`
      
      * Update guide
      
      * Add some checks
      9563652b
  16. Jan 21, 2021