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

Please assist in reproducing version 1.4.0 of your app #112

Open
Giszmo opened this issue Oct 24, 2020 · 22 comments
Open

Please assist in reproducing version 1.4.0 of your app #112

Giszmo opened this issue Oct 24, 2020 · 22 comments

Comments

@Giszmo
Copy link

Giszmo commented Oct 24, 2020

I tried to reproduce the latest version 1.4.0 of Phoenix and got a significant diff as also documented here.

@dpad85
Copy link
Member

dpad85 commented Oct 25, 2020 via email

@Giszmo
Copy link
Author

Giszmo commented Oct 25, 2020

Oh! Ok. That means I should try this on a different system because I have issues reproducing one other repositpry, too in a very weird way. Check out this issue.

And sqldelight is not giving this issue attention since 10 months.

@Giszmo
Copy link
Author

Giszmo commented Oct 25, 2020

I now ran my test script on a different machine (Digital Ocean server) and got a similar huge diff.

In contrast to Mycelium, I did not use disorderfs, partly because I'm not sure where to add it to the mix. Your build instructions include docker build as a way to get the current revision into the docker container here.

(I find it surprising you are adding the folder in the Dockerfile opposed to binding it as a --volume in the docker run later. This makes the image highly revision specific, unnecessarily so I would think.)

The diff from my server:

Results:
appId:          fr.acinq.phoenix.mainnet
signer:         ed550bd5d607d342b61bbbbb94ffd4dde43f845171f63d3ae47573a95a132629
apkVersionName: 1.4.0
apkVersionCode: 15
apkHash:        4689d6249e86442ab3657756d9971c9b0894051728dab214a43778665bbc9d43

Diff:
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/apktool.yml and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/apktool.yml differ
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/original/META-INF: MAINNET.RSA
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/original/META-INF: MAINNET.SF
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/original/META-INF/MANIFEST.MF and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/original/META-INF/MANIFEST.MF differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/DatabaseImpl$Schema.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/DatabaseImpl$Schema.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$get$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$get$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$get$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$get$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$getByChannelId$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$getByChannelId$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$getByChannelId$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$getByChannelId$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetByChannelIdQuery$execute$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetByChannelIdQuery$execute$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetByChannelIdQuery.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetByChannelIdQuery.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetQuery$execute$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetQuery$execute$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetQuery.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$GetQuery.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertClosing$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertClosing$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertClosing$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertClosing$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertEmpty$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertEmpty$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertEmpty$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertEmpty$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapIn$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapIn$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapIn$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapIn$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapOut$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapOut$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapOut$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$insertSwapOut$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setChannelClosingError$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setChannelClosingError$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setChannelClosingError$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setChannelClosingError$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setDesc$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setDesc$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setDesc$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl$setDesc$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PaymentMetaQueriesImpl.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$get$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$get$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$get$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$get$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$GetQuery$execute$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$GetQuery$execute$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$GetQuery.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$GetQuery.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$insert$1.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$insert$1.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$insert$2.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$insert$2.smali differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl.smali and /tmp/fromBuild_fr.acinq.phoenix.mainnet_15/smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl.smali differ

and yes, all the diffs are DB related.

@Giszmo
Copy link
Author

Giszmo commented Oct 25, 2020

Here is some output from diffoscope:

