Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC support for CometBFT 0.38 #1317

Merged
merged 30 commits into from
Jun 14, 2023
Merged

RPC support for CometBFT 0.38 #1317

merged 30 commits into from
Jun 14, 2023

Commits on May 19, 2023

  1. rpc: 0.38 support for /block_results endpoint

    In the v0_37+ dialect helper, support the new finalize_block_events
    field if it is present. Also default the begin_block_events and
    end_block_events fields to None if they are not present.
    mzabaluev committed May 19, 2023
    Configuration menu
    Copy the full SHA
    9962a4f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8328820 View commit details
    Browse the repository at this point in the history
  3. tendermint: restore Deserialize on some types

    For abci::Event and abci::response::CheckTx, restore the Deserialize
    implementation on domain types themselves.
    
    The event serialization format as used in 0.37+ will be established as
    the "canonical" serialization.
    mzabaluev committed May 19, 2023
    Configuration menu
    Copy the full SHA
    320decd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ad73c4b View commit details
    Browse the repository at this point in the history
  5. rpc: support more changes in CometBFT 0.38

    Add the new fields and types without static differentiation for 0.38.x.
    
    Use the domain type ExecTxResult in deserializing the endpoint response types in the current (i.e. 0.37+) dialect for these endpoints:
    - /block_results
    - /broadcast_tx_commit
    - /tx
    - /tx_commit
    
    The Deserialize impls are restored on the response types,
    corresponding to the JSON schema for the current RPC dialect.
    
    Simplify the 0.34 dialect support for these responses, no longer using
    generics.
    
    In endpoint::tx_commit::Response, rename the deliver_tx field to
    tx_result to correspond to the current JSON schema. The Deserialize
    impl falls back to deliver_tx to also be able to parse 0.37 responses.
    mzabaluev committed May 19, 2023
    Configuration menu
    Copy the full SHA
    4c0cb74 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    14cda47 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2023

  1. Fix CompatMode parsing test

    mzabaluev committed May 22, 2023
    Configuration menu
    Copy the full SHA
    ba70456 View commit details
    Browse the repository at this point in the history
  2. Fix deserialization of RPC results

    Some serde attributes were not migrated onto the ExecTxResult
    domain type when it has been tasked with deserializing the latest
    RPC dialect.
    On abci::response::CheckTx, add serde(default) on fields that are
    no longer present in CometBFT 0.38.
    mzabaluev committed May 22, 2023
    Configuration menu
    Copy the full SHA
    c8d8497 View commit details
    Browse the repository at this point in the history
  3. rpc: 0.37 compat on /block_results response

    If the finalize_block_events is not present, default to an empty vector.
    Conversely, skip the field from serializing if it's set to an
    empty vector.
    mzabaluev committed May 22, 2023
    Configuration menu
    Copy the full SHA
    009e696 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7ba4b1c View commit details
    Browse the repository at this point in the history

Commits on May 24, 2023

  1. Derive serde impls for abci responses

    BeginBlock, EndBlock, FinalizeBlock are used to deserialize
    RPC responses.
    mzabaluev committed May 24, 2023
    Configuration menu
    Copy the full SHA
    057f169 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2023

  1. rpc: adapt serialization of Event for 0.38

    Now that event data can have new fields, distinguish this with
    a new NewBlock enum variant, renaming the old one to LegacyNewBlock.
    
    The dialect serialization helpers for subscription events are
    separated to v0_34::DialectEvent, that does not recognize the
    0.38 fields at all and parses the event attributes as base64-encoded,
    and latest::DialectEvent, which has provisions for 0.38 fields if they
    are present, and in this case converts to the NewBlock variant.
    mzabaluev committed May 25, 2023
    Configuration menu
    Copy the full SHA
    ce199fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    07de311 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c37c6c3 View commit details
    Browse the repository at this point in the history
  4. clippy fix

    mzabaluev committed May 25, 2023
    Configuration menu
    Copy the full SHA
    2cf5d78 View commit details
    Browse the repository at this point in the history
  5. Fix up kvstore-test

    mzabaluev committed May 25, 2023
    Configuration menu
    Copy the full SHA
    3c12478 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2023

  1. Configuration menu
    Copy the full SHA
    e85d346 View commit details
    Browse the repository at this point in the history
  2. rpc: version-alias latest event serde helpers

    For consistency, define event::v0_37 and event::v0_38, aliasing
    the public definitions in event::latest.
    mzabaluev committed May 29, 2023
    Configuration menu
    Copy the full SHA
    a2015fb View commit details
    Browse the repository at this point in the history
  3. Changelog for #1317

    mzabaluev committed May 29, 2023
    Configuration menu
    Copy the full SHA
    fa7d4b1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2406f5a View commit details
    Browse the repository at this point in the history

Commits on May 30, 2023

  1. rpc: swap around dialects in websocket test

    🤦‍♂️
    mzabaluev committed May 30, 2023
    Configuration menu
    Copy the full SHA
    77b5b63 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c00766a View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2023

  1. rpc: split ser/de helpers for Event

    The Serialize impl needs to be implemented differently for
    0.37 and 0.38 in order to emit old or new fields for NewBlock.
    The Deserialize impl, however, flexibly handles both formats to avoid
    introducing another dialect where most other helpers would be
    identical. This means that Event gets two different helpers for each
    protocol version: DeEvent for Deserialize and SerEvent for Serialize.
    mzabaluev committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    a4e3804 View commit details
    Browse the repository at this point in the history
  2. rpc: 0.37 serialization for /broadcast_tx_commit

    Provide v0_37::DialectResponse as a way to serialize responses
    in the 0.37 JSON format.
    mzabaluev committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    569db8c View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. rpc: Fix 0.38 websocket test by proper emulation

    Use the exact protocol version to serialize test server responses as
    appropriate. No new variant is added to CompatMode, as that is a
    client-side setting and the client is able to cope with both versions
    dynamically.
    mzabaluev committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    8d58a1d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3d3dac8 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2023

  1. Remove a FIXME comment

    No opinions have been expressed about any canonical way to serialize
    app hashes, so the explicit serializer helper should be there for now.
    mzabaluev committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    51e47d0 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2023

  1. Configuration menu
    Copy the full SHA
    3d05019 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    18ccbcc View commit details
    Browse the repository at this point in the history
  3. Update changelog for #1317

    mzabaluev committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    e5f141b View commit details
    Browse the repository at this point in the history