Skip to content

Instantly share code, notes, and snippets.

@delta1
Created April 4, 2023 08:14
Show Gist options
  • Save delta1/32a8fc5e0e33c0aab657d2970e233a75 to your computer and use it in GitHub Desktop.
Save delta1/32a8fc5e0e33c0aab657d2970e233a75 to your computer and use it in GitHub Desktop.
elements merging notes

merge notes for elements 24

please comment with

  • bitcoin PR / merged-master commit hash
  • notes about conflicts/resolution or things to keep track of
@delta1
Copy link
Author

delta1 commented Jun 2, 2023

This change to the benchmarks is causing our server to run out of memory when running bench_bitcoin, the process then gets OOM killed and we can't continue merging. What I have done is just comment out the bench_bitcoin line in the merge-prs.sh script for now, so that we can revisit the bench process later.

update: it is reverted in bitcoin/bitcoin#23693 at which point we can put the benches back in our script

@delta1
Copy link
Author

delta1 commented Jul 4, 2023

REVIEW NOTES START HERE

@delta1
Copy link
Author

delta1 commented Jul 4, 2023

commit delta1/elements@a28e1a3

Bitcoin PR bitcoin/bitcoin#17526

some extraneous python prints and comments to be removed

@delta1
Copy link
Author

delta1 commented Jul 4, 2023

commit delta1/elements@f522e92
and
commit delta1/elements@a93fce1

functional tests commented out which need to be fixed

# ELEMENTS: FIXME failing tests
# 'feature_taphash_pegins_issuances.py',
# 'feature_tapscript_opcodes.py',
# 'wallet_groups.py --legacy-wallet',
# 'wallet_groups.py --descriptors',

@delta1
Copy link
Author

delta1 commented Jul 4, 2023

commit delta1/elements@ea5edc8

for Bitcoin PR bitcoin/bitcoin#23106

this is the commit/PR that Glenn suggested moving the wallet unlock up in the rpc, and there are asserts to be fixed

@jamesdorfman
Copy link

jamesdorfman commented Jul 5, 2023

Commit delta1/elements@1c0f494
for Bitcoin PR: bitcoin/bitcoin#23210

TODO: remove the newly added print(tx_info) line in test/functional/test_framework/wallet.py -- while reviewing I noticed that this extraneous debugging line was not removed.

Update: as I reviewed further I saw that this was fixed in the later commit delta1/elements@a27835c.

@jamesdorfman
Copy link

jamesdorfman commented Jul 5, 2023

Commit delta1/elements@45b24f5
for Bitcoin PR: bitcoin/bitcoin#23188

In src/wallet/spend.cpp we should change

