Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

rpc: Implement chainHead RPC API #12544

Merged
merged 80 commits into from
Dec 19, 2022
Merged

rpc: Implement chainHead RPC API #12544

merged 80 commits into from
Dec 19, 2022

Commits on Oct 21, 2022

  1. rpc/chain_head: Add event structure for serialization

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    717ee38 View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Add tests for events

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    3716594 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Add API trait for chainHead

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    c3ac4b8 View commit details
    Browse the repository at this point in the history
  4. rpc/chain_head: Add RPC errors

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    4f88981 View commit details
    Browse the repository at this point in the history
  5. rpc/chain_head: Manage subscription ID tracking for pinned blocks

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    ab1bc81 View commit details
    Browse the repository at this point in the history
  6. rpc/chain_head: Add tests for subscription management

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    2e2237f View commit details
    Browse the repository at this point in the history
  7. rpc/chain_head: Constructor for the API

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    798acd2 View commit details
    Browse the repository at this point in the history
  8. rpc/chain_head: Placeholders for API implementation

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    373887c View commit details
    Browse the repository at this point in the history
  9. rpc/chain_head: Accept RPC subscription sink

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    aa1d21b View commit details
    Browse the repository at this point in the history
  10. rpc/chain_head: Generate the runtime API event

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    d8e60f7 View commit details
    Browse the repository at this point in the history
  11. rpc/chain_head: Implement the follow method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    8dbdaf8 View commit details
    Browse the repository at this point in the history
  12. rpc/chain_head: Implement the body method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    3ed5c79 View commit details
    Browse the repository at this point in the history
  13. rpc/chain_head: Implement the header method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    27d9a5c View commit details
    Browse the repository at this point in the history
  14. rpc/chain_head: Implement the storage method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    9ec6b36 View commit details
    Browse the repository at this point in the history
  15. rpc/chain_head: Implement the call method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    70fd229 View commit details
    Browse the repository at this point in the history
  16. rpc/chain_head: Implement the unpin method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    d93161a View commit details
    Browse the repository at this point in the history
  17. Update Cargo.lock

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    2bec344 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2022

  1. rpc/chain_head: Implement getGenesis method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    7e4326a View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Fix clippy

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    0f32685 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Parse params from hex string

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    4ba5d77 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. rpc/chain_head: Constuct API with genesis hash

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    542d360 View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Add the finalized block to reported tree route

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    e1f5796 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Export the API and events for better ergonomics

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    cf3530c View commit details
    Browse the repository at this point in the history
  4. chain_head/tests: Add test module with helper functions

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    7ae67fa View commit details
    Browse the repository at this point in the history
  5. chain_head/tests: Test block events from the follow pubsub

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    80b8776 View commit details
    Browse the repository at this point in the history
  6. chain_head/tests: Test genesisHash getter

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    83e926c View commit details
    Browse the repository at this point in the history
  7. chain_head/tests: Test header method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    f047db9 View commit details
    Browse the repository at this point in the history
  8. chain_head/tests: Test body method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    05d6219 View commit details
    Browse the repository at this point in the history
  9. chain_head/tests: Test calling into the runtime API

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    f9c004b View commit details
    Browse the repository at this point in the history
  10. chain_head/tests: Test runtime for the follow method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    e0ab77c View commit details
    Browse the repository at this point in the history
  11. chain_head/tests: Add runtime code changes for follow method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    04574cc View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2022

  1. Configuration menu
    Copy the full SHA
    b64a9c9 View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Remove space from rustdoc

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    2de8d6c View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Use the child_key for storage queries

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    d78e04d View commit details
    Browse the repository at this point in the history
  4. rpc/chain_head: Test storage method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    ba8a257 View commit details
    Browse the repository at this point in the history
  5. rpc/chain_head: Test child trie query for storage method

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    745c795 View commit details
    Browse the repository at this point in the history
  6. rpc/chain_head: Event serialization typo

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    c80a428 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2022

  1. rpc/chain_head: Remove subscription aliases

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    cce8e42 View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Add NetworkConfig parameter

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    a5678c4 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Named parameters as camelCase if present

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    e6f7df0 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2022

  1. rpc/chain_head: Implement From<ApiError> for RuntimeEvents

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    80ddec8 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2022

  1. rpc/chain_head: Handle pruning of the best block in finalization window

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 4, 2022
    Configuration menu
    Copy the full SHA
    08fe794 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2022

  1. rpc/chain_head: Generate initial block events

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 7, 2022
    Configuration menu
    Copy the full SHA
    76c0d2c View commit details
    Browse the repository at this point in the history
  2. chain_head/tests: Verify that initial in-memory blocks are reported

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 7, 2022
    Configuration menu
    Copy the full SHA
    cad484e View commit details
    Browse the repository at this point in the history
  3. chain_head/tests: Verify the finalized event with forks and pruned bl…

    …ocks
    
    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 7, 2022
    Configuration menu
    Copy the full SHA
    351154f View commit details
    Browse the repository at this point in the history
  4. rpc/chain_head: Fix clippy

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 7, 2022
    Configuration menu
    Copy the full SHA
    f185e7c View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2022

  1. rpc/chain_head: Separate logic for generating initial events

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    4742b7c View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Handle stopping a subscription ID

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    06ac897 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Submit events until the "Stop" event is triggered

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    06797df View commit details
    Browse the repository at this point in the history
  4. rpc/chain_head: Separate logic for handling new and finalized blocks

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    2a1b79f View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2022

  1. rpc/chain_head: Extend subscription logic with subId handle

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    e5fac2c View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Adjust to the new subscription mngmt API

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    6b84dd4 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Refuse RuntimeAPI calls without the runtime flag

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    091cd90 View commit details
    Browse the repository at this point in the history
  4. chain_head/tests: Verify RuntimeAPI calls without runtime flag

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    f5514b8 View commit details
    Browse the repository at this point in the history
  5. rpc/chain_head: Add best block per subscription

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    a060fb8 View commit details
    Browse the repository at this point in the history
  6. rpc/chain_head: Check storage keys for prefixes

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    d782cc2 View commit details
    Browse the repository at this point in the history
  7. chain_head/tests: Check storage queries with invalid prefixes

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    4ce5fe5 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2022

  1. rpc/chain_head: Allow maximum number of pinned blocks

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    60a46ab View commit details
    Browse the repository at this point in the history
  2. chain_head/tests: Test the maximum number of pinned blocks

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    239013c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1edc4a7 View commit details
    Browse the repository at this point in the history
  4. rpc/chain_head: Adjust to origin/master and apply clippy

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 10, 2022
    Configuration menu
    Copy the full SHA
    7804896 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2022

  1. client/service: Enable the chainHead API

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    42035bf View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Stop subscription on client disconnect and add debug …

    …logs
    
    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    ed720a1 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Fix sending Stop on subscription exit

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    3820d4f View commit details
    Browse the repository at this point in the history
  4. rpc/chain_head: Check best block is descendent of latest finalized

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    e95fa3f View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. chain_head/tests: Report events before pruning the best block

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    4372c4a View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2022

  1. Configuration menu
    Copy the full SHA
    eab917f View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Nonrecursive initial block generation

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    9d25bea View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Generate initial events on subscription executor

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    1065eaf View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2022

  1. rpc/chain_head: Reduce dev-dependencies for tokio

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    6dbd383 View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
    lexnv and skunert authored Nov 24, 2022
    Configuration menu
    Copy the full SHA
    54b7395 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2022

  1. rpc/chain_head: Accept empty parameters

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 1, 2022
    Configuration menu
    Copy the full SHA
    331e1bb View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Use debug of HexDisplay for full format

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 1, 2022
    Configuration menu
    Copy the full SHA
    6da3073 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2022

  1. Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    cafd5ef View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Enable subscription ID

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    cc4d1a5 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Use jsonrpsee 16.2 camelCase feature for paramaters

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    9a3f5f7 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2022

  1. Configuration menu
    Copy the full SHA
    7e7afed View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2022

  1. Configuration menu
    Copy the full SHA
    22bd9fa View commit details
    Browse the repository at this point in the history
  2. rpc/chain_head: Use NonZeroUsize for NetworkConfig param

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    0111353 View commit details
    Browse the repository at this point in the history
  3. rpc/chain_head: Rename runtime_updates to has_runtime_updates

    Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
    lexnv committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    41aee3e View commit details
    Browse the repository at this point in the history