Skip to content
  1. Feb 04, 2021
  2. Feb 03, 2021
  3. Feb 02, 2021
  4. Feb 01, 2021
    • Max Inden's avatar
      client/network: Use request response for light client requests (#7895) · 30061009
      Max Inden authored
      * client/network: Re-enable light_client_handler.rs unit tests
      
      * client/network: Add scaffolding for light client using req-resp
      
      * client/network: Make it compile
      
      * client/network: Rename OutEvent SendRequest
      
      * client/network: Restructure light client request client and handler
      
      * client/network: Rename light client request client to sender
      
      * client/network: Remove light client prepare_request
      
      * client/network/src/light: Rework configuration
      
      * client/network: Formatting
      
      * client/network/light: Remove RequestId
      
      * client/network/light: Make request functions methods
      
      * client/network/light: Refactor request wrapping
      
      * client/network/light: Fix warnings
      
      * client/network/light: Serialize request in method
      
      * client/network/light: Make returning response a method
      
      * client/network/light: Depend on request response to timeout requests
      
      * client/network: Fix test compilation
      
      * client/network/light: Re-enable connection test
      
      * client/network/light: Re-enable timeout test
      
      * client/network/light: Re-enable incorrect_response test
      
      * client/network/light: Re-enable wrong_response_type test
      
      * client/network/light: Re-enable retry_count_failures test
      
      * client/network/light: Re-enable issue_request tests
      
      * client/network/light: Re-enable send_receive tests
      
      * client/network/light: Deduplicate test logic
      
      * client/network/light: Remove unused imports
      
      * client/network/light: Handle request failure
      
      * client/network/light: Move generate_protocol_config
      
      * client/network: Fix test compilation
      
      * client/network: Rename light client request client to sender
      
      * client/network: Handle too-many-requests error
      
      * client/network: Update outdated comments
      
      * client/network/light: Choose any peer if none has best block defined
      
      * .maintain: Replace sentry-node with local-docker-test-network
      
      Sentry nodes are deprecated. Thus there is no need for
      `.maintain/sentry-node` to spin up a sentry node test environment.
      Instead this commit rewrites the setup to contain two full-connected
      validators and one light client.
      
      With the steps below one can now spin up a local test network with
      two validators, one light-client, Prometheus and Grafana.
      
      - cargo build --release
      - sudo docker-compose -f .maintain/local-docker-test-network/docker-compose.yml up
      
      * client/network/light: Handle oneshot cancellation
      
      * client/network/light: Do not reduce retry count on missing peer
      
      * client/network/request-response: Assert in debug request id to be unique
      
      * client/network/light: Choose same limit as block request protocol
      
      * client/network: Report reputation changes via response
      
      Allow request response protocol handlers to issue reputation changes, by
      sending them back along with the response payload.
      
      * client/network: Remove resolved TODOs
      30061009
    • Bastian Köcher's avatar
      Fix tracing spans are not being forwarded to spawned task (#8009) · c42d756f
      Bastian Köcher authored
      * 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
      c42d756f
  5. Jan 29, 2021
  6. 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
  7. Jan 27, 2021
  8. Jan 26, 2021
    • Jon Häggblad's avatar
      grandpa: remove runtime checks in prove_finality (#7953) · e535e421
      Jon Häggblad authored
      Remove checks that involve cross checking authorities in the runtime against what we have stored in
      the AuthoritySetChanges.
      e535e421
    • Pierre Krieger's avatar
    • Max Inden's avatar
      client/network: Report reputation changes via response (#7958) · b692954c
      Max Inden authored
      * client/network: Report reputation changes via response
      
      When handling a request by a remote peer in a request response handler,
      one might want to in- or de-crease the reputation of the peer. E.g. one
      might want to decrease the reputation slightly for each request, given
      that it forces the local node to do work, or one might want to issue a
      larger reputation change due to a malformed request by the remote peer.
      
      Instead of having to pass a peerset handle to each request response
      handler, this commit suggests to allow handlers to isssue reputation
      changes via the provided `pending_response` `oneshot` channel.
      
      A reputation change issued by a request response handler via the
      `pending_response` channel is received by the
      `RequestResponsesBehaviour` which passes the reputation change up as an
      event to eventually be send to a peerset via a peerset handle.
      
      * client/network/req-resp: Use Vec::new instead of None::<Vec<_>>
      
      * client/network: Rename Response to OutgoingResponse
      
      Given that a request-response request is not called `Request` but
      `InomingRequest`, rename a request-response response to
      `OutgoingResponse`.
      
      * client/finality-grandpa-warp: Send empty rep change via response
      b692954c
  9. Jan 25, 2021
    • Max Inden's avatar
      client/network/req-resp: Prevent request id collision (#7957) · 62d551a0
      Max Inden authored
      * client/network/req-resp: Add unit test for request id collision
      
      * client/network/req-resp: Prevent request id collision
      
      `RequestId` is a monotonically increasing integer, starting at
      `1`. A `RequestId` is unique for a single `RequestResponse`
      behaviour, but not across multiple `RequestResponse` behaviours. Thus
      when handling `RequestId` in the context of multiple
      `RequestResponse` behaviours, one needs to couple the protocol name
      with the `RequestId` to get a unique request identifier.
      
      This commit ensures that pending requests (`pending_requests`) and
      pending responses (`pending_response_arrival_time`) are tracked both by
      their protocol name and `RequestId`.
      
      * client/network/req-resp: Remove unused import
      
      * client/network/req-resp: Introduce ProtocolRequestId struct
      
      * client/network/req-resp: Update test doc comment
      
      Treat `RequestId` as an opaque type.
      
      * client/network/req-resp: Improve expect proof
      62d551a0
  10. Jan 24, 2021
  11. Jan 22, 2021
    • cheme's avatar
      Allow transaction for offchain indexing (#7290) · 878f7ccf
      cheme authored
      
      
      * Moving offchain change set to state machine overlay change set,
      preparing use of change set internally.
      
      * Make change set generic over key and value, and use it for offchain
      indexing.
      
      * test ui change
      
      * remaining delta
      
      * generating with standard method
      
      * Remove 'drain_committed' function, and documentation.
      
      * Default constructor for enabling offchain indexing.
      
      * Remove offchain change specific iterators.
      
      * remove pub accessor
      
      * keep previous hierarchy, just expose iterator instead.
      
      * Update primitives/state-machine/src/overlayed_changes/mod.rs
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      
      * fix line break
      
      * missing renamings
      
      * fix import
      
      * fix new state-machine tests.
      
      * Don't expose InnerValue type.
      
      * Add test similar to set_storage.
      
      * Remove conditional offchain storage (hard to instantiate correctly).
      
      * fix
      
      * offchain as children cannot fail if top doesn't
      
      Co-authored-by: default avatarAddie Wagenknecht <[email protected]>
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      878f7ccf
  12. Jan 21, 2021
    • Jon Häggblad's avatar
      Cleaner GRANDPA RPC API for proving finality (#7339) · 20f40fbd
      Jon Häggblad authored
      
      
      * grandpa: persist block number for last block of authority set
      
      * grandpa: fix authority_set_changes field in tests
      
      * grandpa: fix date on copyright notice
      
      * grandpa-rpc: implement cleaner api for prove finality rpc
      
      * grandpa-rpc: replace the old prove_finality with the new one
      
      * grandpa: undo accidental whitespace change
      
      * grandpa-rpc: start work on redo of the finality_proof RPC API
      
      * grandpa: manual impl of Decode for AuthoritySet
      
      * grandpa: add comment about appending changes for forced changes
      
      * grandpa: flip order in set changes, tidy up some comments
      
      * grandpa: update some of the doc comments
      
      * grandpa: store authority set changes when applying forced changes
      
      * grandpa: simplify finality_proof.rs
      
      * grandpa: move checks and extend tests in finality_proof
      
      * grandpa: address first set of review comments
      
      * grandpa: check that set changes have well-defined start
      
      * grandpa: rework prove_finality and assocated tests
      
      * grandpa: make AuthoritySetChanges tuple struct
      
      * grandpa: add assertions for tracking auth set changes
      
      * grandpa: remove StorageAndProofProvider trait
      
      * grandpa: return more informative results for unexpected input to RPC
      
      * grandpa: tiny tweak to error msg
      
      * grandpa: fix tests
      
      * grandpa: add error specific to finality_proof
      
      * grandpa: fix review comments
      
      * grandpa: proper migration to new AuthoritySet
      
      * grandpa: fix long lines
      
      * grandpa: fix unused warning after merge
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      20f40fbd
    • Ashley's avatar
      Grandpa warp sync request-response protocol (#7711) · 87cc2167
      Ashley authored
      
      
      * Made a start
      
      * So the proof between authority set is phragmen one, this is crazy big,
      or is there some signing of the result : that is the storage key, damn?
      
      * ok getting from header digest seems doable.
      
      * for testing
      
      * get set id from storage directly (should use runtime to handler change).
      
      * move test to init
      
      * correct auth key
      
      * fix iteration
      
      * Correct proof content
      
      * actually update block number.
      
      * actually check last justif against its header
      
      * justification relation to new authorities through header hash check is
      needed here. This assumes the hash from header is calculated.
      
      * Few changes
      
      * Connected up cheme's branch
      
      * Clean up
      
      * Move things around a bit so that adding the grandpa warp sync request response protocol happens in the node code
      
      * Nits
      
      * Changes to comments
      
      * Cheme changes
      
      * Remove todos and test compile.
      
      * Rename _authority_ related proof function to _warp_sync_ .
      
      * Update client/grandpa-warp-sync/src/lib.rs
      
      quick fix
      
      * Put the warp sync request response protocol behind a feature flag because we dont' need it on a light client.
      
      * Update client/grandpa-warp-sync/src/lib.rs
      
      Quick fix
      
      * Update Cargo.lock
      
      * Adding test, comment on limitation related to 'delay', this could
      be implemented but with a cost.
      
      * Set between a delay override last fragment.
      
      * Check for pending authority set change at start.
      
      * adjust index
      
      * custom cache is not a good idea.
      
      * Use a simple cache instead.
      
      * restore broken indentation
      
      * Address crate rename
      
      * Merge conflict badly resolved, sorry
      
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarPierre Krieger <[email protected]>
      87cc2167
    • Bastian Köcher's avatar
      Make offchain indexing work (#7940) · cd0ad480
      Bastian Köcher authored
      
      
      * Make offchain indexing work
      
      This fixes some bugs with offchain indexing to make it actually working ;)
      
      * Fix tests
      
      * Fix browser build
      
      * Update client/db/src/offchain.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * Remove seperation between prefix and key
      
      Co-authored-by: default avatarcheme <[email protected]>
      cd0ad480
  13. Jan 20, 2021
  14. Jan 19, 2021
    • Bastian Köcher's avatar
      Sync: Propagate block announcement data (#7903) · 450b96c5
      Bastian Köcher authored
      * Sync: Propagate block announcement data
      
      This pr adds a feature to the sync protocol to propagate the data that
      we received alongside a block announcement. This is done by adding a
      cache that caches the last X block announcement data where X is set to
      the number of `in_peers` (giving every peer the chance to send us a
      different block). This will be required by parachains to ensure that
      even peers who are not connected to a collator receive the data
      alongside the block announcement to properly validate it and request the
      block.
      
      * Review comment
      
      * Bring back the code and add new variant to ensure we don't insert block
      announce data when something wasn't checked
      
      * Also use out_peers
      450b96c5
    • Pierre Krieger's avatar
      Add explicit limits to notifications sizes and adjust yamux buffer size (#7925) · 8e045159
      Pierre Krieger authored
      * Add explicit limits to notifications sizes and adjust yamux buffer size
      
      * Docfix
      
      * Tests
      
      * Document these 10 bytes
      8e045159
  15. Jan 18, 2021
  16. Jan 15, 2021
  17. Jan 14, 2021