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

[Part 8/N] Interledger Stream: Futures 0.3 Transition #601

Merged
merged 9 commits into from
Jan 29, 2020

Conversation

gakonst
Copy link
Member

@gakonst gakonst commented Jan 23, 2020

Moving the discussion about the pending_requests removal here: #585 (comment)

Previously we had a manual implementation of a SendMoneyFuture, which would get polled like a typical Futures state machine
Since we can now use await, this implementation has been inlined in the code
@gakonst gakonst changed the base branch from master to gakonst/07-futures03-http January 23, 2020 10:03
crates/interledger-stream/src/client.rs Outdated Show resolved Hide resolved
crates/interledger-stream/src/client.rs Show resolved Hide resolved
crates/interledger-stream/src/client.rs Show resolved Hide resolved
crates/interledger-stream/src/client.rs Show resolved Hide resolved
crates/interledger-stream/src/client.rs Show resolved Hide resolved
crates/interledger-stream/src/server.rs Outdated Show resolved Hide resolved
crates/interledger-stream/src/packet.rs Outdated Show resolved Hide resolved
crates/interledger-stream/src/packet.rs Outdated Show resolved Hide resolved
crates/interledger-stream/src/packet.rs Outdated Show resolved Hide resolved
crates/interledger-stream/src/crypto.rs Outdated Show resolved Hide resolved
S: IncomingService<A> + Clone,
A: Account,
S: IncomingService<A> + Clone + 'static,
A: Account + 'static,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed that made these 'static?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to do with us pushing the next.handle_request future to the PendingRequests vector. Removing the statics results in:

   --> crates/interledger-stream/src/client.rs:243:29
    |
176 | impl<S, A> SendMoneyFuture<S, A>
    |      - help: consider adding an explicit lifetime bound `S: 'static`...
...
243 |                     future: request,
    |                             ^^^^^^^
    |
note: ...so that the type `impl core::future::future::Future` will meet its required lifetime bounds
   --> crates/interledger-stream/src/client.rs:243:29
    |
243 |                     future: request,
    |                             ^^^^^^^

error[E0310]: the parameter type `A` may not live long enough
   --> crates/interledger-stream/src/client.rs:243:29
    |
176 | impl<S, A> SendMoneyFuture<S, A>
    |         - help: consider adding an explicit lifetime bound `A: 'static`...
...
243 |                     future: request,
    |                             ^^^^^^^
    |
note: ...so that the type `impl core::future::future::Future` will meet its required lifetime bounds
   --> crates/interledger-stream/src/client.rs:243:29
    |
243 |                     future: request,
    |                             ^^^^^^^

(Note that I've tried rewriting this without pin_project (ie replace self.project() with unsafe { self.get_unchecked_mut() }, and there's no lifetime requirement introduced by it.)

My intuition about this is:

  1. SendMoneyFuture has a vector of pending requests.
  2. Each pending request has a future associated with it, which has static lifetime
  3. As a result the SendMoneyFuture struct must also live for static.
  4. This means that the associated accounts and service also must live for static.

It is not clear to me why this was not required on master before though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this or any of the other 'static bounds cause any problems anywhere else? If not then let's not worry about it, but if so then we could try a few things. I just know that 'static has a tendency to become "infectious" and I have a lot of code yet to review, so I'm not sure if this is going to cause problems downstream.

S: IncomingService<A>,
A: Account,
S: IncomingService<A> + Clone + 'static,
A: Account + 'static,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More statics whose necessity I'm unsure of.

@gakonst
Copy link
Member Author

gakonst commented Jan 28, 2020

Alternatively to what I wrote above, you try doing the following:

diff --git i/crates/interledger-stream/src/client.rs w/crates/interledger-stream/src/client.rs
index 641e067e..89eafb65 100644
--- i/crates/interledger-stream/src/client.rs
+++ w/crates/interledger-stream/src/client.rs
@@ -73,8 +73,8 @@ pub async fn send_money<S, A>(
     source_amount: u64,
 ) -> Result<(StreamDelivery, S), Error>
 where
-    S: IncomingService<A> + Clone + 'static,
-    A: Account + 'static,
+    S: IncomingService<A> + Clone,
+    A: Account,
 
@@ -233,10 +231,10 @@ where
 
             // Send it!
             self.congestion_controller.prepare(amount);
