Skip to content
  1. Jul 08, 2021
    • Lldenaurois's avatar
      Approval voting overlay db (#3366) · 7313e485
      Lldenaurois authored
      * node/approval-voting: Introduce Backend trait and Overlaybackend
      
      This commit introduces a Backend trait and attempts to move away
      from the Action model via an OverlayBackend as in the ChainSelection
      subsystem.
      
      * node/approval-voting: Add WriteOps for StoredBlockRange and BlocksAtHeight
      
      * node/approval-voting: Add load_all_blocks to overlay
      
      * node/approval-voting: Get all module tests to pass.
      
      This commit modifies all tests to ensure tests are passing.
      
      * node/approval-voting: Address oversights in the previous commit
      
      This commit addresses some oversights in the prior commit.
      
      1. Inner errors in backend.write were swallowed
      2. One-off write functions removed to avoid useless abstraction
      3. Touch-ups in general
      
      * node/approval-voting: Move from TestDB to dyn KeyValueDB
      
      This commit removes the TestDB from tests.rs and replaces it with
      an in-memory kvdb.
      
      * node/approval-voting: Address feedback
      
      * node/approval-voting: Add license to ops.rs
      
      * node/approval-voting: Address second-pass feedback
      
      * Add TODO
      
      * node/approval-voting: Bump spec_version
      
      * node/approval-voting: Address final comments.
      7313e485
  2. Jul 07, 2021
  3. Jul 06, 2021
    • asynchronous rob's avatar
      Chain Selection: Follow-ups (#3328) · f69c1751
      asynchronous rob authored
      
      
      * DB skeleton
      
      * key formats
      
      * lexicographic test
      
      * custom types for DB
      
      * implement backend for db-v1
      
      * remove VoidBackend and integrate with real DbBackend
      
      * detect stagnant blocks on in interval
      
      * fix tests
      
      * add tests for stagnant
      
      * send ChainSelectionMessage::Approved
      
      * tests for DB backend
      
      * unused import
      
      * upgrade kvdb-memorydb
      
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      f69c1751
  4. Jul 05, 2021
  5. Jul 02, 2021
  6. Jun 30, 2021
  7. Jun 28, 2021
  8. Jun 23, 2021
  9. Jun 22, 2021
    • Lldenaurois's avatar
      Approval Checking: Avoid redundant checks (#3306) · 777499dc
      Lldenaurois authored
      * node/approval-voting: Introduce LruCache for pending Approval work
      
      This commit adds an LruCache that is intended to track the approval work
      submitted as background tasks in order to ensure that the validator needn't
      launch duplicate approval work for the same candidate across multiple blocks.
      A simple state machine is also introduced in order to differentiate pending
      and completed tasks. In addition, this LruCache will retain ValidationResults
      from the completed approval work once the task has completed. As per LruCache
      implementation, the oldest tasks will get evicted as new approval work is
      submitted to this cache.
      
      * node/approval-voting: Revert changes to master
      
      This commit reverts changes from the previous commit in order
      to simplify addressing the architecture discussion raised in the PR.
      
      * node/approval-voting: remove background task mpsc construct
      
      This diff removes the mpsc construct for background tasks in preparation
      for a move to leveraging RemoteHandles to launch approvals, rather than
      passing ApprovalRequests to a mpsc channel and handling the ApprovalRequests
      in the main subsystem task.
      
      * node/approval-voting: Introduce LRU Cache
      
      This commit introduces an LRU Cache but does not yet make use of it.
      
      * node/approval-voting: Remove BackgroundTasksMap and memoize currently_checking
      
      This commit removes the BackgroundTasksMap in the main subsystem task
      and introduces a method to keep track of RemoteHandles in such a way that
      we can ensure that a task is spawned once for a CandidateHash and
      relay parent tuple.
      
      * node/approval-voting: Remove BackgroundTasksMap and memoize currently_checking
      
      This commit removes the BackgroundTasksMap in the main subsystem task
      and introduces a map of FuturesUnordered per BlockNumber. In addition,
      a FusedFuture is generated by iterating across all FuturesUnordered for
      the BlockNumbers for which at least one candidate has approvals work
      running in the subsystem.
      
      * node/approval-voting: Address Rob's comments
      
      This diff removes the prior HashMap<BlockNumber, FuturesUnordered>
      construction and instead moves to a simple FuturesUnordered where
      all the work is await with Timeout.
      
      * node/approval-voting: Update Cargo.lock
      
      Due to a mismatch in rustc versions
      
      * node/approval-voting: Make use of actions when issuing_approval
      
      This commit fixes a small oversight in the logic of the prior commit.
      
      * node/approval-voting: Address Rob's feedback
      
      * node/approval-voting: Introduce lazy launch_approval evaluation
      
      * node/approval-voting: Send DistibruteApproval message on every LaunchApproval
      
      In addition to fixed the DistributeApproval bug, this commit also
      increases the size of the approvals cache and ensures the StaleGuard
      is removed when the advantageous approval state is reached.
      
      * node/approval-voting: Address final comments
      
      This commit removes the CandidateIndex from the ApprovalVoteRequest.
      Instead, the launch_approval function will compute the candidate_index
      from the block entry.
      
      In addition, a comment has been added explaining the difficulty of
      issuing approvals in the handle_actions function.
      
      * node/approval-voting: Set timeout to be 120s rather than 2s
      
      * Update Cargo.lock
      777499dc
    • Arkadiy Paronyan's avatar
      Fast sync companion PR (#3078) · 0225640d
      Arkadiy Paronyan authored
      
      
      * Fixed build
      
      * Bumped trie-db
      
      * update Substrate
      
      * impl-guide: fix broken links
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarAndronik Ordian <[email protected]>
      0225640d
    • ordian's avatar
      make `ctx.spawn` blocking (#3337) · ffc6f7c7
      ordian authored
      * make spawn sync
      
      * improve error type
      ffc6f7c7
  10. Jun 21, 2021
    • asynchronous rob's avatar
      Chain Selection Subsystem Logic (#3277) · 74baed8b
      asynchronous rob authored
      
      
      * crate skeleton and type definitions
      
      * add ChainSelectionMessage
      
      * add error type
      
      * run loop
      
      * fix overseer
      
      * simplify determine_new_blocks API
      
      * write an overlay struct and fetch new blocks
      
      * add new function to overlay
      
      * more flow
      
      * add leaves to overlay and add a strong type around leaves-set
      
      * add is_parent_viable
      
      * implement block import, ignoring reversions
      
      * add stagnant-at to overlay
      
      * add stagnant
      
      * add revert consensus log
      
      * flow for reversions
      
      * extract and import block reversions
      
      * recursively update viability
      
      * remove redundant parameter from WriteBlockEntry
      
      * do some removal of viable leaves
      
      * address grumbles
      
      * refactor
      
      * address grumbles
      
      * add comment about non-monotonicity
      
      * extract backend to submodule
      
      * begin the hunt for viable leaves
      
      * viability pivots for updating the active leaves
      
      * remove LeafSearchFrontier
      
      * partially -> explicitly viable and untwist some booleans
      
      * extract tree to submodule
      
      * implement block finality update
      
      * Implement block approval routine
      
      * implement stagnant detection
      
      * ensure blocks pruned on finality are removed from the active leaves set
      
      * write down some planned test cases
      
      * floww
      
      * leaf loading
      
      * implement best_leaf_containing
      
      * write down a few more tests to do
      
      * remove dependence of tree on header
      
      * guide: ChainApiMessage::BlockWeight
      
      * node: BlockWeight ChainAPI
      
      * fix compile issue
      
      * note a few TODOs for the future
      
      * fetch block weight using new BlockWeight ChainAPI
      
      * implement unimplemented
      
      * sort leaves by block number after weight
      
      * remove warnings and add more TODOs
      
      * create test module
      
      * storage for test backend
      
      * wrap inner in mutex
      
      * add write waker query to test backend
      
      * Add OverseerSignal -> FromOverseer conversion
      
      * add test harnes
      
      * add no-op test
      
      * add some more test helpers
      
      * the first test
      
      * more progress on tests
      
      * test two subtrees
      
      * determine-new-blocks: cleaner genesis avoidance and tighter ancestry requests
      
      * don't make ancestry requests when asking for one block
      
      * add a couple more tests
      
      * add to AllMessages in guide
      
      * remove bad spaces from bridge
      
      * compact iterator
      
      * test import with gaps
      
      * more reversion tests
      
      * test finalization pruning subtrees
      
      * fixups
      
      * test clobbering and fix bug in overlay
      
      * exhaustive backend state after finalizaiton tested
      
      * more finality tests
      
      * leaf tests
      
      * test approval
      
      * test ChainSelectionMessage::Leaves thoroughly
      
      * remove TODO
      
      * avoid Ordering::is_ne so CI can build
      
      * comment algorithmic complexity
      
      * Update node/core/chain-selection/src/lib.rs
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      74baed8b
  11. Jun 20, 2021
  12. Jun 19, 2021
  13. Jun 18, 2021
  14. Jun 17, 2021
    • Lldenaurois's avatar
      Extract and test count_no_shows method for approval voting (#3264) · f8ed46f4
      Lldenaurois authored
      * node/approval-voting: extract and test count_no_shows method
      
      This commit extracts no_show computation into a pure function so that it can be
      extensively unit tested.
      
      * node/approval-voting: ignore invalid validator indexes in count_no_show
      
      Previously indexes that were past the length of the approvals bitvector
      would contribute to the no_show count or the next_no_show value. This
      commit changes the behavior to ignore garbage values.
      
      * node/approval-voting: add comment for next_no_show adding clock_drift
      f8ed46f4
    • ordian's avatar
      cleanup more tests and spaces (#3288) · 325cc888
      ordian authored
      * cleanup more tests and spaces
      
      * oops
      325cc888
  15. Jun 16, 2021
    • asynchronous rob's avatar
      extract determine_new_blocks into a separate utility (#3261) · 462ca043
      asynchronous rob authored
      * extract determine_new_blocks into a separate utility
      
      * rework docs
      462ca043
    • Lldenaurois's avatar
      Approval checking unit tests (#3252) · 0da70dfa
      Lldenaurois authored
      * node/approval_checking: break out filled_tranch_iterator method
      
      In the subsequent commit, we will begin to test this method in
      isolation.
      
      * node/approval-voting: fix tranche back-filling algorithm
      
      Previously, this algorithm would generate duplicate, empty entries for
      tranches (1..pre_end). This is caused because the initial value (0) for
      gap_end is treated as the end of a prior tranche that wasn't actually
      processed. The first pass thus would add (1..tranche) empty entries, in
      addition to the (0..pre_end) empty entries chained at the end of the
      method.
      
      This is fixed by using the current tranche as the gap_start for the
      first iteration, ensuring that the approval_entries_filled only produces
      entries in the range (pre_end..post_start).
      
      * Address feedback
      0da70dfa
    • Bernhard Schuster's avatar
      malus - mockable overseer mvp (#3224) · 44a8aa23
      Bernhard Schuster authored
      44a8aa23
  16. Jun 15, 2021
  17. Jun 14, 2021
  18. Jun 13, 2021
    • ordian's avatar
      approval votes checking logs (#3233) · 93e42fb2
      ordian authored
      * approval-voting: logs for invalid votes
      
      * proper errors for assignment checks
      
      * proper errors for approval checks
      93e42fb2
    • asynchronous rob's avatar
    • asynchronous rob's avatar
      Dispute Coordinator Subsystem (#3150) · 5bc2b277
      asynchronous rob authored
      
      
      * skeleton for dispute-coordinator
      
      * add coordinator and participation message types
      
      * begin dispute-coordinator DB
      
      * functions for loading
      
      * implement strongly-typed DB transaction
      
      * add some tests for DB transaction
      
      * core logic for pruning
      
      * guide: update candidate-votes key for coordinator
      
      * update candidate-votes key
      
      * use big-endian encoding for session, and implement upper bound generator
      
      * finish implementing pruning
      
      * add a test for note_current_session
      
      * define state of the subsystem itself
      
      * barebones subsystem definition
      
      * control flow
      
      * more control flow
      
      * implement session-updating logic
      
      * trace
      
      * control flow for message handling
      
      * Update node/core/dispute-coordinator/src/lib.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Update node/subsystem/src/messages.rs
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * some more control flow
      
      * guide: remove overlay
      
      * more control flow
      
      * implement some DB getters
      
      * make progress on importing statements
      
      * add SignedDisputeStatement struct
      
      * move ApprovalVote to shared primitives
      
      * add a signing-payload API to explicit dispute statements
      
      * add signing-payload to CompactStatement
      
      * add relay-parent hash to seconded/valid dispute variatns
      
      * correct import
      
      * type-safe wrapper around dispute statements
      
      * use checked dispute statement in message type
      
      * extract rolling session window cache to subsystem-util
      
      * extract session window tests
      
      * approval-voting: use rolling session info cache
      
      * reduce dispute window to match runtime in practice
      
      * add byzantine_threshold and supermajority_threshold utilities to primitives
      
      * integrate rolling session window
      
      * Add PartialOrd to CandidateHash
      
      * add Ord to CandidateHash
      
      * implement active dispute update
      
      * add dispute messages to AllMessages
      
      * add dispute stubs to overseer
      
      * inform dispute participation to participate
      
      * implement issue_local_statement
      
      * implement `determine_undisputed_chain`
      
      * fix warnings
      
      * test harness for dispute coordinator tests
      
      * add more helpers to test harness
      
      * add some more helpers
      
      * some tests for dispute coordinator
      
      * ignore wrong validator indices
      
      * test finality voting rule constraint
      
      * add more tests
      
      * add variants to network bridge
      
      * fix test compilation
      
      * remove most dispute coordinator functionality
      
      as of #3222 we can do most of the work within the approval voting subsystem
      
      * Revert "remove most dispute coordinator functionality"
      
      This reverts commit 9cd615e8eb6ca0b382cbaff525d813e753d6004e.
      
      * Use thiserror
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      
      * Update node/core/dispute-coordinator/src/lib.rs
      
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      
      * extract tests to separate module
      
      * address nit
      
      * adjust run_iteration API
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      Co-authored-by: default avatarBernhard Schuster <[email protected]>
      5bc2b277
  19. Jun 12, 2021
  20. Jun 11, 2021
  21. Jun 09, 2021