mapValueFromPresetInputs[coin.asset] += coin.value;
if (coin.m_input_bytes <= 0) {
    error = _("Missing solving data for estimating transaction size"); // ELEMENTS

to

mapValueFromPresetInputs[coin.asset] += coin.value;
if (coin.m_input_bytes == -1) {
    error = _("Missing solving data for estimating transaction size"); // ELEMENTS

to match the upstream change.

Update: this error was commented out in delta1/elements@e3ab195.

@delta1
Copy link
Author

delta1 commented Jul 6, 2023

delta1/elements@1c0f494

a stray print has made it into wallet.py

removed in a27835cb7d8d3e64d9076204ccb5b324b8f4a6b3

@delta1
Copy link
Author

delta1 commented Jul 6, 2023

delta1/elements@e9f3944

check script_parse_tests.cpp to figure out why BOOST_CHECK_EXCEPTION(ParseScript("OP_CHECKSIGADD"), std::runtime_error, HasReason("script parse error: unknown opcode")); doesn't pass

@jamesdorfman
Copy link

jamesdorfman commented Jul 6, 2023

Commit delta1/elements@f80332f
for Bitcoin PR: bitcoin/bitcoin#23207

In test/functional/feature_confidential_transactions.py:
The 4-way diff for this line shows that we generate now on node 0 instead of node 2, unintentionally:

 # And finally send
         self.nodes[2].sendrawtransaction(signed_assets['hex'])
-        self.nodes[2].generate(101)
+        self.generate(self.nodes[0], 101)
         self.sync_all()

This might not have any functional effects.

However, the following diff in /test/functional/rpc_psbt.py unintentionally deleted the letter o. This is certainly a bug:

diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 1fb99f1876..c1df62665c 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -635,7 +635,7 @@ class PSBTTest(BitcoinTestFramework):
 
         # Extractor test
         for extractor in extractors:
-            extracted = self.nodes[2].finalizepsbt(extractor['extract'], True)['hex']
+            extracted = self.n  des[2].finalizepsbt(extractor['extract'], True)['hex']
             assert_equal(extracted, extractor['result'])

Update: fixed in jamesdorfman/elements@654752a

@delta1
Copy link
Author

delta1 commented Jul 7, 2023

delta1/elements@2110cca

for Bitcoin PR bitcoin/bitcoin#23371

investigate and fix this issue with vsize

assert_equal(tx_info['vsize'], vsize) # ELEMENTS: FIXME feature_cltv.py vsize is 184 but rpc_block.py vsize is 185

@jamesdorfman
Copy link

jamesdorfman commented Jul 8, 2023

delta1/elements@81d5607
for Bitcoin PR bitcoin/bitcoin#23114
deleted

":(exclude)contrib/guix/patches" ":(exclude)test/bitcoin_functional" ":(exclude)SECURITY.md"

from codespell exceptions. If CI starts failing, then this might be why.

@jamesdorfman
Copy link

jamesdorfman commented Jul 8, 2023

delta1/elements@5c6f2e0
for Bitcoin PR bitcoin/bitcoin#22508

This is the 4-way diff:

-<<<<<<< HEAD
     int elements_iter_count = 0;
     while (fuzzed_data_provider.ConsumeBool()) {
         if (elements_iter_count++ > 100) {
@@ -70,11 +69,6 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages)
             break;
         }
 
-||||||| c82284cfdc
-    while (fuzzed_data_provider.ConsumeBool()) {
-=======
-    LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) {
->>>>>>> 36d184d0c876b0d296787a82de742a18d1c13015

I think the accepted while (fuzzed_data_provider.ConsumeBool()) { should be replaced with LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 100) {?

@jamesdorfman
Copy link

jamesdorfman commented Jul 10, 2023

delta1/elements@bd68371

for Bitcoin PR bitcoin/bitcoin#23474

A self.sync_all() was not deleted when it should have been:

diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py
index 9886d2b9c2..91a96d32ad 100755
--- a/test/functional/rpc_signrawtransaction.py
+++ b/test/functional/rpc_signrawtransaction.py
@@ -212,15 +212,8 @@ class SignRawTransactionsTest(BitcoinTestFramework):
         # send transaction to P2SH-P2WSH 1-of-1 multisig address
         self.generate(self.nodes[0], COINBASE_MATURITY + 1, sync_fun=self.no_op)
         self.nodes[0].sendtoaddress(p2sh_p2wsh_address["address"], 49.999)
-<<<<<<< HEAD
         self.generate(self.nodes[0], 1, sync_fun=self.no_op)
         self.sync_all(self.nodes[:2])
-||||||| 0475a2378b
-        self.generate(self.nodes[0], 1)
-        self.sync_all()
-=======
-        self.generate(self.nodes[0], 1)
->>>>>>> ffdab41f94521dc87e68a160546af55355340af5

Update: fixed in jamesdorfman/elements@bbfdbf7

@jamesdorfman
Copy link

jamesdorfman commented Jul 10, 2023

delta1/elements@eee64b5

for Bitcoin PR bitcoin/bitcoin#16807

In src/key_io.cpp:

@@ -229,16 +218,9 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
     const std::string& hrp = for_parent ? params.ParentBech32HRP() : params.Bech32HRP();
     if ((dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) && dec.data.size() > 0) {
         // Bech32 decoding
-<<<<<<< HEAD
         error_str = "";
 
         if (dec.hrp != hrp) {
-||||||| ee7e061563
-        error_str = "";
-        if (dec.hrp != params.Bech32HRP()) {
-=======
-        if (dec.hrp != params.Bech32HRP()) {
->>>>>>> 95d19f8c1a40a7531d2bb00febd245d127293a64

error_str = ""; should be deleted in order to match with upstream.

Update: fixed in jamesdorfman/elements@c52e33a.
Second update: this caused test failures -- see jamesdorfman/elements@c52e33a. Fix has since been reverted.

Also, the following FIXME in the same file was not previously noted in this gist:

         return CNoDestination();
-    } else if (!is_bech32) {
+    } else if (!is_bech32 && !is_blech32) {
         // Try Base58 decoding without the checksum, using a much larger max length
         if (!DecodeBase58(str, data, 100)) {
             error_str = "Invalid HRP or Base58 character in address";
         } else {
             error_str = "Invalid checksum or length of Base58 address";
         }
-        return CNoDestination();
+        // return CNoDestination(); // ELEMENTS: FIXME
     }

Furthermore, I'm not clear on what needs to be fixed here.

Reminder to self: revisit the commented out tests after full review of all PRs. I think I might be able to fix them.

Update: I determined that this fix is snot necessary, and the commented out test is covered by other tests right below it.

@jamesdorfman
Copy link

jamesdorfman commented Jul 10, 2023

delta1/elements@28823f6
for Bitcoin PR bitcoin/bitcoin#23639

The following 4-way diff is from file src/rpc/rawtransaction.cpp:

-<<<<<<< HEAD
                 {
                     {"inputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The json objects",
                         {
@@ -2074,43 +2003,6 @@ static RPCHelpMan createpsbt()
                             "                             Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible."},
                     {"psbt_version", RPCArg::Type::NUM, RPCArg::Default{2}, "The PSBT version number to use."},
                 },
-||||||| 205877e55f
-                {
-                    {"inputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The json objects",
-                        {
-                            {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
-                                {
-                                    {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
-                                    {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
-                                    {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'replaceable' and 'locktime' arguments"}, "The sequence number"},
-                                },
-                                },
-                        },
-                        },
-                    {"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
-                            "That is, each address can only appear once and there can only be one 'data' object.\n"
-                            "For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
-                            "                             accepted as second parameter.",
-                        {
-                            {"", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, "",
-                                {
-                                    {"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in " + CURRENCY_UNIT},
-                                },
-                                },
-                            {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
-                                {
-                                    {"data", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A key-value pair. The key must be \"data\", the value is hex-encoded data"},
-                                },
-                                },
-                        },
-                        },
-                    {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
-                    {"replaceable", RPCArg::Type::BOOL, RPCArg::Default{false}, "Marks this transaction as BIP125 replaceable.\n"
-                            "                             Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible."},
-                },
-=======
-                CreateTxDoc(),
->>>>>>> e7507f333bc93047d0baadea4fde19f770dacb56

inputs and outputs appear to have been removed from upstream, but we kept them. Why? I think this might have been an oversight. I think we also need to remove them.

Update: revisit this with @delta1 before making this change.

Update: the code was just replaced by CreateTxDoc(), which still generates the same inputs and outputs documentation. So this is not a problem.

@jamesdorfman
Copy link

jamesdorfman commented Jul 11, 2023

delta1/elements@4c0504b

for Bitcoin PR bitcoin/bitcoin#23712

Examine the following 4-way diff:

diff --git a/test/functional/interface_bitcoin_cli.py b/test/functional/interface_bitcoin_cli.py
index 19162bd597..501d64d8c6 100755
--- a/test/functional/interface_bitcoin_cli.py
+++ b/test/functional/interface_bitcoin_cli.py
@@ -150,16 +150,8 @@ class TestBitcoinCli(BitcoinTestFramework):
         cli_get_info = cli_get_info_string_to_dict(cli_get_info_string)
         assert_equal(cli_get_info["Proxies"], "127.0.0.1:9050 (ipv4, ipv6, onion, cjdns), 127.0.0.1:7656 (i2p)")
 
-<<<<<<< HEAD
-        if self.is_wallet_compiled():
-            self.log.info("Test -getinfo and elements-cli getwalletinfo return expected wallet info")
-||||||| 926fc2a0d4
-        if self.is_wallet_compiled():
-            self.log.info("Test -getinfo and bitcoin-cli getwalletinfo return expected wallet info")
-=======
         if self.is_specified_wallet_compiled():
             self.log.info("Test -getinfo and bitcoin-cli getwalletinfo return expected wallet info")
->>>>>>> f727d814bd8df5a5346c128dd4573e457c1970e1

I think the last line should be self.log.info("Test -getinfo and elements-cli getwalletinfo return expected wallet info")

Update: fixed in jamesdorfman/elements@e815e6a

@jamesdorfman
Copy link

jamesdorfman commented Jul 11, 2023

delta1/elements@e3ab195

for Bitcoin PR bitcoin/bitcoin#22019

In src/wallet/spend.cpp
I think this variable that we kept should really be removed

-<<<<<<< HEAD
     CAmountMap mapValueFromPresetInputs;
-||||||| 09e60df115
-    CAmount nValueFromPresetInputs = 0;
-=======
->>>>>>> c840ab0231bc29057172179f005001c9ab299554

It doesn't appear to be used anywhere.

Update: fixed in jamesdorfman/elements@6a42ca5.

Additionally, in the following two asserts, let's note what upstream bitcoin notes the error at, in case someone is able to fix it in the future.

diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 72979b9a88..f556e776e7 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -1134,7 +1134,8 @@ class PSBTTest(BitcoinTestFramework):
         ext_utxo = self.nodes[0].listunspent(addresses=[addr])[0]
 
         # An external input without solving data should result in an error
-        assert_raises_rpc_error(-4, "Missing solving data for estimating transaction size", self.nodes[1].walletcreatefundedpsbt, [ext_utxo], [{self.nodes[0].getnewaddress(): 10 + ext_utxo['amount']}], 0, {'add_inputs': True})
+        # ELEMENTS: minor FIXME error is different since SelectCoins no longer has the error out
+        assert_raises_rpc_error(-4, "Insufficient funds", self.nodes[1].walletcreatefundedpsbt, [ext_utxo], [{self.nodes[0].getnewaddress(): 10 + ext_utxo['amount']}], 0, {'add_inputs': True})
 
         # But funding should work when the solving data is provided
         psbt = self.nodes[1].walletcreatefundedpsbt([ext_utxo], [{self.nodes[0].getnewaddress(): 15}], 0, {'add_inputs': True, "solving_data": {"pubkeys": [addr_info['pubkey']], "scripts": [addr_info["embedded"]["scriptPubKey"]]}})
diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py
index 9ad0f015e4..97720b47a1 100755
--- a/test/functional/wallet_send.py
+++ b/test/functional/wallet_send.py
@@ -508,7 +508,8 @@ class WalletSendTest(BitcoinTestFramework):
         ext_utxo = ext_fund.listunspent(addresses=[addr])[0]
 
         # An external input without solving data should result in an error
-        self.test_send(from_wallet=ext_wallet, to_wallet=self.nodes[0], amount=15, inputs=[ext_utxo], add_inputs=True, psbt=True, include_watching=True, expect_error=(-4, "Missing solving data for estimating transaction size"))
+        # ELEMENTS: minor FIXME error is different since SelectCoins no longer has the error out
+        self.test_send(from_wallet=ext_wallet, to_wallet=self.nodes[0], amount=15, inputs=[ext_utxo], add_inputs=True, psbt=True, include_watching=True, expect_error=(-4, "Insufficient funds"))

Update: the first FIXME comment was removed during a subsequent merge, the second FIXME comment was updated in jamesdorfman/elements@b6f5c2d.

@jamesdorfman
Copy link

jamesdorfman commented Jul 12, 2023

delta1/elements@fa3c0f4

for Bitcoin PR bitcoin/bitcoin#23789

The # With no arguments passed, expect fee of 141 satoshis. comment from upstream should not have been removed:

+++ b/test/functional/rpc_fundrawtransaction.py
@@ -827,39 +827,10 @@ class RawTransactionsTest(BitcoinTestFramework):
         for param, zero_value in product(["fee_rate", "feeRate"], [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]):
             assert_equal(self.nodes[3].fundrawtransaction(rawtx, {param: zero_value})["fee"], 0)
 
-<<<<<<< HEAD
-        if self.options.descriptors:
-            # With no arguments passed, expect fee of 153 satoshis as descriptor wallets now have a taproot output.
-            assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00001386, vspan=0.00000001)
-            # Expect fee to be 10,000x higher when an explicit fee rate 10,000x greater is specified.
-            result = node.fundrawtransaction(rawtx, {"fee_rate": 1000}) # ELEMENTS: reduce by 10x
-            assert_approx(result["fee"], vexp=0.01386, vspan=0.0001)
-        else:
-            # With no arguments passed, expect fee of 141 satoshis as legacy wallets only support up to segwit v0.
         assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00001374, vspan=0.00000001)
         # Expect fee to be 10,000x higher when an explicit fee rate 10,000x greater is specified.
         result = node.fundrawtransaction(rawtx, {"fee_rate": 1000}) # ELEMENTS: reduce by 10x
         assert_approx(result["fee"], vexp=0.01374, vspan=0.0001)
-||||||| 9ac064d245
-        if self.options.descriptors:
-            # With no arguments passed, expect fee of 153 satoshis as descriptor wallets now have a taproot output.
-            assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00000153, vspan=0.00000001)
-            # Expect fee to be 10,000x higher when an explicit fee rate 10,000x greater is specified.
-            result = node.fundrawtransaction(rawtx, {"fee_rate": 10000})
-            assert_approx(result["fee"], vexp=0.0153, vspan=0.0001)
-        else:
-            # With no arguments passed, expect fee of 141 satoshis as legacy wallets only support up to segwit v0.
-            assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00000141, vspan=0.00000001)
-            # Expect fee to be 10,000x higher when an explicit fee rate 10,000x greater is specified.
-            result = node.fundrawtransaction(rawtx, {"fee_rate": 10000})
-            assert_approx(result["fee"], vexp=0.0141, vspan=0.0001)
-=======
-        # With no arguments passed, expect fee of 141 satoshis.
-        assert_approx(node.fundrawtransaction(rawtx)["fee"], vexp=0.00000141, vspan=0.00000001)
-        # Expect fee to be 10,000x higher when an explicit fee rate 10,000x greater is specified.
-        result = node.fundrawtransaction(rawtx, {"fee_rate": 10000})
-        assert_approx(result["fee"], vexp=0.0141, vspan=0.0001)
->>>>>>> 3ac38058ce0e80a9f4276bfa82951decdb237e9a

Update: fixed in jamesdorfman/elements@8b21677.

@jamesdorfman
Copy link

jamesdorfman commented Jul 12, 2023

delta1/elements@8886cea

for Bitcoin PR bitcoin-core/gui#459

TODO: sync with @delta1 on this -- what does taproot look like in elements? Do we merge each PR as-is, or did we make changes to taproot for elements. What were these changes?

Update: main difference is that elements sighashes require the genesis block. See https://github.com/ElementsProject/elements/blob/master/doc/taproot-sighash.mediawiki for more info.

@jamesdorfman
Copy link

jamesdorfman commented Jul 13, 2023

delta1/elements@42605e2

for Bitcoin PR bitcoin/bitcoin#23866

I think the upstream deletion of self.setup_clean_chain = True should also have been removed from Elements:

diff --git a/test/functional/rpc_scantxoutset.py b/test/functional/rpc_scantxoutset.py
index 0142a89050..ffc814c02b 100755
--- a/test/functional/rpc_scantxoutset.py
+++ b/test/functional/rpc_scantxoutset.py
@@ -22,14 +22,9 @@ def descriptors(out):
 class ScantxoutsetTest(BitcoinTestFramework):
     def set_test_params(self):
         self.num_nodes = 1
-<<<<<<< HEAD
         self.setup_clean_chain = True
         # ELEMENTS: use bitcoin regtest prefixes to avoid having to rewrite the entire test
         self.extra_args = [["-pubkeyprefix=111", "-scriptprefix=196", "-secretprefix=239", "-extpubkeyprefix=043587CF", "-extprvkeyprefix=04358394", "-bech32_hrp=bcrt"]]
-||||||| a213bd63ca
-        self.setup_clean_chain = True
-=======
->>>>>>> d3582f2d3bfebb32316aa3974f6f27db20a610f5

Update: the functional test fails if I remove this line, let's keep it in.

@jamesdorfman
Copy link

delta1/elements@5c8aae9

for Bitcoin PR bitcoin/bitcoin#23909

If the dmg generation fails in CI / testing, it might be because we removed the libicns and imagemagick dependencies, which were not removed in upstream (because they did not exist):

diff --git a/doc/build-osx.md b/doc/build-osx.md
index 0dbd37afc5..bf20a0dd52 100644
--- a/doc/build-osx.md
+++ b/doc/build-osx.md
@@ -218,18 +218,6 @@ This command depends on a couple of python packages, so it is required that you
 Ensuring that `python` is installed, you can install the deploy dependencies by running the following commands in your terminal:
 
 ``` bash
-<<<<<<< HEAD
-brew install librsvg libicns imagemagick
-```
-
-``` bash
-||||||| 1aabbf33d7
-brew install librsvg
-```
-
-``` bash
-=======
->>>>>>> 3e5dd94c423bedfa8b70a1e00df632a22dbd4574
 pip3 install ds_store mac_alias

@jamesdorfman
Copy link

jamesdorfman commented Jul 14, 2023

delta1/elements@7878ba4

for Bitcoin PR bitcoin/bitcoin#23497

These two lines can be removed:

diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h
index aeea1e550b..816c9872e9 100644
--- a/src/wallet/coinselection.h
+++ b/src/wallet/coinselection.h
@@ -15,6 +15,9 @@
 
 #include <optional>
 
+// class CWallet;
+// class uint256;
+

Update: removed in jamesdorfman/elements@ed9beba.

@jamesdorfman
Copy link

jamesdorfman commented Jul 14, 2023

delta1/elements@7d759da

for Bitcoin PR bitcoin/bitcoin#23201

The following assert was commented out without any notes. Let's add a note that this was just for Elements, and note it in this gist as well.

diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py

-        assert_fee_amount(funded_tx4["fee"], tx4_vsize, Decimal(0.0001))
+        # assert_fee_amount(funded_tx4["fee"], tx4_vsize, Decimal(0.0001))

Same with the following assert in this file:

diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py

-        assert_fee_amount(testres["fees"]["base"], testres["vsize"], Decimal(0.0001))
+        # assert_fee_amount(testres["fees"]["base"], testres["vsize"], Decimal(0.0001))

Update: I understand why these are commented out -- fees are very different between bitcoin and elements. I added comments to the ends of both of these assertion lines, in jamesdorfman/elements@dca9352.

@jamesdorfman
Copy link

jamesdorfman commented Jul 14, 2023

delta1/elements@c53eb39

for Bitcoin PR bitcoin/bitcoin#24035

Upstream removed the extra fee but we didn't. Should we?

diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py
index 6113deae1c..fdc23b507f 100755
--- a/test/functional/mempool_accept.py
+++ b/test/functional/mempool_accept.py

         tx = tx_from_hex(raw_tx_0)
-<<<<<<< HEAD
         tx.vout[0].nValue.setToAmount(tx.vout[0].nValue.getAmount() - int(4 * fee * COIN))  # Set more fee
         tx.vout[1].nValue.setToAmount(tx.vout[1].nValue.getAmount() + int(4 * fee * COIN))
-        # skip re-signing the tx
-||||||| 767ee2e3a1
-        tx.vout[0].nValue -= int(4 * fee * COIN)  # Set more fee
-        # skip re-signing the tx
-=======
-        tx.vout[0].nValue -= int(4 * fee * COIN)  # Set more fee
->>>>>>> 807169e10b4a18324356ed6ee4d69587b96a7c70

Update: no we can't. The test fails without this extra fee, with the following error:

AssertionError: not([{'txid': 'e2b2d9feda958b9a0d74e0f13069c4bb5beacf69f0a82ca69eedaf13fb89416a', 'allowed': False, 'reject-reason': 'txn-mempool-conflict'}] == [{'txid': 'e2b2d9feda958b9a0d74e0f13069c4bb5beacf69f0a82ca69eedaf13fb89416a', 'allowed': False, 'reject-reason': 'txn-already-in-mempool'}])

@jamesdorfman
Copy link

jamesdorfman commented Jul 17, 2023

delta1/elements@5931d7d

for Bitcoin PR bitcoin/bitcoin#23508

Check this out -- this PR removed the following lines:

diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py
index 3ef94e1f25..19c2387b66 100755
--- a/test/functional/rpc_blockchain.py
+++ b/test/functional/rpc_blockchain.py
@@ -160,25 +160,6 @@ class BlockchainTest(BitcoinTestFramework):
         self.start_node(0, extra_args=[
             '-stopatheight=207',
             '-prune=550',
-<<<<<<< HEAD
-            '-testactivationheight=bip34@2',
-            '-testactivationheight=dersig@3',
-            '-testactivationheight=cltv@4',
-            '-testactivationheight=csv@5',
-            '-testactivationheight=segwit@6',
-            # ELEMENTS
-            "-con_bip34height=2",
-            "-con_bip66height=3",
-            "-con_bip65height=4",
-            "-con_csv_deploy_start=5",
-||||||| a4f7c41271
-            '-testactivationheight=bip34@2',
-            '-testactivationheight=dersig@3',
-            '-testactivationheight=cltv@4',
-            '-testactivationheight=csv@5',
-            '-testactivationheight=segwit@6',
-=======
->>>>>>> d4e92d843650b0480b86d15ce46ed02b6fd9b5be

We treated it like a deletion. However, they were actually moved (I found this in the original PR), lower in that same file test/functional/rpc_blockchain.py:

 def _test_getdeploymentinfo(self):
        # Note: continues past -stopatheight height, so must be invoked
        # after _test_stopatheight

        self.log.info("Test getdeploymentinfo")
        self.stop_node(0)
        self.start_node(0, extra_args=[
            '-testactivationheight=bip34@2',
            '-testactivationheight=dersig@3',
            '-testactivationheight=cltv@4',
            '-testactivationheight=csv@5',
            '-testactivationheight=segwit@6',
        ])

So, we need to add

# ELEMENTS
"-con_bip34height=2",
"-con_bip66height=3",
"-con_bip65height=4",
"-con_csv_deploy_start=5",

there as well.

Update: upon further review of the commit, these arguments were already correctly added during the commit. I think the 4-way diff Wass just being strange. This is not actually an issue.

@jamesdorfman
Copy link

jamesdorfman commented Jul 20, 2023

delta1/elements@eef2269

for Bitcoin PR bitcoin/bitcoin#24343

TODO: revisit failing test (I will do it when I'm done going through everything)

Update: fixed in jamesdorfman/elements@2ab19eb

@jamesdorfman
Copy link

jamesdorfman commented Jul 20, 2023

delta1/elements@51fbed1

for Bitcoin PR bitcoin/bitcoin#24409

Not specifically related to this commit, but we need to update the PACKAGE_NAME variable in file build_msvc/bitcoin_config.h.ini.
It's currently set to

/* Define to the full name of this package. */
#define PACKAGE_NAME "Bitcoin Core"

Update: fixed in jamesdorfman/elements@c37b88c

@jamesdorfman
Copy link

delta1/elements@055d634

for Bitcoin PR bitcoin/bitcoin#24451

Confirm with @delta1 -- your commit message says All conflicts in the locale translation files were resolved by taking the upstream version of the files.. I want to confirm that by upstream, you mean bitcoin. If that is the case, then I agree with this solution.

@delta1
Copy link
Author

delta1 commented Jul 20, 2023

delta1/elements@055d634

for Bitcoin PR bitcoin/bitcoin#24451

Confirm with @delta1 -- your commit message says All conflicts in the locale translation files were resolved by taking the upstream version of the files.. I want to confirm that by upstream, you mean bitcoin. If that is the case, then I agree with this solution.

@jamesdorfman yes exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment