Skip to content
  1. Mar 17, 2021
    • 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
  2. Mar 12, 2021
    • Robert Klotzner's avatar
      def7b4dc
    • Bastian Köcher's avatar
      Do not ban peers for sending multiple valid requests (#8325) · 3743cec9
      Bastian Köcher authored
      We introduced banning of peers who spam us with the same request (more
      than 2 times). However, we missed that it is completely legal to send
      the same request multiple times as long as we did not provide any
      answer. An example for that is the justification request. This request
      is send multiple times until we could fetch the justification from one
      of our peers. So, the solution to this problem is to tag requests as
      fulfilled and to start counting these fulfilled requests. If the number
      is higher than what we allow, the peer should be banned.
      3743cec9
  3. Mar 11, 2021
  4. Mar 10, 2021
    • Tomasz Drwięga's avatar
      Custom RPC for Merkle Mountain Range pallet (#8137) · f3d4355a
      Tomasz Drwięga authored
      * Add MMR custom RPC.
      
      * Change RuntimeApi to avoid hardcoding leaf type.
      
      * Properly implement the new RuntimeAPI and wire up RPC.
      
      * Extract Offchain DB as separate execution extension.
      
      * Enable offchain DB access for offchain calls.
      
      * Fix offchain_election tests.
      
      * Skip block initialisation for proof generation.
      
      * Fix integration test setup.
      
      * Fix offchain tests. Not sure how I missed them earlier 🤷.
      
      * Fix long line.
      
      * One more test missing.
      
      * Update mock for multi-phase.
      
      * Address review grumbbles.
      
      * Address review grumbles.
      
      * Fix line width of a comment
      f3d4355a
    • 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
  5. Mar 09, 2021
    • Bastian Köcher's avatar
      c33235ac
    • 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
    • Bastian Köcher's avatar
      Decrease the peer reputation on invalid block requests (#8260) · 85f32e88
      Bastian Köcher authored
      * Decrease the peer reputation on invalid block requests
      
      This pr changes the block request handler to decrease the reputation of
      peers when they send the same request multiple times or they send us an
      invalid block request.
      
      * Review feedback
      
      * Change log target
      
      * Remove unused code
      85f32e88
  6. 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
    • thiolliere's avatar
      Fix doc build with --all-features (#8277) · 9c4e4d45
      thiolliere authored
      * implement
      
      * make default pre/post_upgrade
      
      * simplify Cargo.toml
      
      * revert removal of outdated/private links
      
      * link in pallet-mmr
      9c4e4d45
    • Bastian Köcher's avatar
      Fix warnings related to panic and assert (#8272) · d0530d0f
      Bastian Köcher authored
      We were using the wrong syntax and that will be dropped with Rust 2021.
      The compiler already starts to hint the wrong syntax with warnings. So,
      we fix this here.
      d0530d0f
  7. Mar 04, 2021
  8. Mar 03, 2021
  9. Mar 01, 2021
  10. Feb 28, 2021
  11. Feb 26, 2021
  12. Feb 25, 2021
    • Pierre Krieger's avatar
      Fix networking debug_asserts (#8200) · d5b308f1
      Pierre Krieger authored
      * Fix networking debug_asserts
      
      * Fix comment
      d5b308f1
    • Ashley's avatar
    • André Silva's avatar
      grandpa: rewrite warp sync proof generation (#8148) · 94c29ff6
      André Silva authored
      * grandpa: use AuthoritySetChanges to generate warp sync proof
      
      * node: init grandpa warp sync protocol
      
      * grandpa: iterator for AuthoritySetChanges
      
      * grandpa: rewrite warp sync proof generation
      
      * grandpa: remove old code for warp sync generation
      
      * grandpa: fix indentation
      
      * grandpa: fix off by one
      
      * grandpa: use binary search to find start idx when generating warp sync proof
      
      * grandpa: add method to verify warp sync proofs
      
      * grandpa: remove unnecessary code to skip authority set changes
      
      * grandpa: add test for warp sync proof generation and verification
      
      * grandpa: add missing docs
      
      * grandpa: remove trailing comma
      94c29ff6
  13. Feb 24, 2021
  14. Feb 23, 2021
  15. Feb 22, 2021
  16. Feb 19, 2021
  17. Feb 18, 2021
  18. Feb 17, 2021
    • Cecile Tonglet's avatar
      Fix telemetry span not entering properly attempt 3 (#8043) · 27274c42
      Cecile Tonglet authored
      
      
      * Fix tracing tests (#8022)
      
      * Fix tracing tests
      
      The tests were not working properly.
      
      1. Some test was setting a global subscriber, this could lead to racy
      conditions with other tests.
      
      2. A logging test called `process::exit` which is completly wrong.
      
      * Update client/tracing/src/lib.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Review comments
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Fix tracing spans are not being forwarded to spawned task (#8009)
      
      * Fix tracing spans are not being forwarded to spawned task
      
      There is a bug that tracing spans are not forwarded to spawned task. The
      problem was that only the telemetry span was forwarded. The solution to
      this is to use the tracing provided `in_current_span` to capture the
      current active span and pass the telemetry span explictely. We will now
      always enter the span when the future is polled. This is essentially the
      same strategy as tracing is doing with its `Instrumented`, but now
      extended for our use case with having multiple spans active.
      
      * More tests
      
      * Proper test for telemetry and prefix span
      
      * WIP
      
      * Fix test (need to create & enter the span at the same time)
      
      * WIP
      
      * Remove telemtry_span from sc_service config
      
      * CLEANUP
      
      * Update comment
      
      * Incorrect indent
      
      * More meaningful name
      
      * Dedent
      
      * Naming XD
      
      * Attempt to make a more complete test
      
      * lint
      
      * Missing licenses
      
      * Remove user data
      
      * CLEANUP
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * CLEANUP
      
      * Apply suggestion
      
      * Update bin/node/cli/tests/telemetry.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Wrapping lines
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarDavid <[email protected]>
      27274c42
  19. Feb 15, 2021