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

add GetEpoch local state query #320

Closed
wants to merge 13 commits into from

Commits on Oct 30, 2023

  1. implement GetEpoch local state query w examples

    test fixture is also included.
    falcucci committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    e48fd11 View commit details
    Browse the repository at this point in the history
  2. remove unnecessary println!

    falcucci committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    f68e873 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2023

  1. Configuration menu
    Copy the full SHA
    b7e434a View commit details
    Browse the repository at this point in the history
  2. minor changes

    ```diff
    diff --git a/pallas-network/tests/protocols.rs b/pallas-network/tests/protocols.rs
    index 5812f88838ed..b625632f0f15 100644
    --- a/pallas-network/tests/protocols.rs
    +++ b/pallas-network/tests/protocols.rs
    @@ -290,7 +290,6 @@ pub async fn local_state_query_server_and_client_happy_path() {
                     .unwrap();
    
                 // server receives range from client, sends blocks
    -
                 let clientacquirerequest(maybe_point) =
                     server_sq.recv_while_idle().await.unwrap().unwrap();
    
    @@ -322,7 +321,6 @@ pub async fn local_state_query_server_and_client_happy_path() {
                     .unwrap();
    
                 // server receives release from the client
    -
                 match server_sq.recv_while_acquired().await.unwrap() {
                     clientqueryrequest::release => (),
                     x => panic!("unexpected message from client: {x:?}"),
    @@ -360,7 +358,6 @@ pub async fn local_state_query_server_and_client_happy_path() {
                 assert_eq!(*server_sq.state(), localstate::state::acquired);
    
                 // server receives reaquire from the client
    -
                 let maybe_point = match server_sq.recv_while_acquired().await.unwrap() {
                     clientqueryrequest::reacquire(p) => p,
                     x => panic!("unexpected message from client: {x:?}"),
    @@ -372,7 +369,6 @@ pub async fn local_state_query_server_and_client_happy_path() {
                 server_sq.send_acquired().await.unwrap();
    
                 // server receives release from the client
    -
                 match server_sq.recv_while_acquired().await.unwrap() {
                     clientqueryrequest::release => (),
                     x => panic!("unexpected message from client: {x:?}"),
    ```
    falcucci committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    86aa076 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2023

  1. add response primitives

    currently supporting only non params local state queries
    falcucci committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    02edf49 View commit details
    Browse the repository at this point in the history
  2. minor changes.

    ```diff
    diff --git a/pallas-network/src/miniprotocols/localstate/queries.rs b/pallas-network/src/miniprotocols/localstate/queries.rs
    index dabc73e646d0..71921c1672c7 100644
    --- a/pallas-network/src/miniprotocols/localstate/queries.rs
    +++ b/pallas-network/src/miniprotocols/localstate/queries.rs
    @@ -42,7 +42,7 @@ impl encode<()> for blockquery {
             e.u16(0)?;
             e.array(2)?;
             /*
    -            todo: i think this is era or something? first fetch era with
    +            todo: think this is era or something? first fetch era with
                 [3, [0, [2, [1]]]], then use it here?
             */
             e.u16(5)?;
    ```
    falcucci committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    f5c986a View commit details
    Browse the repository at this point in the history
  3. renaming blockqueryresponse variants

    renames the variants of the `blockqueryresponse` enum in the `queries.rs` file of the `localstate` miniprotocol.
    
    the following changes were made:
    
    - `getledgertip` is now `ledgertip`
    - `stakepools` is now `currentpparams`
    - `getcurrentpparams` is now `proposedpparamsupdates`
    - `getproposedpparamsupdates` is now `stakedistribution`
    - `getstakedistribution` is now `genesisconfig`
    - `getgenesisconfig` is now `debugchaindepstate`
    - `getrewardprovenance` is now `rewardprovenance`
    - `getstakepools` is now `stakepools`
    - `getrewardinfopools` is now `rewardinfopools`
    falcucci committed Nov 1, 2023
    Configuration menu
    Copy the full SHA
    9b8316b View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2023

  1. mapping response primitives with local request code signals

    this has been an attempt to map the server requests into our responses.
    
    tests must be updated.
    falcucci committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    f73f8fc View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2023

  1. adding epoch_no struct

    we added the struct. maybe we should adapt to use it as turbofish
    falcucci committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    b58e6aa View commit details
    Browse the repository at this point in the history
  2. fix some imports

    - changed the argument of the `do_localstate_query` function from `localstate::queries::request` to `request`
    - updated the function call in `main` to use `request` instead of `localstate::queries::request`
    - removed unnecessary impls for `epochno`
    falcucci committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    72d3d7a View commit details
    Browse the repository at this point in the history
  3. fix tests and types

    falcucci committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    a0e0225 View commit details
    Browse the repository at this point in the history
  4. remove usuless dependency

    falcucci committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    1b2a8a1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    478a96b View commit details
    Browse the repository at this point in the history