├── classes3.dex
│ ├── classes3.jar
│ │ ├── zipinfo -v {}
│ │ │ @@ -57730,15 +57730,15 @@
│ │ │    version of encoding software:                   2.0
│ │ │    minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
│ │ │    minimum software version required to extract:   2.0
│ │ │    compression method:                             none (stored)
│ │ │    file security status:                           not encrypted
│ │ │    extended local header:                          no
│ │ │    file last modified on (DOS date/time):          1980 Jan 1 00:00:00
│ │ │ -  32-bit CRC value (hex):                         0a05a582
│ │ │ +  32-bit CRC value (hex):                         3d297c31
│ │ │    compressed size:                                2235 bytes
│ │ │    uncompressed size:                              2235 bytes
│ │ │    length of filename:                             46 characters
│ │ │    length of extra field:                          0 bytes
│ │ │    length of file comment:                         0 characters
│ │ │    disk number on which file begins:               disk 1
│ │ │    apparent file type:                             binary
│ │ ├── fr/acinq/phoenix/app/DatabaseImpl$Schema.class
│ │ │ ├── procyon -ec {}
│ │ │ │ @@ -15,18 +15,18 @@
│ │ │ │          INSTANCE = new DatabaseImpl$Schema();
│ │ │ │      }
│ │ │ │      
│ │ │ │      public void create(final SqlDriver sqlDriver) {
│ │ │ │          Intrinsics.checkNotNullParameter((Object)sqlDriver, "driver");
│ │ │ │          final int n = 8;
│ │ │ │          SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE TABLE NodeMeta (\n  pub_key TEXT NOT NULL PRIMARY KEY,\n  alias TEXT NOT NULL,\n  update_timestamp INTEGER NOT NULL,\n  custom_alias TEXT\n)", 0, (Function1)null, n, (Object)null);
│ │ │ │ -        SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE TABLE PaymentMeta (\n  id TEXT NOT NULL PRIMARY KEY,\n\n  swap_in_address TEXT DEFAULT NULL,\n  swap_in_tx TEXT DEFAULT NULL,\n\n  swap_out_address TEXT DEFAULT NULL,\n  swap_out_tx TEXT DEFAULT NULL,\n  swap_out_feerate_per_byte INTEGER DEFAULT NULL,\n  swap_out_fee_sat INTEGER DEFAULT NULL,\n  swap_out_conf INTEGER DEFAULT NULL,\n\n  funding_tx TEXT DEFAULT NULL,\n  funding_fee_pct REAL DEFAULT NULL,\n  funding_fee_raw_sat INTEGER DEFAULT NULL,\n\n  closing_type INTEGER DEFAULT NULL,\n  closing_channel_id TEXT UNIQUE DEFAULT NULL,\n  closing_spending_txs TEXT DEFAULT NULL,\n  closing_main_output_script TEXT DEFAULT NULL,\n  closing_cause TEXT DEFAULT NULL,\n\n  custom_desc TEXT DEFAULT NULL\n)", 0, (Function1)null, n, (Object)null);
│ │ │ │          SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE TABLE PayToOpenMeta (\n  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n  payment_hash TEXT NOT NULL,\n  fee_sat INTEGER NOT NULL,\n  amount_sat INTEGER NOT NULL,\n  capacity_sat INTEGER NOT NULL,\n  timestamp INTEGER NOT NULL\n)", 0, (Function1)null, n, (Object)null);
│ │ │ │ -        SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE INDEX IF NOT EXISTS payment_closing_channel_id_index ON PaymentMeta(closing_channel_id)", 0, (Function1)null, n, (Object)null);
│ │ │ │ +        SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE TABLE PaymentMeta (\n  id TEXT NOT NULL PRIMARY KEY,\n\n  swap_in_address TEXT DEFAULT NULL,\n  swap_in_tx TEXT DEFAULT NULL,\n\n  swap_out_address TEXT DEFAULT NULL,\n  swap_out_tx TEXT DEFAULT NULL,\n  swap_out_feerate_per_byte INTEGER DEFAULT NULL,\n  swap_out_fee_sat INTEGER DEFAULT NULL,\n  swap_out_conf INTEGER DEFAULT NULL,\n\n  funding_tx TEXT DEFAULT NULL,\n  funding_fee_pct REAL DEFAULT NULL,\n  funding_fee_raw_sat INTEGER DEFAULT NULL,\n\n  closing_type INTEGER DEFAULT NULL,\n  closing_channel_id TEXT UNIQUE DEFAULT NULL,\n  closing_spending_txs TEXT DEFAULT NULL,\n  closing_main_output_script TEXT DEFAULT NULL,\n  closing_cause TEXT DEFAULT NULL,\n\n  custom_desc TEXT DEFAULT NULL\n)", 0, (Function1)null, n, (Object)null);
│ │ │ │          SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE INDEX IF NOT EXISTS paytoopen_payment_hash_index ON PayToOpenMeta(payment_hash)", 0, (Function1)null, n, (Object)null);
│ │ │ │ +        SqlDriver$DefaultImpls.execute$default(sqlDriver, (Integer)null, "CREATE INDEX IF NOT EXISTS payment_closing_channel_id_index ON PaymentMeta(closing_channel_id)", 0, (Function1)null, n, (Object)null);
│ │ │ │      }
│ │ │ │      
│ │ │ │      public int getVersion() {
│ │ │ │          return 1;
│ │ │ │      }
│ │ │ │      
│ │ │ │      public void migrate(final SqlDriver sqlDriver, final int n, final int n2) {
├── smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl$get$2.smali
│ @@ -96,15 +96,15 @@
│  
│      const-string v0, "payment_hash"
│  
│      move-object/from16 v4, p3
│  
│      invoke-static {v4, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
│  
│ -    .line 447
│ +    .line 191
│      new-instance v0, Lfr/acinq/phoenix/db/PayToOpenMeta;
│  
│      move-object v1, v0
│  
│      move-wide v2, p1
│  
│      move-wide/from16 v5, p4
│ @@ -119,15 +119,15 @@
│  
│      return-object v0
│  .end method
│  
│  .method public bridge synthetic invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
│      .locals 13
│  
│ -    .line 421
│ +    .line 165
│      move-object v0, p1
│  
│      check-cast v0, Ljava/lang/Number;
│  
│      invoke-virtual {v0}, Ljava/lang/Number;->longValue()J
│  
│      move-result-wide v2
├── smali_classes3/fr/acinq/phoenix/app/DatabaseImpl$Schema.smali
│ @@ -100,30 +100,30 @@
│      const/4 v7, 0x0
│  
│      move-object v1, p1
│  
│      .line 44
│      invoke-static/range {v1 .. v7}, Lcom/squareup/sqldelight/db/SqlDriver$DefaultImpls;->execute$default(Lcom/squareup/sqldelight/db/SqlDriver;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
│  
│ -    const-string v3, "CREATE TABLE PaymentMeta (\n  id TEXT NOT NULL PRIMARY KEY,\n\n  swap_in_address TEXT DEFAULT NULL,\n  swap_in_tx TEXT DEFAULT NULL,\n\n  swap_out_address TEXT DEFAULT NULL,\n  swap_out_tx TEXT DEFAULT NULL,\n  swap_out_feerate_per_byte INTEGER DEFAULT NULL,\n  swap_out_fee_sat INTEGER DEFAULT NULL,\n  swap_out_conf INTEGER DEFAULT NULL,\n\n  funding_tx TEXT DEFAULT NULL,\n  funding_fee_pct REAL DEFAULT NULL,\n  funding_fee_raw_sat INTEGER DEFAULT NULL,\n\n  closing_type INTEGER DEFAULT NULL,\n  closing_channel_id TEXT UNIQUE DEFAULT NULL,\n  closing_spending_txs TEXT DEFAULT NULL,\n  closing_main_output_script TEXT DEFAULT NULL,\n  closing_cause TEXT DEFAULT NULL,\n\n  custom_desc TEXT DEFAULT NULL\n)"
│ +    const-string v3, "CREATE TABLE PayToOpenMeta (\n  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n  payment_hash TEXT NOT NULL,\n  fee_sat INTEGER NOT NULL,\n  amount_sat INTEGER NOT NULL,\n  capacity_sat INTEGER NOT NULL,\n  timestamp INTEGER NOT NULL\n)"
│  
│      .line 52
│      invoke-static/range {v1 .. v7}, Lcom/squareup/sqldelight/db/SqlDriver$DefaultImpls;->execute$default(Lcom/squareup/sqldelight/db/SqlDriver;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
│  
│ -    const-string v3, "CREATE TABLE PayToOpenMeta (\n  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n  payment_hash TEXT NOT NULL,\n  fee_sat INTEGER NOT NULL,\n  amount_sat INTEGER NOT NULL,\n  capacity_sat INTEGER NOT NULL,\n  timestamp INTEGER NOT NULL\n)"
│ +    const-string v3, "CREATE TABLE PaymentMeta (\n  id TEXT NOT NULL PRIMARY KEY,\n\n  swap_in_address TEXT DEFAULT NULL,\n  swap_in_tx TEXT DEFAULT NULL,\n\n  swap_out_address TEXT DEFAULT NULL,\n  swap_out_tx TEXT DEFAULT NULL,\n  swap_out_feerate_per_byte INTEGER DEFAULT NULL,\n  swap_out_fee_sat INTEGER DEFAULT NULL,\n  swap_out_conf INTEGER DEFAULT NULL,\n\n  funding_tx TEXT DEFAULT NULL,\n  funding_fee_pct REAL DEFAULT NULL,\n  funding_fee_raw_sat INTEGER DEFAULT NULL,\n\n  closing_type INTEGER DEFAULT NULL,\n  closing_channel_id TEXT UNIQUE DEFAULT NULL,\n  closing_spending_txs TEXT DEFAULT NULL,\n  closing_main_output_script TEXT DEFAULT NULL,\n  closing_cause TEXT DEFAULT NULL,\n\n  custom_desc TEXT DEFAULT NULL\n)"
│  
│ -    .line 78
│ +    .line 62
│      invoke-static/range {v1 .. v7}, Lcom/squareup/sqldelight/db/SqlDriver$DefaultImpls;->execute$default(Lcom/squareup/sqldelight/db/SqlDriver;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
│  
│ -    const-string v3, "CREATE INDEX IF NOT EXISTS payment_closing_channel_id_index ON PaymentMeta(closing_channel_id)"
│ +    const-string v3, "CREATE INDEX IF NOT EXISTS paytoopen_payment_hash_index ON PayToOpenMeta(payment_hash)"
│  
│      .line 88
│      invoke-static/range {v1 .. v7}, Lcom/squareup/sqldelight/db/SqlDriver$DefaultImpls;->execute$default(Lcom/squareup/sqldelight/db/SqlDriver;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
│  
│ -    const-string v3, "CREATE INDEX IF NOT EXISTS paytoopen_payment_hash_index ON PayToOpenMeta(payment_hash)"
│ +    const-string v3, "CREATE INDEX IF NOT EXISTS payment_closing_channel_id_index ON PaymentMeta(closing_channel_id)"
│  
│      .line 91
│      invoke-static/range {v1 .. v7}, Lcom/squareup/sqldelight/db/SqlDriver$DefaultImpls;->execute$default(Lcom/squareup/sqldelight/db/SqlDriver;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
│  
│      return-void
│  .end method
├── smali_classes3/fr/acinq/phoenix/app/PayToOpenMetaQueriesImpl.smali
│ @@ -89,44 +89,44 @@
│  
│      invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
│  
│      const-string v0, "driver"
│  
│      invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
│  
│ -    .line 424
│ +    .line 168
│      invoke-direct {p0, p2}, Lcom/squareup/sqldelight/TransacterImpl;-><init>(Lcom/squareup/sqldelight/db/SqlDriver;)V
│  
│      iput-object p1, p0, Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;->database:Lfr/acinq/phoenix/app/DatabaseImpl;
│  
│      iput-object p2, p0, Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;->driver:Lcom/squareup/sqldelight/db/SqlDriver;
│  
│ -    .line 425
│ +    .line 169
│      invoke-static {}, Lcom/squareup/sqldelight/internal/FunctionsJvmKt;->copyOnWriteList()Ljava/util/List;
│  
│      move-result-object p1
│  
│      iput-object p1, p0, Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;->get:Ljava/util/List;
│  
│      return-void
│  .end method
│  
│  .method public static final synthetic access$getDatabase$p(Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;)Lfr/acinq/phoenix/app/DatabaseImpl;
│      .locals 0
│  
│ -    .line 421
│ +    .line 165
│      iget-object p0, p0, Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;->database:Lfr/acinq/phoenix/app/DatabaseImpl;
│  
│      return-object p0
│  .end method
│  
│  .method public static final synthetic access$getDriver$p(Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;)Lcom/squareup/sqldelight/db/SqlDriver;
│      .locals 0
│  
│ -    .line 421
│ +    .line 165
│      iget-object p0, p0, Lfr/acinq/phoenix/app/PayToOpenMetaQueriesImpl;->driver:Lcom/squareup/sqldelight/db/SqlDriver;

It looks indeed like some sorting issue. Hope sqldelight fixes this.

@Giszmo
Copy link
Author

Giszmo commented Nov 17, 2020

I checked the latest release but it appears there is no according tag "v1.4.2".

Also let me know if you manage to reproduce the build using disorderfs the way Mycelium does it and update build instructions accordingly.

@dpad85
Copy link
Member

dpad85 commented Nov 17, 2020

The 1.4.2 tag has been pushed. The issue with SQLdelight has not been fixed yet so you will have the same issues as with previous releases. I reckon it will take some time to have a fix.

@Giszmo
Copy link
Author

Giszmo commented Jun 4, 2021

Is Phoenix not working on reproducibility? It's my favorite lightning wallet for beginners but I really care a lot about the funds not being for grab that easily.

@t-bast
Copy link
Member

t-bast commented Jun 7, 2021

We're migrating Phoenix to a new stack:

We'll work on reproducibility on this new stack.

@emanuelb
Copy link

Looking at code & this thread, 2 reproducibility problems found:

  1. Workaround needed for SQLdelight issue by using disorderfs, see for example & more details at:
    https://gitlab.com/walletscrutiny/walletScrutinyCom/-/issues/197#note_543234399
    Thus the instructions at: https://github.com/ACINQ/phoenix/blob/master/BUILD.md#release-phoenix
    should be changed to include invocation of disorderfs

  2. Usage of latest commit instead of specific commit (git checkout commit/tag)

the usage of latest commit for repo https://github.com/ACINQ/Tor_Onion_Proxy_Library instead of specific commit in Dockerfile is not reproducible:

phoenix/Dockerfile

Lines 66 to 71 in 67e5a97

RUN git clone https://github.com/ACINQ/Tor_Onion_Proxy_Library && \
cd Tor_Onion_Proxy_Library && \
./gradlew install && \
./gradlew :universal:build && \
./gradlew :android:build && \
./gradlew :android:publishToMaven

also explained in The 3 issue in: #166

@t-bast
Copy link
Member

t-bast commented Jul 19, 2021

We've been working on migrating Phoenix to a completely new stack based on Kotlin multi-platform:

Any work on deterministic builds will be done over there.

dpad85 pushed a commit that referenced this issue Sep 15, 2021
- add a new `UserDefaults` to store a boolean saying if Tor is enabled
- add a screen to toggle this boolean
- add an observer to post any changes to the shared module that will be responsible to forward socket connections through Tor's proxy.
@emanuelb
Copy link

Compiled version 1.4.21 using Dockerfile at: #240 (comment)
and compared to APK from github at: https://github.com/ACINQ/phoenix/releases/download/android-legacy-v1.4.21/phoenix-36-1.4.21-mainnet.apk
only difference is in classes3.dex file:

Files ./phoenix-36-1.4.21-mainnet-release-rebuild/classes3.dex and ./phoenix-36-1.4.21-mainnet/classes3.dex differ

diff from running apktool

Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/DatabaseImpl$Schema.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/DatabaseImpl$Schema.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$GetQuery$execute$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$GetQuery$execute$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$GetQuery.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$GetQuery.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$get$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$get$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$get$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$get$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$insert$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$insert$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$insert$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl$insert$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/NodeMetaQueriesImpl.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetByChannelIdQuery$execute$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetByChannelIdQuery$execute$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetByChannelIdQuery.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetByChannelIdQuery.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetQuery$execute$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetQuery$execute$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetQuery.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$GetQuery.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$get$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$get$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$get$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$get$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$getByChannelId$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$getByChannelId$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$getByChannelId$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$getByChannelId$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertClosing$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertClosing$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertClosing$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertClosing$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertEmpty$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertEmpty$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertEmpty$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertEmpty$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapIn$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapIn$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapIn$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapIn$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapOut$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapOut$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapOut$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$insertSwapOut$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setChannelClosingError$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setChannelClosingError$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setChannelClosingError$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setChannelClosingError$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setDesc$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setDesc$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setDesc$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setDesc$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayAction$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayAction$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayAction$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayAction$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayMeta$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayMeta$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayMeta$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayMeta$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayUrl$1.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayUrl$1.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayUrl$2.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl$setLNUrlPayUrl$2.smali differ
Files phoenixGithub/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl.smali and phoenixBuild/smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/PaymentMetaQueriesImpl.smali differ

looks like ordering issue in file smali_classes3/fr/acinq/phoenix/legacy/db/phoenixlegacy/DatabaseImpl$Schema.smali which probably because of SQLdelight, details in previous comment: #112 (comment) other diffs are in .line and might be because the same ordering issue

@emanuelb
Copy link

There more diffs in latest version 1.4.22, also tried to use disorderfs to fix ordering issues, with commands:

git clone https://github.com/ACINQ/phoenix;
cd phoenix;
git checkout android-legacy-v1.4.22;
sed -i 's/ubuntu:21.10/docker.io\/ubuntu:21.10/g' Dockerfile; 
sed -i 's/eclipse-temurin:11.0.14.1_1-jdk-alpine/docker.io\/eclipse-temurin:11.0.14.1_1-jdk-alpine/g' Dockerfile; 
podman build --pull --rm -t phoenix_1422_build_apk -f Dockerfile;
podman run --device /dev/fuse --cap-add SYS_ADMIN --rm -ti -v $(pwd):/home/ubuntu/phoenix/phoenix-legacy/build/outputs:Z -w /home/ubuntu/phoenix phoenix_1422_build_apk

in container run:

apt-get update;
apt-get install --yes --no-install-recommends disorderfs;
mkdir /home/ubuntu/phoenixorderfs;
mkdir /home/ubuntu/phoenixrevorderfs;
disorderfs --sort-dirents=yes --reverse-dirents=no /home/ubuntu/phoenix /home/ubuntu/phoenixorderfs;
disorderfs --sort-dirents=no --reverse-dirents=yes /home/ubuntu/phoenix /home/ubuntu/phoenixrevorderfs;
cd /home/ubuntu/phoenixorderfs;
./gradlew :phoenix-legacy:assemble
cd /home/ubuntu/phoenixrevorderfs;
./gradlew :phoenix-legacy:assemble

diff results:

Files /classes3.dex and /classes3.dex differ
Files /lib/arm64-v8a/libsqlitejdbc.so and /lib/arm64-v8a/libsqlitejdbc.so differ
Files /lib/armeabi-v7a/libsqlitejdbc.so and /lib/armeabi-v7a/libsqlitejdbc.so differ
Files /lib/x86/libsqlitejdbc.so and /lib/x86/libsqlitejdbc.so differ
Files /lib/x86_64/libsqlitejdbc.so and /lib/x86_64/libsqlitejdbc.so differ
Only in /META-INF: MAINNET.RSA
Only in /META-INF: MAINNET.SF
Only in /META-INF: MANIFEST.MF

also there was network errors regarding gradle-kotlin-dsl-plugins which might be related to issue #258 after multiple retries the command ./gradlew :phoenix-legacy:assemble downloaded the dep and not showed error:

> Could not GET 'https://repo.gradle.org/artifactory/jcenter/org/gradle/kotlin/gradle-kotlin-dsl-plugins/2.1.4/gradle-kotlin-dsl-plugins-2.1.4.module'.
               > Read timed out

@Giszmo
Copy link
Author

Giszmo commented Apr 16, 2023

The latest version 1.4.26 is again not reproducible. The diff is probably due to sqldelight and baseline profile:

Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_41/assets/dexopt/baseline.prof and /tmp/fromBuild_fr.acinq.phoenix.mainnet_41/assets/dexopt/baseline.prof differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_41/classes3.dex and /tmp/fromBuild_fr.acinq.phoenix.mainnet_41/classes3.dex differ

@emanuelb
Copy link

a fix for the sqldelight issue is to either to use upstream newer version 2.x (which is currently in alpha-05) as fix for the rb issue was introduced in release https://github.com/cashapp/sqldelight/releases/tag/2.0.0-alpha01 or by using a fork of older version of sqldelight and apply the patch to it as it isn't backported to stable releases, as done for example in branch: https://github.com/muun/sqldelight/tree/reproducible-builds

@moneyball
Copy link

As @emanuelb mentioned in the previous post as well as here (sqldelight/sqldelight#1548 (comment)), Phoenix could upgrade to sqldelight v2 in order to resolve this issue. I discussed this with @t-bast last night, and he seemed to be amenable to this idea.

@dpad85
Copy link
Member

dpad85 commented Jun 29, 2023

Thanks for reporting this @moneyball ! we'll certainly give it a try.

@Giszmo
Copy link
Author

Giszmo commented Nov 3, 2023

Version 2.11.0 appears to not be reproducible but maybe I did something wrong? The build instructions link on the main readme is broken and I did some guessing there.

Full report briefly on walletscrutiny.

$ unzip -qqd fromBuild phoenix-android/build/outputs/apk/release/phoenix-66-2.0.11-mainnet-release.apk 
$ unzip -qqd fromGoogle path/to/Phoenix\ 2.0.11\ \(fr.acinq.phoenix.mainnet\).apk 
$ diff --recursive from*
Binary files fromBuild/assets/dexopt/baseline.prof and fromGoogle/assets/dexopt/baseline.prof differ
Binary files fromBuild/assets/dexopt/baseline.profm and fromGoogle/assets/dexopt/baseline.profm differ
Binary files fromBuild/classes3.dex and fromGoogle/classes3.dex differ
Binary files fromBuild/classes5.dex and fromGoogle/classes5.dex differ
Only in fromGoogle/META-INF: MAINNET.RSA
Only in fromGoogle/META-INF: MAINNET.SF
Only in fromGoogle/META-INF: MANIFEST.MF

Diffoscope finds mostly ordering issues around SQL statements apart from assets/dexopt/baseline.prof

@t-bast
Copy link
Member

t-bast commented Nov 3, 2023

We haven't moved to SQLDelight 2 yet, so it's expected that this isn't reproducible since SQLDelight 1.5 isn't reproducible.

@Giszmo
Copy link
Author

Giszmo commented Nov 3, 2023

Ok, cool. Keeping an eye on this issue. Any plans to update SQLDelight soon?

@dpad85
Copy link
Member

dpad85 commented Nov 6, 2023

We plan to update SQLDelight in the coming weeks, and if there's no issues with Kotlin Multiplatform we should be good.

@Giszmo
Copy link
Author

Giszmo commented Jan 29, 2024

It's 2024 ... still looking at huge diffs for version 2.1.2. Can we help with anything? Testing? Writing PRs?

@xrviv
Copy link

xrviv commented Sep 25, 2024

Hello team Phoenix! 😃

Danny here from WalletScrutiny

I seem to have gotten v2.3.9 to build with the minimum of diffs

image

Now, it's just a matter of duplicating what I just did.

Previously, our current script gave:

===== Begin Results =====
appId:          fr.acinq.phoenix.mainnet
signer:         ed550bd5d607d342b61bbbbb94ffd4dde43f845171f63d3ae47573a95a132629
apkVersionName: 2.3.9
apkVersionCode: 90
verdict:        
appHash:        0b902d26521ca46107449087cc4a4fe4c48a3b82ca2d8ed69a1b9446fd605bd0
commit:         cc83db72e1d7a8468a39ad37f2da31ea837049aa

Diff:
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/assets/dexopt/baseline.prof and /tmp/fromBuild_fr.acinq.phoenix.mainnet_90/assets/dexopt/baseline.prof differ
Files /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/classes5.dex and /tmp/fromBuild_fr.acinq.phoenix.mainnet_90/classes5.dex differ
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/META-INF: MAINNET.RSA
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/META-INF: MAINNET.SF
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/META-INF: MANIFEST.MF

Revision, tag (and its signature):

===== End Results =====

The persistence of classes5.dex and baseline.prof indicate a significant diff than expected. In reference to this, we dig a little deeper to find out the reasons why.

It should be noted that in our issue, there seems to be some resolution which is on another issue entitled, "Fix APK builds to enhance build reproduceability". To quote:

It seems to be on SQLDelight's end indeed
cashapp/sqldelight#1548

ACINQ/phoenix#112
https://x.com/WalletScrutiny/status/1335243710691500040
muun/apollo#54

This was last mentioned on April 4, 2024. They have since upgraded to SQLDelight v2.0.1

After the build, we compared the pertinent files:

  1. We ran a diffoscope between the built apk and the official apk. We posted the nosbin results

  2. We also ran diffoscope on baseline.prof and posted on nosbin

  3. classes5.dex


The minimal diff results at the start of my report, was from a manual build. I am now in the process of duplicating it. If successful, I would then incorporate it in our script to get Phoenix a verdict of reproducible.

Update: 2024-09-25 18:38 PHT

I was able to replicate the build!

The results:

danny@lw10:~/work/builds/fr.acinq.phoenix.mainnet/2.3.9/manual-build/2$ diff --recursive /tmp/fromPlay_fr.acinq.phoenix.mainnet_90 fromManualBuild2-extracted/
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/META-INF: MAINNET.RSA
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/META-INF: MAINNET.SF
Only in /tmp/fromPlay_fr.acinq.phoenix.mainnet_90/META-INF: MANIFEST.MF

Asciicast

https://asciinema.org/a/677574

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

No branches or pull requests

6 participants