Skip to content

Commit 3231a57

Browse files
authored
Revive all features and investigate type length limit error (#609)
* ci(node): revive all features * feat(service): Box wrapper methods to avoid exponential type blowup * fix(ilp-node): spawn prometheus filter
1 parent adf5fa0 commit 3231a57

File tree

9 files changed

+239
-41
lines changed

9 files changed

+239
-41
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
command: printf "[profile.dev]\ncodegen-units = 1\n" >> Cargo.toml
2727
- run:
2828
name: Build
29-
command: cargo build # --all-features --all-targets
29+
command: cargo build --all-features --all-targets
3030
- run:
3131
name: Test
3232
# Note the timeout is included to make sure that they
3333
# do not run for more than 10 minutes under any circumstances
3434
# (We have had issues with bugs causing the tests to "run"
3535
# for 5 hours, wasting a ton of compute credits)
36-
command: timeout 10m cargo test # --all --all-features
36+
command: timeout 10m cargo test --all --all-features
3737
environment:
3838
- RUST_LOG: "interledger=trace"
3939
- RUST_BACKTRACE: "full"

crates/ilp-node/src/instrumentation/google_pubsub.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ type BoxedIlpFuture = Box<dyn Future<Output = IlpResult> + Send + 'static>;
6363
/// of fulfilled packets to Google Cloud PubSub.
6464
///
6565
/// This is an experimental feature that may be removed in the future.
66-
pub fn create_google_pubsub_wrapper<
67-
A: Account + 'static,
68-
O: OutgoingService<A> + Clone + Send + 'static,
69-
>(
66+
pub fn create_google_pubsub_wrapper<A: Account + 'static>(
7067
config: Option<PubsubConfig>,
71-
) -> impl Fn(OutgoingRequest<A>, O) -> Pin<BoxedIlpFuture> + Clone {
68+
) -> impl Fn(OutgoingRequest<A>, Box<dyn OutgoingService<A> + Send>) -> Pin<BoxedIlpFuture> + Clone
69+
{
7270
// If Google credentials were passed in, create an HTTP client and
7371
// OAuth2 client that will automatically fetch and cache access tokens
7472
let utilities = if let Some(config) = config {
@@ -92,7 +90,9 @@ pub fn create_google_pubsub_wrapper<
9290
None
9391
};
9492

95-
move |request: OutgoingRequest<A>, mut next: O| -> Pin<BoxedIlpFuture> {
93+
move |request: OutgoingRequest<A>,
94+
mut next: Box<dyn OutgoingService<A> + Send>|
95+
-> Pin<BoxedIlpFuture> {
9696
let (client, api_endpoint, token_fetcher) = if let Some(utilities) = utilities.clone() {
9797
utilities
9898
} else {

crates/ilp-node/src/instrumentation/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::time::Instant;
99

1010
pub async fn incoming_metrics<A: Account + CcpRoutingAccount>(
1111
request: IncomingRequest<A>,
12-
mut next: impl IncomingService<A>,
12+
mut next: Box<dyn IncomingService<A> + Send>,
1313
) -> IlpResult {
1414
let labels = labels!(
1515
"from_asset_code" => request.from.asset_code().to_string(),
@@ -43,7 +43,7 @@ pub async fn incoming_metrics<A: Account + CcpRoutingAccount>(
4343

4444
pub async fn outgoing_metrics<A: Account + CcpRoutingAccount>(
4545
request: OutgoingRequest<A>,
46-
mut next: impl OutgoingService<A>,
46+
mut next: Box<dyn OutgoingService<A> + Send>,
4747
) -> IlpResult {
4848
let labels = labels!(
4949
"from_asset_code" => request.from.asset_code().to_string(),

crates/ilp-node/src/instrumentation/prometheus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub async fn serve_prometheus(node: InterledgerNode) -> Result<(), ()> {
7979
prometheus.bind_address
8080
);
8181

82-
warp::serve(filter).bind(prometheus.bind_address).await;
82+
tokio::spawn(warp::serve(filter).bind(prometheus.bind_address));
8383
Ok(())
8484
}
8585
Err(e) => {

crates/ilp-node/src/instrumentation/trace.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use uuid::Uuid;
1515
/// level and more information for the DEBUG level.
1616
pub async fn trace_incoming<A: Account>(
1717
request: IncomingRequest<A>,
18-
mut next: impl IncomingService<A>,
18+
mut next: Box<dyn IncomingService<A> + Send>,
1919
) -> IlpResult {
2020
let request_span = error_span!(target: "interledger-node",
2121
"incoming",
@@ -47,7 +47,7 @@ pub async fn trace_incoming<A: Account>(
4747
/// level and more information for the DEBUG level.
4848
pub async fn trace_forwarding<A: Account>(
4949
request: OutgoingRequest<A>,
50-
mut next: impl OutgoingService<A>,
50+
mut next: Box<dyn OutgoingService<A> + Send>,
5151
) -> IlpResult {
5252
// Here we only include the outgoing details because this will be
5353
// inside the "incoming" span that includes the other details
@@ -73,7 +73,7 @@ pub async fn trace_forwarding<A: Account>(
7373
/// level and more information for the DEBUG level.
7474
pub async fn trace_outgoing<A: Account + CcpRoutingAccount>(
7575
request: OutgoingRequest<A>,
76-
mut next: impl OutgoingService<A>,
76+
mut next: Box<dyn OutgoingService<A> + Send>,
7777
) -> IlpResult {
7878
let request_span = error_span!(target: "interledger-node",
7979
"outgoing",

crates/ilp-node/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// #![type_length_limit = "25000000"]
2-
// #![type_length_limit = "1500000"] // needed to cargo build --bin ilp-node --feature "monitoring"
3-
#![type_length_limit = "80000000"] // needed to cargo build --all-features --all-targets
4-
1+
#![type_length_limit = "5000000"]
52
mod instrumentation;
63
mod node;
74

crates/ilp-node/src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// #![type_length_limit = "1500000"] // this is enough for cargo build --bin ilp-node
2-
// #![type_length_limit = "13500000"] // this is enough for cargo build --bin ilp-node --feature monitoring
3-
#![type_length_limit = "80000000"] // this is enough for cargo build --all-features --all-targets
4-
1+
#![type_length_limit = "5000000"]
52
mod instrumentation;
63
pub mod node;
74

crates/ilp-node/tests/redis/redis_tests.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// #![type_length_limit = "5000000"] // this is needed for cargo test
2-
#![type_length_limit = "40000000"] // this is needed for cargo test --all-features --all
3-
1+
#![type_length_limit = "5000000"]
42
mod btp;
53
mod exchange_rates;
64
mod three_nodes;

0 commit comments

Comments
 (0)