1. Dec 25, 2020
  2. Dec 18, 2020
  3. Dec 17, 2020
  4. Dec 11, 2020
  5. Dec 07, 2020
  6. Dec 04, 2020
    • Sergey Pepyakin's avatar
    • Peter Goodspeed-Niklaus's avatar
      do not store backed candidates in the provisioner (#1909) · 113ae827
      Peter Goodspeed-Niklaus authored
      * guide: non-semantic changes
      
      * guide: update per the issue description
      
      * GetBackedCandidates operates on multiple hashes now
      
      * GetBackedCandidates still needs a relay parent
      
      * implement changes specified in guide
      
      * distinguish between various occasions for canceled oneshots
      
      * add tracing info to getbackedcandidates
      
      * REVERT ME: add tracing messages for GetBackedCandidates
      
      Note that these messages are only sometimes actually passed on to the
      candidate backing subsystem, with the consequence that it is
      unexpectedly frequent that the provisioner fails to create its
      provisionable data.
      
      * REVERT ME: more tracing logging
      
      * REVERT ME: log when CandidateBackingJob receives any message at all
      
      * REVERT ME: log when send_msg sends a message to a job
      
      * fix candidate-backing tests
      
      * streamline GetBackedCandidates
      
      This uses table.attested_candidate instead of table.get_candidate, because
      it's not obvious how to get a BackedCandidate from just a
      CommittedCandidateReceipt.
      
      * REVERT ME: more logging tracing job lifespans
      
      * promote warning about job premature demise
      
      * don't terminate CandiateBackingJob::run_loop in event of failure to process message
      
      * Revert "REVERT ME: more logging tracing job lifespans"
      
      This reverts commit 7365f2fb.
      
      * Revert "REVERT ME: log when send_msg sends a message to a job"
      
      This reverts commit 58e46aad.
      
      * Revert "REVERT ME: log when CandidateBackingJob receives any message at all"
      
      This reverts commit 0d6f3841.
      
      * Revert "REVERT ME: more tracing logging"
      
      This reverts commit 675fd262.
      
      * Revert "REVERT ME: add tracing messages for GetBackedCandidates"
      
      This reverts commit e09e1564.
      
      * formatting
      
      * add logging message to CandidateBackingJob::run_loop start
      
      * REVERT ME: add tracing to candidate-backing job creation
      
      * run candidatebacking loop even if no assignment
      
      * use unique error variants for each canceled oneshot
      
      * Revert "REVERT ME: add tracing to candidate-backing job creation"
      
      This reverts commit 8ce5f4f0.
      
      * try_runtime_api more to reduce silent exits
      
      * add sanity check that returned backed candidates preserve ordering
      
      * remove redundant err attribute
      113ae827
  7. Dec 02, 2020
  8. Nov 30, 2020
    • asynchronous rob's avatar
      Move candidate validation to the background (#2028) · 1e0c9910
      asynchronous rob authored
      * refactor some functions to not rely on `self`
      
      * factor out common elements of seconding and attesting
      
      * Add Spawn to backing FromJob
      
      * do candidate validation in background
      
      * tests
      
      * address grumbles
      1e0c9910
    • Bastian Köcher's avatar
      Simplify subsystem jobs (#2037) · 1fbf09ac
      Bastian Köcher authored
      * Simplify subsystem jobs
      
      This pr simplifies the subsystem jobs interface. Instead of requiring an
      extra message that is used to signal that a job should be ended, a job
      now ends when the receiver returns `None`. Besides that it changes the
      interface to enforce that messages to a job provide a relay parent.
      
      * Drop ToJobTrait
      
      * Remove FromJob
      
      We always convert this message to FromJobCommand anyway.
      1fbf09ac
  9. Nov 28, 2020
  10. Nov 27, 2020
    • asynchronous rob's avatar
      Move erasure root out of candidate commitments and into descriptor (#2010) · fff46359
      asynchronous rob authored
      
      
      * guide: move erasure-root to candidate descriptor
      
      * primitives: move erasure root to descriptor
      
      * guide: unify candidate commitments and validation outputs
      
      * primitives: unify validation outputs and candidate commitments
      
      * parachains-runtime: fix fallout
      
      * runtimes: fix fallout
      
      * collation generation: fix fallout
      
      * fix stray reference in primitives
      
      * fix fallout in node-primitives
      
      * fix remaining fallout in collation generation
      
      * fix fallout in candidate validation
      
      * fix fallout in runtime API subsystem
      
      * fix fallout in subsystem messages
      
      * fix fallout in candidate backing
      
      * fix fallout in availability distribution
      
      * don't clone
      
      * clone
      
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      fff46359
  11. Nov 24, 2020
  12. Nov 20, 2020
    • Peter Goodspeed-Niklaus's avatar
      Add Prometheus timers to the subsystems (#1923) · e655654e
      Peter Goodspeed-Niklaus authored
      * reexport prometheus-super for ease of use of other subsystems
      
      * add some prometheus timers for collation generation subsystem
      
      * add timing metrics to av-store
      
      * add metrics to candidate backing
      
      * add timing metric to bitfield signing
      
      * add timing metrics to candidate selection
      
      * add timing metrics to candidate-validation
      
      * add timing metrics to chain-api
      
      * add timing metrics to provisioner
      
      * add timing metrics to runtime-api
      
      * add timing metrics to availability-distribution
      
      * add timing metrics to bitfield-distribution
      
      * add timing metrics to collator protocol: collator side
      
      * add timing metrics to collator protocol: validator side
      
      * fix candidate validation test failures
      
      * add timing metrics to pov distribution
      
      * add timing metrics to statement-distribution
      
      * use substrate_prometheus_endpoint prometheus reexport instead of prometheus_super
      
      * don't include JOB_DELAY in bitfield-signing metrics
      
      * give adder-collator ability to easily export its genesis-state and validation code
      
      * wip: adder-collator pushbutton script
      
      * don't attempt to register the adder-collator automatically
      
      Instead, get these values with
      
      ```sh
      target/release/adder-collator export-genesis-state
      target/release/adder-collator export-genesis-wasm
      ```
      
      And then register the parachain on https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer
      
      To collect prometheus data, after running the script, create `prometheus.yml` per the instructions
      at https://www.notion.so/paritytechnologies/Setting-up-Prometheus-locally-835cb3a9df7541a781c381006252b5ff
      
      
      and then run:
      
      ```sh
      docker run -v `pwd`/prometheus.yml:/etc/prometheus/prometheus.yml:z --network host prom/prometheus
      ```
      
      Demonstrates that data makes it across to prometheus, though it is likely to be useful in the future
      to tweak the buckets.
      
      * Update parachain/test-parachains/adder/collator/src/cli.rs
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      
      * use the grandpa-pause parameter
      
      * skip metrics in tracing instrumentation
      
      * remove unnecessary grandpa_pause cli param
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      e655654e
    • Peter Goodspeed-Niklaus's avatar
      Add tracing support to node (#1940) · f7ea3d07
      Peter Goodspeed-Niklaus authored
      * drop in tracing to replace log
      
      * add structured logging to trace messages
      
      * add structured logging to debug messages
      
      * add structured logging to info messages
      
      * add structured logging to warn messages
      
      * add structured logging to error messages
      
      * normalize spacing and Display vs Debug
      
      * add instrumentation to the various 'fn run'
      
      * use explicit tracing module throughout
      
      * fix availability distribution test
      
      * don't double-print errors
      
      * remove further redundancy from logs
      
      * fix test errors
      
      * fix more test errors
      
      * remove unused kv_log_macro
      
      * fix unused variable
      
      * add tracing spans to collation generation
      
      * add tracing spans to av-store
      
      * add tracing spans to backing
      
      * add tracing spans to bitfield-signing
      
      * add tracing spans to candidate-selection
      
      * add tracing spans to candidate-validation
      
      * add tracing spans to chain-api
      
      * add tracing spans to provisioner
      
      * add tracing spans to runtime-api
      
      * add tracing spans to availability-distribution
      
      * add tracing spans to bitfield-distribution
      
      * add tracing spans to network-bridge
      
      * add tracing spans to collator-protocol
      
      * add tracing spans to pov-distribution
      
      * add tracing spans to statement-distribution
      
      * add tracing spans to overseer
      
      * cleanup
      f7ea3d07
  13. Nov 19, 2020
  14. Nov 17, 2020
    • ordian's avatar
      update most of the dependencies (#1946) · 31fb8fed
      ordian authored
      * update tiny-keccak to 0.2
      
      * update deps except bitvec and shared_memory
      
      * fix some warning after futures upgrade
      
      * remove useless package rename caused by bug in cargo-upgrade
      
      * revert parity-util-mem *
      
      * remove unused import
      
      * cargo update
      
      * remove all renames on parity-scale-codec
      
      * remove the leftovers
      
      * remove unused dep
      31fb8fed
  15. Nov 06, 2020
    • Sergey Pepyakin's avatar
      Implement HRMP (#1900) · 73553661
      Sergey Pepyakin authored
      * HRMP: Update the impl guide
      
      * HRMP: Incorporate the channel notifications into the guide
      
      * HRMP: Renaming in the impl guide
      
      * HRMP: Constrain the maximum number of HRMP messages per candidate
      
      This commit addresses the HRMP part of https://github.com/paritytech/polkadot/issues/1869
      
      
      
      * XCM: Introduce HRMP related message types
      
      * HRMP: Data structures and plumbing
      
      * HRMP: Configuration
      
      * HRMP: Data layout
      
      * HRMP: Acceptance & Enactment
      
      * HRMP: Test base logic
      
      * Update adder collator
      
      * HRMP: Runtime API for accessing inbound messages
      
      Also, removing some redundant fully-qualified names.
      
      * HRMP: Add diagnostic logging in acceptance criteria
      
      * HRMP: Additional tests
      
      * Self-review fixes
      
      * save test refactorings for the next time
      
      * Missed a return statement.
      
      * a formatting blip
      
      * Add missing logic for appending HRMP digests
      
      * Remove the channel contents vectors which became empty
      
      * Tighten HRMP channel digests invariants.
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      
      * Remove a note about sorting for channel id
      
      * Add missing rustdocs to the configuration
      
      * Clarify and update the invariant for HrmpChannelDigests
      
      * Make the onboarding invariant less sloppy
      
      Namely, introduce `Paras::is_valid_para` (in fact, it already is present
      in the implementation) and hook up the invariant to that.
      
      Note that this says "within a session" because I don't want to make it
      super strict on the session boundary. The logic on the session boundary
      should be extremely careful.
      
      * Make `CandidateCheckContext` use T::BlockNumber for hrmp_watermark
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      73553661
    • Bastian Köcher's avatar
      Distribute a PoV after seconding it (#1924) · 3a3aace3
      Bastian Köcher authored
      We need to distribute the PoV after we have seconded it. Other nodes
      that will receive our `Secondded` statement and want to validate the
      candidate another time will request this PoV from us.
      3a3aace3
  16. Nov 05, 2020
    • Bastian Köcher's avatar
      Make `CandidateHash` a real type (#1916) · 76720173
      Bastian Köcher authored
      
      
      * Make `CandidateHash` a real type
      
      This pr adds a new type `CandidateHash` that is used instead of the
      opaque `Hash` type. This helps to ensure on the type system level that
      we are passing the correct types.
      
      This pr also fixes wrong usage of `relay_parent` as `candidate_hash`
      when communicating with the av storage.
      
      * Update core-primitives/src/lib.rs
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      
      * Wrap the lines
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      76720173
    • ordian's avatar
      more resilient subsystems (#1908) · 9758a180
      ordian authored
      * backing: extract log target
      
      * bitfield-signing: extract log target
      
      * utils: fix a typo
      
      * provisioner: extract log target
      
      * candidate selection: remove unused error variant
      
      * bitfield-distribution: change the return type of run
      
      * pov-distribution: extract log target
      
      * collator-protocol: simplify runtime request
      
      * collation-generation: do not exit early on error
      
      * collation-generation: do not exit on double init
      
      * collator-protocol: do not exit on errors and rename LOG_TARGET
      
      * collator-protocol: a workaround for ununused imports warning
      
      * Update node/network/bitfield-distribution/src/lib.rs
      
      * collation-generation: elevate warn! to error!
      
      * collator-protocol: fix imports
      
      * post merge fix
      
      * fix compilation
      9758a180
  17. Nov 03, 2020
  18. Nov 02, 2020
  19. Oct 28, 2020
    • Sergey Pepyakin's avatar
      let go fees (#1867) · 11df6f86
      Sergey Pepyakin authored
      11df6f86
    • Sergey Pepyakin's avatar
      Downward Message Processing implementation (#1859) · ed759c75
      Sergey Pepyakin authored
      * DMP: data structures and plumbing
      
      * DMP: Implement DMP logic in the router module
      
      DMP: Integrate DMP parts into the inclusion module
      
      * DMP: Introduce the max size limit for the size of a downward message
      
      * DMP: Runtime API for accessing inbound messages
      
      * OCD
      
      Small clean ups
      
      * DMP: fix the naming of the error
      
      * DMP: add caution about a non-existent recipient
      ed759c75
  20. Oct 27, 2020
  21. Oct 24, 2020
    • Sergey Pepyakin's avatar
      Runtime API for checking validation outputs (#1842) · 4a17a2bc
      Sergey Pepyakin authored
      * annoying whitespaces
      
      * update guide
      
      Add `CheckValidationOutputs` runtime api and also change the
      candidate-validation stuff
      
      * promote ValidationOutputs to global primitives
      
      i.e. move it from node specific primitives to global v1 primitives. This
      will be needed when we share it later in the runtime inclusion module
      
      * refactor acceptance checks in the inclusion module
      
      factor out the common code to share it during the block inclusion and
      for the forthcoming CheckValidationOutputs runtime api.
      
      Also note that the acceptance criteria was updated to incorporate checks
      that exist now in candidate-validation
      
      * plumb the runtime api outside
      
      * extract validation_data from ValidationOutputs
      
      * use runtime-api to check validation outputs
      
      apart from that refactor, update docs and tidy a bit
      
      * Update the maxium code size
      
      This is to fix a test that performs an upgrade.
      4a17a2bc
  22. Oct 09, 2020
    • Rakan Alhneiti's avatar
      Update to work with async keystore – Companion PR for #7000 (#1740) · bc7d1322
      Rakan Alhneiti authored
      
      
      * Fix keystore types
      
      * Use SyncCryptoStorePtr
      
      * Borrow keystore
      
      * Fix unused imports
      
      * Fix polkadot service
      
      * Fix bitfield-distribution tests
      
      * Fix indentation
      
      * Fix backing tests
      
      * Fix tests
      
      * Fix provisioner tests
      
      * Removed SyncCryptoStorePtr
      
      * Fix services
      
      * Address PR feedback
      
      * Address PR feedback - 2
      
      * Update CryptoStorePtr imports to be from sp_keystore
      
      * Typo
      
      * Fix CryptoStore import
      
      * Document the reason behind using filesystem keystore
      
      * Remove VALIDATORS
      
      * Fix duplicate dependency
      
      * Mark sp-keystore as optional
      
      * Fix availability distribution
      
      * Fix call to sign_with
      
      * Fix keystore usage
      
      * Remove tokio and fix parachains Cargo config
      
      * Typos
      
      * Fix keystore dereferencing
      
      * Fix CryptoStore import
      
      * Fix provisioner
      
      * Fix node backing
      
      * Update services
      
      * Cleanup dependencies
      
      * Use sync_keystore
      
      * Fix node service
      
      * Fix node service - 2
      
      * Fix node service - 3
      
      * Rename CryptoStorePtr to SyncCryptoStorePtr
      
      * "Update Substrate"
      
      * Apply suggestions from code review
      
      * Update node/core/backing/Cargo.toml
      
      * Update primitives/src/v0.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Fix wasm build
      
      * Update Cargo.lock
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      bc7d1322
  23. Sep 29, 2020
  24. Aug 19, 2020
  25. Aug 18, 2020
    • asynchronous rob's avatar
      Implement validation data refactor (#1585) · 8c881e45
      asynchronous rob authored
      
      
      * update primitives
      
      * correct parent_head field
      
      * make hrmp field pub
      
      * refactor validation data: runtime
      
      * refactor validation data: messages
      
      * add arguments to full_validation_data runtime API
      
      * port runtime API
      
      * mostly port over candidate validation
      
      * remove some parameters from ValidationParams
      
      * guide: update candidate validation
      
      * update candidate outputs
      
      * update ValidationOutputs in primitives
      
      * port over candidate validation
      
      * add a new test for no-transient behavior
      
      * update util runtime API wrappers
      
      * candidate backing
      
      * fix missing imports
      
      * change some fields of validation data around
      
      * runtime API impl
      
      * update candidate validation
      
      * fix backing tests
      
      * grumbles from review
      
      * fix av-store tests
      
      * fix some more crates
      
      * fix provisioner tests
      
      * fix availability distribution tests
      
      * port collation-generation to new validation data
      
      * fix overseer tests
      
      * Update roadmap/implementers-guide/src/node/utility/candidate-validation.md
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      
      Co-authored-by: default avatarPeter Goodspeed-Niklaus <[email protected]>
      8c881e45
    • ordian's avatar
      initial prometheus metrics (#1536) · 804958ab
      ordian authored
      * service-new: cosmetic changes
      
      * overseer: draft of prometheus metrics
      
      * metrics: update active_leaves metrics
      
      * metrics: extract into functions
      
      * metrics: resolve XXX
      
      * metrics: it's ugly, but it works
      
      * Bump Substrate
      
      * metrics: move a bunch of code around
      
      * Bumb substrate again
      
      * metrics: fix a warning
      
      * fix a warning in runtime
      
      * metrics: statements signed
      
      * metrics: statements impl RegisterMetrics
      
      * metrics: refactor Metrics trait
      
      * metrics: add Metrics assoc type to JobTrait
      
      * metrics: move Metrics trait to util
      
      * metrics: fix overseer
      
      * metrics: fix backing
      
      * metrics: fix candidate validation
      
      * metrics: derive Default
      
      * metrics: docs
      
      * metrics: add stubs for other subsystems
      
      * metrics: add more stubs and fix compilation
      
      * metrics: fix doctest
      
      * metrics: move to subsystem
      
      * metrics: fix candidate validation
      
      * metrics: bitfield signing
      
      * metrics: av store
      
      * metrics: chain API
      
      * metrics: runtime API
      
      * metrics: stub for avad
      
      * metrics: candidates seconded
      
      * metrics: ok I gave up
      
      * metrics: provisioner
      
      * metrics: remove a clone by requiring Metrics: Sync
      
      * metrics: YAGNI
      
      * metrics: remove another TODO
      
      * metrics: for later
      
      * metrics: add parachain_ prefix
      
      * metrics: s/signed_statement/signed_statements
      
      * utils: add a comment for job metrics
      
      * metrics: address review comments
      
      * metrics: oops
      
      * metrics: make sure to save files before commit 😅
      
      
      
      * use _total suffix for requests metrics
      
      Co-authored-by: default avatarMax Inden <[email protected]>
      
      * metrics: add tests for overseer
      
      * update Cargo.lock
      
      * overseer: add a test for CollationGeneration
      
      * collation-generation: impl metrics
      
      * collation-generation: use kebab-case for name
      
      * collation-generation: add a constructor
      
      Co-authored-by: default avatarGav Wood <[email protected]>
      Co-authored-by: default avatarAshley Ruglys <[email protected]>
      Co-authored-by: default avatarMax Inden <[email protected]>
      804958ab
  26. Aug 07, 2020
  27. Aug 06, 2020
    • Peter Goodspeed-Niklaus's avatar
      implement provisioner (#1473) · a39d8803
      Peter Goodspeed-Niklaus authored
      * sketch out provisioner basics
      
      * handle provisionable data
      
      * stub out select_inherent_data
      
      * split runtime APIs into sub-chapters to improve linkability
      
      * explain SignedAvailabilityBitfield semantics
      
      * add internal link to further documentation
      
      * some more work figuring out how the provisioner can do its thing
      
      * fix broken link
      
      * don't import enum variants where it's one layer deep
      
      * make request_availability_cores a free fn in util
      
      * document more precisely what should happen on block production
      
      * finish first-draft implementation of provisioner
      
      * start working on the full and proper backed candidate selection rule
      
      * Pass number of block under construction via RequestInherentData
      
      * Revert "Pass number of block under construction via RequestInherentData"
      
      This reverts commit 850fe62c.
      
      That initially looked like the better approach--it spent the time
      budget for fetching the block number in the proposer, instead of
      the provisioner, and that felt more appropriate--but it turns out
      not to be obvious how to get the block number of the block under
      construction from within the proposer. The Chain API may be less
      ideal, but it should be easier to implement.
      
      * wip: get the block under production from the Chain API
      
      * add ChainApiMessage to AllMessages
      
      * don't break the run loop if a provisionable data channel closes
      
      * clone only those backed candidates which are coherent
      
      * propagate chain_api subsystem through various locations
      
      * add delegated_subsystem! macro to ease delegating subsystems
      
      Unfortunately, it doesn't work right:
      
      ```
      error[E0446]: private type `CandidateBackingJob` in public interface
         --> node/core/backing/src/lib.rs:775:1
          |
      86  | struct CandidateBackingJob {
          | - `CandidateBackingJob` declared as private
      ...
      775 | delegated_subsystem!(CandidateBackingJob as CandidateBackingSubsystem);
          | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
      ```
      
      I'm not sure precisely what's going wrong, here; I suspect the problem is
      the use of `$job as JobTrait>::RunArgs` and `::ToJob`; the failure would be
      that it's not reifying the types to verify that the actual types are public,
      but instead referring to them via `CandidateBackingJob`, which is in fact private;
      that privacy is the point.
      
      Going to see if I can generic my way out of this, but we may be headed for a
      quick revert here.
      
      * fix delegated_subsystem
      
      The invocation is a bit more verbose than I'd prefer, but it's also
      more explicit about what types need to be public. I'll take it as a win.
      
      * add provisioning subsystem; reduce public interface of provisioner
      
      * deny missing docs in provisioner
      
      * refactor core selection per code review suggestion
      
      This is twice as much code when measured by line, but IMO it is
      in fact somewhat clearer to read, so overall a win.
      
      Also adds an improved rule for selecting availability bitfields,
      which (unlike the previous implementation) guarantees that the
      appropriate postconditions hold there.
      
      * fix bad merge double-declaration
      
      * update guide with (hopefully) complete provisioner candidate selection procedure
      
      * clarify candidate selection algorithm
      
      * Revert "clarify candidate selection algorithm"
      
      This reverts commit c68a02ac.
      
      * clarify candidate selection algorithm
      
      * update provisioner to implement candidate selection per the guide
      
      * add test that no more than one bitfield is selected per validator
      
      * add test that each selected bitfield corresponds to an occupied core
      
      * add test that more set bits win conflicts
      
      * add macro for specializing runtime requests; specailize all runtime requests
      
      * add tests harness for select_candidates tests
      
      * add first real select_candidates test, fix test_harness
      
      * add mock overseer and test that success is possible
      
      * add test that the candidate selection algorithm picks the right ones
      
      * make candidate selection test somewhat more stringent
      a39d8803
  28. Aug 03, 2020