Skip to content

smite-scenarios: ignore unknown odd-type messages#59

Open
morehouse wants to merge 1 commit intomasterfrom
executor_ignore_unknown_odd
Open

smite-scenarios: ignore unknown odd-type messages#59
morehouse wants to merge 1 commit intomasterfrom
executor_ignore_unknown_odd

Conversation

@morehouse
Copy link
Copy Markdown
Owner

BOLT 1 requires nodes to ignore unknown message types if the type is odd. In particular, Eclair sends various custom informational messages (e.g., recommended_feerates as type 39409) that interfere with message processing if we fail to ignore them.

This change is required to actually extract any accept_channel response from Eclair.

Ref: #5 (Milestone 1)

BOLT 1 requires nodes to ignore unknown message types if the type is
odd.  In particular, eclair sends various custom informational messages
(e.g., recommended_feerates == type 39409) that interfere with message
processing if we fail to ignore them.
Copy link
Copy Markdown
Contributor

@ekzyis ekzyis left a comment

Choose a reason for hiding this comment

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

LGTM, just one question:

In particular, Eclair sends various custom informational messages (e.g., recommended_feerates as type 39409) that interfere with message processing if we fail to ignore them.

This change is required to actually extract any accept_channel response from Eclair.

I wanted to reproduce this with a open_channel scenario prototype, but I'm getting this error when running the existing init scenario with eclair:

[-] The program took more than 1000 ms to process one of the initial test cases.
    This is bad news; raising the limit with the -t option is possible, but
    will probably make the fuzzing process extremely slow.

    If this test case is just a fluke, the other option is to just avoid it
    altogether, and find one that is less of a CPU hog.

[-] PROGRAM ABORT : Test case 'id:000000,time:0,execs:0,orig:seed1' results in a timeout
         Location : perform_dry_run(), src/afl-fuzz-init.c:1014

The encrypted_bytes scenario has a warning about slow exec/s (less than 90/sec).

Are these different issues? Is the init scenario with eclair working for you?

@morehouse
Copy link
Copy Markdown
Owner Author

LGTM, just one question:

In particular, Eclair sends various custom informational messages (e.g., recommended_feerates as type 39409) that interfere with message processing if we fail to ignore them.
This change is required to actually extract any accept_channel response from Eclair.

I wanted to reproduce this with a open_channel scenario prototype, but I'm getting this error when running the existing init scenario with eclair:

[-] The program took more than 1000 ms to process one of the initial test cases.
    This is bad news; raising the limit with the -t option is possible, but
    will probably make the fuzzing process extremely slow.

    If this test case is just a fluke, the other option is to just avoid it
    altogether, and find one that is less of a CPU hog.

[-] PROGRAM ABORT : Test case 'id:000000,time:0,execs:0,orig:seed1' results in a timeout
         Location : perform_dry_run(), src/afl-fuzz-init.c:1014

The encrypted_bytes scenario has a warning about slow exec/s (less than 90/sec).

Are these different issues? Is the init scenario with eclair working for you?

Yes, eclair is really slow. But I think the main issue you're hitting is ACINQ/eclair#3271.

That issue was fixed upstream but hasn't been release yet, so I haven't updated our workflow to use it. This is the patch I use locally:

diff --git a/smite-scenarios/src/targets/eclair.rs b/smite-scenarios/src/targets/eclair.rs
index bfe97a3..1c345f7 100644
--- a/smite-scenarios/src/targets/eclair.rs
+++ b/smite-scenarios/src/targets/eclair.rs
@@ -119,6 +119,7 @@ impl EclairTarget {
         // which inherits our crash handler wrapper and could trigger a false
         // crash report on exit().
         cmd.arg("-no-version-check")
+            .arg("-Declair.allow-unsafe-startup=true")
             .arg(format!("-Declair.datadir={}", eclair_dir.display()))
             .stdout(Stdio::null())
             .stderr(Stdio::null());
diff --git a/workloads/eclair/Dockerfile b/workloads/eclair/Dockerfile
index 4027dce..4b08940 100644
--- a/workloads/eclair/Dockerfile
+++ b/workloads/eclair/Dockerfile
@@ -2,8 +2,8 @@
 FROM eclipse-temurin:21 AS builder
 
 # Build arguments
-ARG ECLAIR_VERSION=v0.13.1
-ARG BITCOIN_VERSION=29.2
+ARG ECLAIR_COMMIT=fde8de65ffd984f071ea1cc9657dbf710f52994f
+ARG BITCOIN_VERSION=30.2
 ARG SCENARIO
 
 # Install build dependencies.
@@ -28,9 +28,10 @@ RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${B
     mv bitcoin-${BITCOIN_VERSION}/bin/bitcoin-cli /usr/local/bin/bitcoin-cli && \
     rm -rf bitcoin-${BITCOIN_VERSION}*
 
-# Clone and build Eclair.
-RUN git clone --depth 1 --branch ${ECLAIR_VERSION} https://github.com/ACINQ/eclair.git /eclair-src
+# Clone Eclair at a specific commit and apply the deserialization fix patch.
+RUN git clone https://github.com/ACINQ/eclair.git /eclair-src
 WORKDIR /eclair-src
+RUN git checkout ${ECLAIR_COMMIT}
 RUN ./mvnw package -DskipTests -pl eclair-node -am
 
 # Unzip the Eclair distribution to /opt/eclair/.
diff --git a/workloads/eclair/Dockerfile.coverage b/workloads/eclair/Dockerfile.coverage
index ff9b83d..8ea338a 100644
--- a/workloads/eclair/Dockerfile.coverage
+++ b/workloads/eclair/Dockerfile.coverage
@@ -2,8 +2,8 @@
 FROM eclipse-temurin:21 AS builder
 
 # Build arguments
-ARG ECLAIR_VERSION=v0.13.1
-ARG BITCOIN_VERSION=29.2
+ARG ECLAIR_COMMIT=fde8de65ffd984f071ea1cc9657dbf710f52994f
+ARG BITCOIN_VERSION=30.2
 ARG SCENARIO
 ARG JACOCO_VERSION=0.8.14
 
@@ -35,8 +35,9 @@ RUN wget https://github.com/jacoco/jacoco/releases/download/v${JACOCO_VERSION}/j
     rm jacoco-${JACOCO_VERSION}.zip
 
 # Clone and build Eclair.
-RUN git clone --depth 1 --branch ${ECLAIR_VERSION} https://github.com/ACINQ/eclair.git /eclair-src
+RUN git clone https://github.com/ACINQ/eclair.git /eclair-src
 WORKDIR /eclair-src
+RUN git checkout ${ECLAIR_COMMIT}
 RUN ./mvnw package -DskipTests -pl eclair-node -am
 
 # Unzip the Eclair distribution to /opt/eclair/.

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.

2 participants