-            if let Some(ref next) = self.next {
-                let mut next = next.clone();
+            if let Some(ref mut next) = self.next {
                 let from = self.from_account.clone();
                 let request = Box::pin(async move {
                     next.handle_request(IncomingRequest { from, prepare }).await

But this results in the following error, which makes sense! The Pin<Box<T>> must live for static, and we cannot guarantee that. Or can we? (note: we must make it a pinned future to poll the pending requests)

error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
   --> crates/interledger-stream/src/client.rs:234:25
    |
234 |             if let Some(ref mut next) = self.next {
    |                         ^^^^^^^^^^^^
    |
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 183:5...
   --> crates/interledger-stream/src/client.rs:183:5
    |
183 | /     fn try_send_money(&mut self) -> Result<bool, Error> {
184 | |         let mut sent_packets = false;
185 | |         loop {
186 | |             let amount = min(
...   |
251 | |         Ok(sent_packets)
252 | |     }
    | |_____^
note: ...so that reference does not outlive borrowed content
   --> crates/interledger-stream/src/client.rs:234:25
    |
234 |             if let Some(ref mut next) = self.next {
    |                         ^^^^^^^^^^^^
    = note: but, the lifetime must be valid for the static lifetime...
    = note: ...so that the expression is assignable:
            expected std::pin::Pin<std::boxed::Box<(dyn core::future::future::Future<Output = std::result::Result<interledger_packet::packet::Fulfill, interledger_packet::packet::Reject>> + 'static)>>
               found std::pin::Pin<std::boxed::Box<dyn core::future::future::Future<Output = std::result::Result<interledger_packet::packet::Fulfill, interledger_packet::packet::Reject>>>>

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter

# Service 
* feat(service): Box wrapper methods to avoid exponential type blowup
@gakonst gakonst requested a review from dora-gt as a code owner January 29, 2020 10:17
@gakonst gakonst merged commit eb19d63 into gakonst/07-futures03-http Jan 29, 2020
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter

# Service 
* feat(service): Box wrapper methods to avoid exponential type blowup
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(btp): update traits to be async

* refactor(btp/wrapped-ws): refactor WsWrap to a separate file

Ideally, we would want to get rid of it by doing a `StreamExt::map_ok` and `SinkExt::with` to map both WebSocket return types to the same value. We also use `filter_map` to get rid of any errors from the WebSocket. The WsError type has been removed as a result of that.

* feat(btp/client): port to async/await

* feat(btp/server): move to async/await

* feat(btp/service): move service to async/await

* We refactored the service to be more readable. Basically, we split the websocket in a Sink (write) and a Stream (read). We also create a `tx`/`rx` pair per account. The rx receiver gets attached to the sink, meaning any data sent over by the `tx` sender will get forwarded to the sink, which will forward it to the other end of the websocket. Unfortunately, due to being unable to combine the read and write sockets, we have to spawn them separately. This means that we have to remove the hook which cancels the streams.

# Interledger HTTP: Futures 0.3 Transition  (#600)

* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter

# Service 
* feat(service): Box wrapper methods to avoid exponential type blowup
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(ccp): convert store traits to async/await

* feat(ccp-server): make the ccp server async

* test(ccp-server): make tests async

* chore(routing-table): limit api visibility of table methods

# Interledger BTP: Futures 0.3 Transition  (#599)

* feat(btp): update traits to be async

* refactor(btp/wrapped-ws): refactor WsWrap to a separate file

Ideally, we would want to get rid of it by doing a `StreamExt::map_ok` and `SinkExt::with` to map both WebSocket return types to the same value. We also use `filter_map` to get rid of any errors from the WebSocket. The WsError type has been removed as a result of that.

* feat(btp/client): port to async/await

* feat(btp/server): move to async/await

* feat(btp/service): move service to async/await

* We refactored the service to be more readable. Basically, we split the websocket in a Sink (write) and a Stream (read). We also create a `tx`/`rx` pair per account. The rx receiver gets attached to the sink, meaning any data sent over by the `tx` sender will get forwarded to the sink, which will forward it to the other end of the websocket. Unfortunately, due to being unable to combine the read and write sockets, we have to spawn them separately. This means that we have to remove the hook which cancels the streams.

# Interledger HTTP: Futures 0.3 Transition  (#600)

* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter

# Service 
* feat(service): Box wrapper methods to avoid exponential type blowup
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(client): convert client to async/await

* docs(ildcp): enhance docs

* feat(server): make the service async

* test(server): add tests

* # Interledger CCP: Futures 0.3 Transition (#598)

* feat(ccp): convert store traits to async/await

* feat(ccp-server): make the ccp server async

* test(ccp-server): make tests async

* chore(routing-table): limit api visibility of table methods

# Interledger BTP: Futures 0.3 Transition  (#599)

* feat(btp): update traits to be async

* refactor(btp/wrapped-ws): refactor WsWrap to a separate file

Ideally, we would want to get rid of it by doing a `StreamExt::map_ok` and `SinkExt::with` to map both WebSocket return types to the same value. We also use `filter_map` to get rid of any errors from the WebSocket. The WsError type has been removed as a result of that.

* feat(btp/client): port to async/await

* feat(btp/server): move to async/await

* feat(btp/service): move service to async/await

* We refactored the service to be more readable. Basically, we split the websocket in a Sink (write) and a Stream (read). We also create a `tx`/`rx` pair per account. The rx receiver gets attached to the sink, meaning any data sent over by the `tx` sender will get forwarded to the sink, which will forward it to the other end of the websocket. Unfortunately, due to being unable to combine the read and write sockets, we have to spawn them separately. This means that we have to remove the hook which cancels the streams.

# Interledger HTTP: Futures 0.3 Transition  (#600)

* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter

# Service 
* feat(service): Box wrapper methods to avoid exponential type blowup
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(router): upgrade to futures 0.3 and async/await

# Interledger ILDCP: Futures 0.3 Transition (#597)

* feat(client): convert client to async/await

* docs(ildcp): enhance docs

* feat(server): make the service async

* test(server): add tests

# Interledger CCP: Futures 0.3 Transition (#598)

* feat(ccp): convert store traits to async/await

* feat(ccp-server): make the ccp server async

* test(ccp-server): make tests async

* chore(routing-table): limit api visibility of table methods

# Interledger BTP: Futures 0.3 Transition  (#599)

* feat(btp): update traits to be async

* refactor(btp/wrapped-ws): refactor WsWrap to a separate file

Ideally, we would want to get rid of it by doing a `StreamExt::map_ok` and `SinkExt::with` to map both WebSocket return types to the same value. We also use `filter_map` to get rid of any errors from the WebSocket. The WsError type has been removed as a result of that.

* feat(btp/client): port to async/await

* feat(btp/server): move to async/await

* feat(btp/service): move service to async/await

* We refactored the service to be more readable. Basically, we split the websocket in a Sink (write) and a Stream (read). We also create a `tx`/`rx` pair per account. The rx receiver gets attached to the sink, meaning any data sent over by the `tx` sender will get forwarded to the sink, which will forward it to the other end of the websocket. Unfortunately, due to being unable to combine the read and write sockets, we have to spawn them separately. This means that we have to remove the hook which cancels the streams.

# Interledger HTTP: Futures 0.3 Transition  (#600)

* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter

# Service 
* feat(service): Box wrapper methods to avoid exponential type blowup
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(service): upgrade to futures 0.3 and async/await

* feat(service): Box wrapper methods to avoid exponential type blowup

Relevant rust-lang issue: rust-lang/rust#68508

* docs(service): add explanation on IlpResult

* chore(service): remove unused associated type

* # Interledger Router: Futures 0.3 Transition (#595)

* feat(router): upgrade to futures 0.3 and async/await

# Interledger ILDCP: Futures 0.3 Transition (#597)

* feat(client): convert client to async/await

* docs(ildcp): enhance docs

* feat(server): make the service async

* test(server): add tests

# Interledger CCP: Futures 0.3 Transition (#598)

* feat(ccp): convert store traits to async/await

* feat(ccp-server): make the ccp server async

* test(ccp-server): make tests async

* chore(routing-table): limit api visibility of table methods

# Interledger BTP: Futures 0.3 Transition  (#599)

* feat(btp): update traits to be async

* refactor(btp/wrapped-ws): refactor WsWrap to a separate file

Ideally, we would want to get rid of it by doing a `StreamExt::map_ok` and `SinkExt::with` to map both WebSocket return types to the same value. We also use `filter_map` to get rid of any errors from the WebSocket. The WsError type has been removed as a result of that.

* feat(btp/client): port to async/await

* feat(btp/server): move to async/await

* feat(btp/service): move service to async/await

* We refactored the service to be more readable. Basically, we split the websocket in a Sink (write) and a Stream (read). We also create a `tx`/`rx` pair per account. The rx receiver gets attached to the sink, meaning any data sent over by the `tx` sender will get forwarded to the sink, which will forward it to the other end of the websocket. Unfortunately, due to being unable to combine the read and write sockets, we have to spawn them separately. This means that we have to remove the hook which cancels the streams.

# Interledger HTTP: Futures 0.3 Transition  (#600)

* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter
gakonst added a commit that referenced this pull request Jan 29, 2020
* feat(packet): implement From<Fulfill/Reject> for bytes05::BytesMut

ILP-Packet is built using Bytes 0.4. The Futures 0.3 ecosystem's HTTP crates use Bytes 0.5.
Porting this crate to use Bytes 0.5 is non-trivial due to significant breaking changes in the
Bytes API:

tokio-rs/bytes#350
tokio-rs/bytes#288

# Interledger Service: Futures 0.3 Transition (#596)

* feat(service): upgrade to futures 0.3 and async/await

* feat(service): Box wrapper methods to avoid exponential type blowup

Relevant rust-lang issue: rust-lang/rust#68508

* docs(service): add explanation on IlpResult

* chore(service): remove unused associated type

# Interledger Router: Futures 0.3 Transition (#595)

* feat(router): upgrade to futures 0.3 and async/await

# Interledger ILDCP: Futures 0.3 Transition (#597)

* feat(client): convert client to async/await

* docs(ildcp): enhance docs

* feat(server): make the service async

* test(server): add tests

# Interledger CCP: Futures 0.3 Transition (#598)

* feat(ccp): convert store traits to async/await

* feat(ccp-server): make the ccp server async

* test(ccp-server): make tests async

* chore(routing-table): limit api visibility of table methods

# Interledger BTP: Futures 0.3 Transition  (#599)

* feat(btp): update traits to be async

* refactor(btp/wrapped-ws): refactor WsWrap to a separate file

Ideally, we would want to get rid of it by doing a `StreamExt::map_ok` and `SinkExt::with` to map both WebSocket return types to the same value. We also use `filter_map` to get rid of any errors from the WebSocket. The WsError type has been removed as a result of that.

* feat(btp/client): port to async/await

* feat(btp/server): move to async/await

* feat(btp/service): move service to async/await

* We refactored the service to be more readable. Basically, we split the websocket in a Sink (write) and a Stream (read). We also create a `tx`/`rx` pair per account. The rx receiver gets attached to the sink, meaning any data sent over by the `tx` sender will get forwarded to the sink, which will forward it to the other end of the websocket. Unfortunately, due to being unable to combine the read and write sockets, we have to spawn them separately. This means that we have to remove the hook which cancels the streams.

# Interledger HTTP: Futures 0.3 Transition  (#600)

* feat(http): Update HttpStore trait to futures 0.3 and deserialize_json method

* feat(http): Update HTTP Errors and client

* feat(http): Update HTTP Server

* docs(http): extend http docs

# Interledger Stream: Futures 0.3 Transition  (#601)

* feat(stream): Update Stream server

* feat(stream): Update Stream client

* docs(stream): extend stream docs

* fix(stream): add extra limits to ensure all the pending request futures are thread safe

# Interledger Settlement: Futures 0.3 Transition  (#602)

* feat(settlement/core): Upgrade types and idempotency

* feat(settlement/core): Upgrade engines API Warp interface

* feat(settlement/core): Upgrade Redis backend implementation

* feat(settlement/api): Upgrade the message service

* feat(settlement/api): Upgrade the settlement client

* feat(settlement/api): Upgrade the Settlement API exposed by the node

* chore(settlement): remove need to pass future wrapped in closure

* docs(settlement): extend settlement docs

# Interledger SPSP: Futures 0.3 Transition (#603)

* feat(spsp): move to futures 0.3 and async/await

* docs(spsp): extend spsp docs

* fix(spsp): tighten trait bounds to account for stream changes

# Interledger Service Util: Futures 0.3 Transition  (#604)

* feat(service-util): update validator service

* feat(service-util): update rate limit service

* feat(service-util): update max packet amount service

* feat(service-util): update expiry shortener service

* feat(service-util): update exchange rate service and providers

* feat(service-util): update echo service

* feat(service-util): update balance service

# Interledger API: Futures 0.3 Transition  (#605)

* feat(api): update trait definitions and dependencies

* feat(api): update http retry client

* test(api): migrate test helpers

* feat(api): update node-settings route

* test(api): update node-settings route tests

* feat(api): update accounts route

* test(api): update accounts route tests

* chore(api): add missing doc

# Interledger Store: Futures 0.3 Transition (#606)

* feat(store): Update redis reconnect

* feat(store): Update base redis struct

* feat(store): Update AccountStore trait

* feat(store): Update StreamNotificationsStore trait

* feat(store): Update BalanceStore trait

* feat(store): Update BtpStore trait

* feat(store): Update HttpStore trait

* feat(store): Update NodeStore trait

* feat(store): Update AddressStore trait

* feat(store): Update RouteManagerStore trait

* feat(store): Update RateLimitStore trait

* feat(store): Update IdempotentStore trait

* feat(store): Update SettlementStore trait

* feat(store): Update LeftoversStore trait

* feat(store): Update update_routes

* test(store): convert all tests to tokio::test with async/await

* feat(store): update secrecy/bytes/zeroize

* docs(store): add more docs

# ILP CLI: Futures 0.3 Transition (#607)

* feat(ilp-cli): update CLI to async/await

# ILP Node: Futures 0.3 Transition (#608) (#609)

* test(ilp-node): migrate tests to futures 0.3

* feat(ilp-node): move metrics related files to feature-gated module

* feat(ilp-node): remove deprecated insert account function

* feat(ilp-node): make the node run on async/await

* ci(ilp-node): disable some advisories and update README

* fix(ilp-node): spawn prometheus filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants