-
Notifications
You must be signed in to change notification settings - Fork 2
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
[WIP] grs use wally sha256 and warp to v.0.7.1 #16
Conversation
Before this, the response of `getlog io` blew up quickly when called multiple times.
This makes clear that txwatch_fire was called with depth=0 when chain tip got removed after a reorg. And now we can test for that.
…onfirmation Because the call (wallet_extract_owned outputs) that prints that line can happen _before_ or _after_ confirmation in block, adding `CONFIRMED` in the later.
…ght and/or txindex Now without bitcoind restart. bitcoin-cli `prioritisetransaction` came to the rescue! Its argument `fee_delta` (apparently) lowers the txs _effective_ feerate soo low that bitcoind wont mine it ... untill we raise it when we want it to be mined.
…l_id Keep watching and updating scid until ANNOUNCE_MIN_DEPTH, even when channel is private. When scid changes, we fail channeld so it will restart and initialize with updated scid and add it to rtable. Reorgs can change funding tx's height/index after lockin, which could happen with small minimum_depth=1.
Reorg changes short_channel_id after lockin of private channel, while one node restarts. test that: - peer->depth_togo in billboard decrements - reorg and scid change is detected by running node and restarting node - both `old` and `new` scids are in rtable Also added a comment to test_blockchaintrack to clarify.
Nodes may disagree about short_channel_id before channel announcement.
1. Add the fields of remote channel announcement signatures into TABLE channels 2. Add the related function
Channeld sends announcement signatures to Master by this message. When Channeld receive a new channel announcement msg, (After channel locking)it will sends announcement signatures to Master by this message.
1. Add remote_ann_node_sigs and remote_bitcoin_sigs fields in channel_init message; 2. Master add announcement signatures into channel_init message, and send this message to Channeld. Channeld will initial the channel with this signatures when it reenables the channel.
And set pointers to shut down daemons as NULL in lightningd.
Signed-off-by: Christian Decker <[email protected]>
…e, have chaintopology use it. Fixes: ElementsProject#2687
I was trying to trace a problem with a plugin, and needed this. Signed-off-by: Rusty Russell <[email protected]>
Before: Plugin for invoice_payment returned non-result response "subscriptions": [], "hooks": ["invoice_payment"]}} �V After: Plugin for invoice_payment returned non-result response {"jsonrpc": "2.0", "id": 6, "error": "Error while processing invoice_payment: ValueError(\"invalid literal for int() with base 10: '5.0'\")"} Signed-off-by: Rusty Russell <[email protected]>
Slow, but useful. Signed-off-by: Rusty Russell <[email protected]>
A new string field is added to the command structure and is specified at the creation of each native command, and in the JSON created by 'json_add_help_command()'.
A new field is available in the command json object : 'category' (corresponding to whether "bitcoin", "channel", "network", "payment", "plugin", "utility", "developer"). We use it to printf commands ordered by categories. credits @rustyrussel
A new struct containing the plugin options value as different types is created and appended to the plugin_option structure
Just compiled it to test it out.
|
Signed-off-by: dflate <[email protected]>
Signed-off-by: dflate <[email protected]>
There seems to be compatibilty issues between c-lightning and eclair. Eclair test binary can be found here: https://github.com/Groestlcoin/eclair/releases/download/v0.2-alpha3-grs3/eclair-node-gui-0.3.2-SNAPSHOT-7ad2e45.jar (don't mind the old release tag, we uploaded recent binary on the latest available release tag) Question here is which implementation is using the right hash for signature and which implementation should change the signature hash to make it compatible? |
AFAICS both impl. have issues to eclair. I will take a look in that. And when it comes to further impl. in GRS A) Schnorr music party I would craft a Picnic fork :-) and some halving EDIT: in elcair there is no transition from double sha256 to groestl so If doublesha256 breaks there is no backup so grs makes some sense,but if the eclair-ln does not use groestl for double hash |
Eclair uses https://github.com/Groestlcoin/groestlcoin-lib as dependency where all necessary hashes are changed from double sha256 to double groestl. I have withdrawn succesfully funds of closed channels from eclair. Even master branch of https://github.com/Groestlcoin/lightning/ does not work with our eclair. So this issue is not related to this PR. |
We had found some bugs on Eclair (invoices have wrong hrp; they start with bc1 instead of grs1) which is currently fixed on Github. HashEngineering will return next week from vacation and will make a new build to test compatibility with c-lightning 0.7.1. Thank you for your patience |
use Groestl hash only for blocks and tx Signed-off-by: dflate <[email protected]>
Here a eclair compat c-ln less groestl more sha256 :-( i.e for testing |
Thanks for fixing regtest on our groestlcoin-lib. https://github.com/dflatemaster/groestlcoin-lib/commit/5dbcb5da66d52af33c220589812edc83447f9978 works fine on our regtest I also tested https://github.com/dflatemaster/lightning/commit/caa65d6c06d25cf7b0c578606f4ec0d62b0ddb30 and the compatibility between c-lightning and eclair is indeed fixed with this. We keep track of everything that needs sha256, sha256d and groestlhash on Groestlcoin here: We have to decide next week if we want to use your fix on c-lightning (which works fine) and keep our eclair as it is or if we want to fix this on eclair side and not use your fix. Much appreciate your troubleshooting efforts |
We are brainstorming about this. sha256_double_groestl seem to be introducing a new kind of hash: groestl(sha256(message)) for block hashes. In Groestlcoin Core our block header are hashed with GroestlHash. And our Block hashes are groestlHash digests of the block header instead of sha256d digests. For consistency we should stick to these 3 hashes: Maybe we should rename sha256_double_groestl to groestl512_double and change groestl(sha256(message)) to groestl(groestl(message)) to be consistent with Groestlcoin Core? Any thoughts on this approach? |
Double a sha3 function ( groestl ) ? AFAICS double any hash is never a good idea. as that yields to some mapping attacks, if one knows the prime/primes and the generator of the sha-x modular group, so single sha256 the tx is better than sha256d groestl(sha256( ... is a bit much for P2P message ̶b̶u̶t̶ ̶I̶ ̶w̶o̶u̶l̶d̶ ̶a̶l̶w̶a̶y̶s̶ ̶p̶r̶e̶f̶e̶r̶ ̶a̶ ̶s̶i̶n̶g̶l̶e̶ ̶h̶a̶s̶h̶.̶a So that are just my thoughts on that. |
@dflatemaster @gruve-p I propose to use exactly the same hashes in Groestlcoin Lightning as Bitcoin uses, except for the cases where we must use different hashes due to Groestlcoin Core and Bitcoin Core differences. I believe lightning developers carefully weighted all the trade-offs and it is not wise to randomly change hashes in GRS Lightning. Also usage of Bitcoin hashes will make Groestlcoin lightning implementations maintenance easier. |
Thank you for your thoughts @dflatemaster and @yura-pakhuchiy @dflatemaster Let's not use single groestl hash anywhere in c-lightning please. It will bring alot of confusion between the GRS devs, We value your opinion but we need to make it also easy to maintain eclair, lnd and c-lightning. Lets stick to these guidelines: Can you adjust c-lightning based on the above? @HashEngineering Will be adjusting groestlcoin-lib for eclair also next week to the above guidelines |
Signed-off-by: dflate <[email protected]>
I see your point, since almost all moved to the crypto lib, a simple sha is probably enough here. As you probably know LN devs are not free of external influences. And I see patterns of classical strategies like promoting or upvoting trivials or conferences when work is needed or delegating to large sub comissions that never deliver or assigning hard task to not the best in there field. I think the more GRS does his own way and have his own impl, it may have a future. So thanks for your remarks and please never hesitate to say frank what you think. even if I don't react fast or with a smile. |
@dflatemaster I suppose that this was your reply to #16 (comment) OK, I do not want argue about whether LN devs are doing best effort or not, anyway as you said "simple sha is probably enough here". However you have not addressed real issues with your current code I have pointed there. Here is expanded a bit version:
So I propose:
I understand it is much easier to replace code in |
I agree with @yura-pakhuchiy in general. |
Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x7f4dc279163e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e) #1 0x564ee8a24bb1 in htable_default_alloc ccan/ccan/htable/htable.c:19 #2 0x564ee8a2551b in double_table ccan/ccan/htable/htable.c:226 #3 0x564ee8a259e5 in htable_add_ ccan/ccan/htable/htable.c:331 #4 0x564ee89a5300 in block_map_add lightningd/chaintopology.h:83 #5 0x564ee89a6ece in add_tip lightningd/chaintopology.c:626 #6 0x564ee89a72c3 in have_new_block lightningd/chaintopology.c:694 #7 0x564ee89a3ab0 in process_rawblock lightningd/bitcoind.c:466 #8 0x564ee89a2fb4 in bcli_finished lightningd/bitcoind.c:214 #9 0x564ee8a284d6 in destroy_conn ccan/ccan/io/poll.c:244 #10 0x564ee8a284f6 in destroy_conn_close_fd ccan/ccan/io/poll.c:250 #11 0x564ee8a34a0d in notify ccan/ccan/tal/tal.c:235 #12 0x564ee8a34efc in del_tree ccan/ccan/tal/tal.c:397 #13 0x564ee8a35288 in tal_free ccan/ccan/tal/tal.c:481 #14 0x564ee8a26cf5 in io_close ccan/ccan/io/io.c:450 #15 0x564ee8a28c11 in io_loop ccan/ccan/io/poll.c:449 #16 0x564ee89b3c3b in io_loop_with_timers lightningd/io_loop_with_timers.c:24 #17 0x564ee89ba540 in main lightningd/lightningd.c:822 #18 0x7f4dc2143b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a) Signed-off-by: Rusty Russell <[email protected]>
Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7f7678ee863e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e) #1 0x55f8c7b0fce5 in htable_default_alloc ccan/ccan/htable/htable.c:19 #2 0x55f8c7b1064f in double_table ccan/ccan/htable/htable.c:226 #3 0x55f8c7b10b19 in htable_add_ ccan/ccan/htable/htable.c:331 #4 0x55f8c7afac63 in scriptpubkeyset_add wallet/txfilter.c:30 #5 0x55f8c7afafce in txfilter_add_scriptpubkey wallet/txfilter.c:77 #6 0x55f8c7afb05f in txfilter_add_derkey wallet/txfilter.c:91 #7 0x55f8c7aa4d67 in init_txfilter lightningd/lightningd.c:482 #8 0x55f8c7aa52d8 in main lightningd/lightningd.c:721 #9 0x7f767889ab6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a) Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7f05f389563e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e) #1 0x55cac1e6bc99 in htable_default_alloc ccan/ccan/htable/htable.c:19 #2 0x55cac1e6c603 in double_table ccan/ccan/htable/htable.c:226 #3 0x55cac1e6cacd in htable_add_ ccan/ccan/htable/htable.c:331 #4 0x55cac1e56e48 in outpointset_add wallet/txfilter.c:61 #5 0x55cac1e57162 in outpointfilter_add wallet/txfilter.c:116 #6 0x55cac1e5ea3a in wallet_utxoset_add wallet/wallet.c:2365 #7 0x55cac1deddc2 in topo_add_utxos lightningd/chaintopology.c:603 #8 0x55cac1dedeac in add_tip lightningd/chaintopology.c:620 #9 0x55cac1dee2de in have_new_block lightningd/chaintopology.c:694 #10 0x55cac1deaab0 in process_rawblock lightningd/bitcoind.c:466 #11 0x55cac1de9fb4 in bcli_finished lightningd/bitcoind.c:214 #12 0x55cac1e6f5be in destroy_conn ccan/ccan/io/poll.c:244 #13 0x55cac1e6f5de in destroy_conn_close_fd ccan/ccan/io/poll.c:250 #14 0x55cac1e7baf5 in notify ccan/ccan/tal/tal.c:235 #15 0x55cac1e7bfe4 in del_tree ccan/ccan/tal/tal.c:397 #16 0x55cac1e7c370 in tal_free ccan/ccan/tal/tal.c:481 #17 0x55cac1e6dddd in io_close ccan/ccan/io/io.c:450 #18 0x55cac1e6fcf9 in io_loop ccan/ccan/io/poll.c:449 #19 0x55cac1dfac66 in io_loop_with_timers lightningd/io_loop_with_timers.c:24 #20 0x55cac1e0156b in main lightningd/lightningd.c:822 #21 0x7f05f3247b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a) Signed-off-by: Rusty Russell <[email protected]>
Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7ff02889063e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e) #1 0x555ce2ad8d2e in htable_default_alloc ccan/ccan/htable/htable.c:19 #2 0x555ce2ad9698 in double_table ccan/ccan/htable/htable.c:226 #3 0x555ce2ad9b62 in htable_add_ ccan/ccan/htable/htable.c:331 #4 0x555ce2a638e4 in htlc_in_map_add lightningd/htlc_end.h:113 #5 0x555ce2a63beb in connect_htlc_in lightningd/htlc_end.c:39 #6 0x555ce2a85cbc in channel_added_their_htlc lightningd/peer_htlcs.c:1382 #7 0x555ce2a860e1 in peer_got_commitsig lightningd/peer_htlcs.c:1466 #8 0x555ce2a5db04 in channel_msg lightningd/channel_control.c:228 #9 0x555ce2a8d393 in sd_msg_read lightningd/subd.c:474 #10 0x555ce2ada157 in next_plan ccan/ccan/io/io.c:59 #11 0x555ce2adacd4 in do_plan ccan/ccan/io/io.c:407 #12 0x555ce2adad12 in io_ready ccan/ccan/io/io.c:417 #13 0x555ce2adcd67 in io_loop ccan/ccan/io/poll.c:445 #14 0x555ce2a67c66 in io_loop_with_timers lightningd/io_loop_with_timers.c:24 #15 0x555ce2a6e56b in main lightningd/lightningd.c:822 #16 0x7ff028242b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a) Signed-off-by: Rusty Russell <[email protected]>
This will fix a crash that I caused on armv7 and by looking inside the coredump with gdb (by adding an assert on n that must be different from null) I get the following stacktrace ``` (gdb) bt \#0 0x00000000 in ?? () \#1 0x0043a038 in send_backtrace (why=0xbe9e3600 "FATAL SIGNAL 11") at common/daemon.c:36 \#2 0x0043a0ec in crashdump (sig=11) at common/daemon.c:46 \#3 <signal handler called> \#4 0x00406d04 in node_announcement (map=0x938ecc, nann_off=495146) at common/gossmap.c:586 \#5 0x00406fec in map_catchup (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:643 \#6 0x004073a4 in load_gossip_store (map=0x938ecc, num_rejected=0xbe9e3a40) at common/gossmap.c:697 \#7 0x00408244 in gossmap_load (ctx=0x0, filename=0x4e16b8 "gossip_store", num_channel_updates_rejected=0xbe9e3a40) at common/gossmap.c:976 \#8 0x0041a548 in init (p=0x93831c, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., config=0x939cdc) at plugins/topology.c:622 \#9 0x0041e5d0 in handle_init (cmd=0x938934, buf=0x9399d4 "\n\n{\"jsonrpc\":\"2.0\",\"id\":\"cln:init#25\",\"method\":\"init\",\"params\":{\"options\":{},\"configuration\":{\"lightning-dir\":\"/home/vincent/.lightning/testnet\",\"rpc-file\":\"lightning-rpc\",\"startup\":true,\"network\":\"te"..., params=0x939c8c) at plugins/libplugin.c:1208 \#10 0x0041fc04 in ld_command_handle (plugin=0x93831c, toks=0x939bec) at plugins/libplugin.c:1572 \#11 0x00420050 in ld_read_json_one (plugin=0x93831c) at plugins/libplugin.c:1667 \#12 0x004201bc in ld_read_json (conn=0x9391c4, plugin=0x93831c) at plugins/libplugin.c:1687 \#13 0x004cb82c in next_plan (conn=0x9391c4, plan=0x9391d8) at ccan/ccan/io/io.c:59 \#14 0x004cc67c in do_plan (conn=0x9391c4, plan=0x9391d8, idle_on_epipe=false) at ccan/ccan/io/io.c:407 \#15 0x004cc6dc in io_ready (conn=0x9391c4, pollflags=1) at ccan/ccan/io/io.c:417 \#16 0x004cf8cc in io_loop (timers=0x9383c4, expired=0xbe9e3ce4) at ccan/ccan/io/poll.c:453 \#17 0x00420af4 in plugin_main (argv=0xbe9e3eb4, init=0x41a46c <init>, restartability=PLUGIN_STATIC, init_rpc=true, features=0x0, commands=0x6167e8 <commands>, num_commands=4, notif_subs=0x0, num_notif_subs=0, hook_subs=0x0, num_hook_subs=0, notif_topics=0x0, num_notif_topics=0) at plugins/libplugin.c:1891 \#18 0x0041a6f8 in main (argc=1, argv=0xbe9e3eb4) at plugins/topology.c:679 ``` I do not know if this is a solution because I do not know when I can parse a node announcement for a node that it is not longer in the gossip map. So, I hope this is just usefult for @rustyrussell Changelog-Fixed: fixes `FATAL SIGNAL 11` on gossmap node announcement parsing. Signed-off-by: Vincenzo Palazzo <[email protected]>
No description provided.