Skip to content
  1. Mar 30, 2021
  2. Mar 27, 2021
  3. Mar 17, 2021
    • Bastian Köcher's avatar
      Aura and Slots refactoring (#8386) · 15e15e7d
      Bastian Köcher authored
      * Make slot duration being exposed as `Duration` to the outside
      
      * Some slot info love
      
      * Add `build_aura_worker` utility function
      
      * Copy copy copy
      15e15e7d
    • Jon Häggblad's avatar
      Storing multiple Justifications per block (#7640) · 0d6884b9
      Jon Häggblad authored
      
      
      * primitives/runtime: initial changes on supporting multiple Justifications
      
      * primitives/runtime: make Justifications strongly typed
      
      * Encode/decode Justifications
      
      * primitives/runtime: add Justification type
      
      * backend: apply_finality and finalize_block takes a single Justification
      
      * manual-seal: create engine id and let rpc take encoded justification
      
      * backend: skeleton functions for appending justifications
      
      * backend: initial implementation append_justification
      
      Initial implementation of append_justification on the Backend trait, and also remove unused skeleton
      functions for append_justificaton on Finaziler trait.
      k
      
      * backend: guard against duplicate consensus engine id
      
      * client/db: add check for block finality
      
      * client/api: add append_justification to in_mem db
      
      * client/light: add no-op append_justification
      
      * network: fix decode call for Justification
      
      * network: only send a single Justification in BlockData
      
      * network: minor comment update
      
      * protocol: update field names to distinguish single justification
      
      * client: further field renames to plural
      
      * client: update function names to plural justifications
      
      * client/db: upgrade existing database for new format
      
      * network: remove dependency on grandpa crate
      
      * db: fix check for finalized block
      
      * grandpa: check for multiple grandpa justifications hwne importing
      
      * backend: update Finalizer trait to take multiple Justifications
      
      * db: remove debugging statements in migration code
      
      * manual-seal: update note about engine id
      
      * db: fix check for finalized block
      
      * client: update variable name to reflect it is now plural
      
      * grandpa: fix incorrect empty Justications in test
      
      * primitives: make Justifications opaque to avoid being empty
      
      * network: fix detecting empty Justification
      
      * runtime: doc strings for Justifications functions
      
      * runtime: add into_justifications
      
      * primitives: check for duplicates in when adding to Justifications
      
      * network/test: use real grandpa engine id in test
      
      * client: fix reviewer comments
      
      * primitives: rename Justifications::push to append
      
      * backend: revert changes to Finalizer trait
      
      * backend: revert mark_finalized
      
      * backend: revert changes to finalize_block
      
      * backend: revert finalized_blocks
      
      * db: add a quick early return for performance
      
      * client: minor reviewer comments
      
      * service/test: use local ConsensusEngineId
      
      * network: add link to issue for sending multiple Justifications
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      * network: tweaks to review suggestions
      
      * network: revert change to BlockData for backwards compatibility
      
      * Apply suggestion from code review
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * primitives: update doc comment for Justifications
      
      * client/db/upgrade: avoid grandpa crate dependency
      
      * consensus: revert to single Justification for import_justification
      
      * primitives: improve justifications docs
      
      * style cleanups
      
      * use and_then
      
      * client: rename JUSTIFICATIONS db column
      
      * network: revert to using FRNK in network-test
      
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      0d6884b9
  4. Mar 11, 2021
  5. Mar 10, 2021
    • Ashley's avatar
      Return babe configuration information in the babe api epoch functions (#8072) · 7ace5e21
      Ashley authored
      
      
      * Make changes
      
      * Add serialize/deserialize, copy babe epoch config defaults from node runtime
      
      * Fix line widths and turn default features off for serde
      
      * Remove ser/deser from Epoch, fix node-cli
      
      * Apply suggestions
      
      * Add comment to BABE_GENESIS_EPOCH_CONFIG in bin
      
      * Apply suggestions
      
      * Add a sketchy migration function
      
      * Add a migration test
      
      * Check for PendingEpochConfigChange as well
      
      * Make epoch_config in node-cli
      
      * Move updating EpochConfig out of the if
      
      * Fix executor tests
      
      * Calculate weight for add_epoch_configurations
      
      * Fix babe test
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Add more asserts to tests, remove unused changes to primitives/slots
      
      * Allow setting the migration pallet prefix
      
      * Rename to BabePalletPrefix
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      7ace5e21
  6. Mar 09, 2021
    • Bastian Köcher's avatar
      Introduce new concept of "slot portion for proposing" (#8280) · 7599e0d6
      Bastian Köcher authored
      * Introduce new concept of "slot portion for proposing"
      
      Currently when building a block we actually give the proposer all of the
      time in the slot, while this is wrong. The slot is actually split in at
      least two phases proposing and propagation or in the polkadot case into
      three phases validating pov's, proposing and propagation. As we don't
      want to bring that much polkadot concepts into Substrate, we only
      support splitting the slot into proposing and propagation. The portion
      can now be passed as parameter to AuRa and BABE to configure this value.
      However, this slot portion for propagation doesn't mean that the
      proposer can not go over this limit. When we miss slots we still apply
      the lenience factor to increase the proposing time, so that we have
      enough time to build a heavy block.
      
      Besides all what was said above, this is especially required for
      parachains. Parachains have a much more constraint proposing window.
      Currently the slot duration is at minimum 12 seconds, but we only have
      around 500ms for proposing. So, this slot portion for proposing is
      really required to make it working without hacks.
      
      * Offgit feedback
      
      * Cast cast cast
      7599e0d6
    • Liu-Cheng Xu's avatar
      Simplify the code a little bit (#8295) · ed7e4853
      Liu-Cheng Xu authored
      ed7e4853
  7. Mar 05, 2021
    • Bastian Köcher's avatar
      AuRa improvements (#8255) · 1680422f
      Bastian Köcher authored
      
      
      * AuRa improvements
      
      Hot and fresh AuRa improvements. This pr does the following:
      
      - Move code belonging to the import queue etc to import_queue.rs
      - Introduce `ImportQueueParams` and `StartAuraParams` structs to make
      it more easier to understand what parameters we pass to AuRa.
      - Introduce `CheckForEquivocation` to tell AuRa if it should check for
      equivocation on block import. This is required for parachains, because
      they are allowed to equivocate when they build two blocks for the same
      slot, but for different relay chain parents.
      
      * Update client/consensus/aura/src/import_queue.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Fix compilation
      
      * AAA
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      1680422f
  8. Mar 04, 2021
  9. Mar 03, 2021
  10. Feb 24, 2021
  11. Feb 22, 2021
  12. Feb 19, 2021
    • Bastian Köcher's avatar
      Ensure we spawn the block import worker as an essential task (#8155) · 821e018d
      Bastian Köcher authored
      * Ensure we spawn the block import worker as an essential task
      
      This pr ensures that we spawn the block import worker as an essential
      task. This is quite important as we need to bring down the node when the
      block import is done. Besides that it adds some debug output to the
      block import worker.
      
      * Don't be stupid :D
      821e018d
  13. Feb 18, 2021
  14. Feb 15, 2021
  15. Feb 10, 2021
  16. Feb 04, 2021
  17. Jan 29, 2021
  18. Jan 28, 2021
    • Bastian Köcher's avatar
      Introduce a `Slot` type (#7997) · b6294418
      Bastian Köcher authored
      
      
      * Introduce a `Slot` type
      
      Instead of having some type definition that only was used in half of the
      code or directly using `u64`, this adds a new unit type wrapper `Slot`.
      This makes it especially easy for the outside api to know what type is
      expected/returned.
      
      * Change epoch duratioC
      
      * rename all instances of slot number to slot
      
      * Make the constructor private
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      b6294418
  19. Jan 18, 2021
  20. Jan 12, 2021
  21. Jan 11, 2021
  22. Jan 08, 2021
  23. Jan 06, 2021
    • ordian's avatar
      upgrade a few dependencies (#7831) · 2b48e09b
      ordian authored
      * upgrade a few dependencies
      
      * make it compile at the expense of duplicate deps
      
      * fix web-wasm and a warning
      
      * introduce activate-wasm-bindgen-features crate
      
      * Revert "introduce activate-wasm-bindgen-features crate"
      
      This reverts commit 5a6e41e683f8a4844c0a735dcd08caabb2313f11.
      
      * add getrandom feature to sc-consensus-aura
      2b48e09b
  24. Jan 05, 2021
  25. Jan 04, 2021
    • Bastian Köcher's avatar
      Happy new year (#7814) · e3e651f7
      Bastian Köcher authored
      * Happy new year
      
      Updates the copyright years and fixes wrong license headers.
      
      * Fix the template
      
      * Split HEADER into HEADER-APACHE & HEADER-GPL
      e3e651f7
  26. Dec 28, 2020
  27. Dec 17, 2020
  28. Nov 30, 2020
    • Bernhard Schuster's avatar
      resolve unresolved error nits of #7617 (#7631) · 4ccf6672
      Bernhard Schuster authored
      
      
      * handle executor should_panic test better
      
      * Revert "reduce should panic, due to extended error messages"
      
      This reverts commit c0805940184a62cd9302603ad911c3591e70a60c.
      
      * remove excessive constraints
      
      * remove duplicate documentation messages for error variants
      
      * reduce T: constraints to the abs minimum
      
      * whoops
      
      * fewer bounds again
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      4ccf6672
  29. Nov 27, 2020
  30. Nov 23, 2020
  31. Nov 11, 2020
    • Jon Häggblad's avatar
      slots: incrementally backoff claiming slots if finality lags behind (#7186) · 7cf78c16
      Jon Häggblad authored
      
      
      * babe: backoff authoring blocks when finality lags
      
      * babe: move backoff authoring params to default constructor
      
      * babe: deduplicate the test a bit
      
      * babe: set backoff constants in service
      
      * babe: use better names for backoff authoring block parameters
      
      * babe: remove last unwrap
      
      * babe: slight style tweak
      
      * babe: fix comment
      
      * slots: move backoff block authorship logic to SimpleSlotWorker
      
      * aura: append SlotInfo in on_slot
      
      * slots: use the correct types for parameters
      
      * slots: fix review comments
      
      * aura: add missing backoff authoring blocks parameters
      
      * slots: add comments for default values
      
      * slots: add additional checks in test
      
      * slots: update implementation for new master
      
      * slots: revert the change to SlotInfo
      
      * Fix review comments
      
      * slots: rework unit tests for backing off claiming slots
      
      * slots: add test for asymptotic behaviour for slot claims
      
      * slots: address review comments
      
      * slots: add test for max_interval
      
      * slots: add assertion for intervals between between claimed slots
      
      * slots: remove rustfmt directive
      
      * slots: another attempt at explaining authoring_rate
      
      * slots: up unfinalized_slack to 50 by default
      
      * slots: add tests for time to reach max_interval
      
      * slots: fix typo in comments
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * slots: additional tweaks to comments and info calls
      
      * slots: rename to BackoffAuthoringOnFinalizedHeadLagging
      
      * slots: make the backing off strategy generic
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * slots: implement backoff trait for () for simplicity
      
      * slots: move logging inside backing off function to make it more specific
      
      * aura: add missing function parameter
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      7cf78c16
    • Bastian Köcher's avatar
      Skip slot lenience on first block in BABE (#7515) · 48a84f90
      Bastian Köcher authored
      The genesis header doesn't have the BABE pre-digest and we insert `0` as
      slot number. The slot lenience calculation will return the maximum in
      this situation. Besides returning the maximum which is not bad at all,
      it also prints some a debug message that can be confusing in the first
      moment. To prevent printing this debug message, we now just return early
      when we see that the parent block is the genesis block.
      48a84f90
  32. Nov 05, 2020