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

Revive all features and investigate type length limit error #609

Merged
merged 7 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
command: printf "[profile.dev]\ncodegen-units = 1\n" >> Cargo.toml
- run:
name: Build
command: cargo build # --all-features --all-targets
command: cargo build --all-features --all-targets
- run:
name: Test
# Note the timeout is included to make sure that they
# do not run for more than 10 minutes under any circumstances
# (We have had issues with bugs causing the tests to "run"
# for 5 hours, wasting a ton of compute credits)
command: timeout 10m cargo test # --all --all-features
command: timeout 10m cargo test --all --all-features
environment:
- RUST_LOG: "interledger=trace"
- RUST_BACKTRACE: "full"
Expand Down
12 changes: 6 additions & 6 deletions crates/ilp-node/src/instrumentation/google_pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ type BoxedIlpFuture = Box<dyn Future<Output = IlpResult> + Send + 'static>;
/// of fulfilled packets to Google Cloud PubSub.
///
/// This is an experimental feature that may be removed in the future.
pub fn create_google_pubsub_wrapper<
A: Account + 'static,
O: OutgoingService<A> + Clone + Send + 'static,
>(
pub fn create_google_pubsub_wrapper<A: Account + 'static>(
config: Option<PubsubConfig>,
) -> impl Fn(OutgoingRequest<A>, O) -> Pin<BoxedIlpFuture> + Clone {
) -> impl Fn(OutgoingRequest<A>, Box<dyn OutgoingService<A> + Send>) -> Pin<BoxedIlpFuture> + Clone
{
// If Google credentials were passed in, create an HTTP client and
// OAuth2 client that will automatically fetch and cache access tokens
let utilities = if let Some(config) = config {
Expand All @@ -92,7 +90,9 @@ pub fn create_google_pubsub_wrapper<
None
};

move |request: OutgoingRequest<A>, mut next: O| -> Pin<BoxedIlpFuture> {
move |request: OutgoingRequest<A>,
mut next: Box<dyn OutgoingService<A> + Send>|
-> Pin<BoxedIlpFuture> {
let (client, api_endpoint, token_fetcher) = if let Some(utilities) = utilities.clone() {
utilities
} else {
Expand Down
4 changes: 2 additions & 2 deletions crates/ilp-node/src/instrumentation/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::time::Instant;

pub async fn incoming_metrics<A: Account + CcpRoutingAccount>(
request: IncomingRequest<A>,
mut next: impl IncomingService<A>,
mut next: Box<dyn IncomingService<A> + Send>,
) -> IlpResult {
let labels = labels!(
"from_asset_code" => request.from.asset_code().to_string(),
Expand Down Expand Up @@ -43,7 +43,7 @@ pub async fn incoming_metrics<A: Account + CcpRoutingAccount>(

pub async fn outgoing_metrics<A: Account + CcpRoutingAccount>(
request: OutgoingRequest<A>,
mut next: impl OutgoingService<A>,
mut next: Box<dyn OutgoingService<A> + Send>,
) -> IlpResult {
let labels = labels!(
"from_asset_code" => request.from.asset_code().to_string(),
Expand Down
2 changes: 1 addition & 1 deletion crates/ilp-node/src/instrumentation/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub async fn serve_prometheus(node: InterledgerNode) -> Result<(), ()> {
prometheus.bind_address
);

warp::serve(filter).bind(prometheus.bind_address).await;
tokio::spawn(warp::serve(filter).bind(prometheus.bind_address));
Ok(())
}
Err(e) => {
Expand Down
6 changes: 3 additions & 3 deletions crates/ilp-node/src/instrumentation/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use uuid::Uuid;
/// level and more information for the DEBUG level.
pub async fn trace_incoming<A: Account>(
request: IncomingRequest<A>,
mut next: impl IncomingService<A>,
mut next: Box<dyn IncomingService<A> + Send>,
) -> IlpResult {
let request_span = error_span!(target: "interledger-node",
"incoming",
Expand Down Expand Up @@ -47,7 +47,7 @@ pub async fn trace_incoming<A: Account>(
/// level and more information for the DEBUG level.
pub async fn trace_forwarding<A: Account>(
request: OutgoingRequest<A>,
mut next: impl OutgoingService<A>,
mut next: Box<dyn OutgoingService<A> + Send>,
) -> IlpResult {
// Here we only include the outgoing details because this will be
// inside the "incoming" span that includes the other details
Expand All @@ -73,7 +73,7 @@ pub async fn trace_forwarding<A: Account>(
/// level and more information for the DEBUG level.
pub async fn trace_outgoing<A: Account + CcpRoutingAccount>(
request: OutgoingRequest<A>,
mut next: impl OutgoingService<A>,
mut next: Box<dyn OutgoingService<A> + Send>,
) -> IlpResult {
let request_span = error_span!(target: "interledger-node",
"outgoing",
Expand Down
5 changes: 1 addition & 4 deletions crates/ilp-node/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// #![type_length_limit = "25000000"]
// #![type_length_limit = "1500000"] // needed to cargo build --bin ilp-node --feature "monitoring"
#![type_length_limit = "80000000"] // needed to cargo build --all-features --all-targets

#![type_length_limit = "5000000"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you experiment to see if these changes remove the need for this attribute at all?

mod instrumentation;
mod node;

Expand Down
5 changes: 1 addition & 4 deletions crates/ilp-node/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// #![type_length_limit = "1500000"] // this is enough for cargo build --bin ilp-node
// #![type_length_limit = "13500000"] // this is enough for cargo build --bin ilp-node --feature monitoring
#![type_length_limit = "80000000"] // this is enough for cargo build --all-features --all-targets

#![type_length_limit = "5000000"]
mod instrumentation;
pub mod node;

Expand Down
4 changes: 1 addition & 3 deletions crates/ilp-node/tests/redis/redis_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// #![type_length_limit = "5000000"] // this is needed for cargo test
#![type_length_limit = "40000000"] // this is needed for cargo test --all-features --all

#![type_length_limit = "5000000"]
mod btp;
mod exchange_rates;
mod three_nodes;
Expand Down
Loading