-
Notifications
You must be signed in to change notification settings - Fork 268
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
Node 0.10.x / 0.11.x stopped working after restart "requirement failed: public key is invalid" #3009
Comments
Error message on master changed line numbers to: 12:26:19,212 ERROR a.a.OneForOneStrategy - requirement failed: public key is invalidjava.lang.IllegalArgumentException: requirement failed: public key is invalid |
With the help of some debug logging I've managed to narrow it down to: 2025-02-16 14:29:25,758 ERROR f.a.e.w.p.CommonCodecs - [CommonCodecs] Failed to decode public key: 03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370d0c863e8f0ce56java.lang.IllegalArgumentException: requirement failed: public key is invalid This looks like it's parsing LN node pub keys? With the help of GPT4 I've modified to do some logging. As it's now using try{} / catch{} logic it's not crashing the code opening the LN and API port anymore and the node seems function. I'd still like to better understand what's going on: eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/CommonCodecs.scala import org.slf4j.LoggerFactory // Import Logger val publicKey: Codec[PublicKey] = Codec[PublicKey](
) |
The pubkey in your log starts like the acinq node pubkey. Only the last 7 bytes differ:
|
I've dumped the sqlite databases eclair, audit, network hunting for The legit ACINQ node and Electrum Trampoline are in there and are also checked for mutiple times (once per channel?) as pub keys on startup. |
That's very strange indeed: this public key is not a valid public key (not a point on the secp256k1 curve). The fact that it looks a lot like our node's public key is intriguing. Since this fails at start-up, it is likely that this is data that is either read from the DB or the configuration. Invalid data should never get into the DB: we always validate data before writing it to the DB, unless we've missed something important. Are you 100% sure this public key doesn't appear in the DB? Note that public keys are not hex-encoded in SQLite but rather encoded as blobs of bytes. A good way to make sure is to read your DB in a unit test and verify that everything can be listed properly: that would guarantee that this invalid data is not found in the DB. I can share some code that does this validation for you if you want. If it's not coming from the DB, it is likely coming from It would be useful to have a better stack trace to figure out what data is being decoded that contains this public key. Can you try printing the exception's stack trace explicitly (with |
Were you running eclair 0.10.0 or master ? were you upgrading to 0.11.0 or to a commit on master ? It does look like a db error, can you try starting eclair without the network db ? (just move all the |
I was running 0.10.0 then upgraded to 0.11.0 and then master (from yesterday). The issue occurred on restart back on 0.10.0 |
Just to make sure we understand you correctly: please confirm that you never downgraded eclair? You were initially at Eclair doesn't support reverting to a previous version if there was a DB migration (we only support migrating data towards a newer version, not towards an older one). |
It's impossible to know yet, that depends on where that public key comes from (channel data or network data). |
Yes, I can confirm, I've never downgraded! What I've tried doing is dumping the sqlite database to text and then grepping through it. I can find all the legit channel public ids but not the malformed one. Still curious to me. |
Yes please, I'd happily run that.
I've checked the config, it's not there.
Here's a getStackTrace'd output of the error
|
Some further info: This was fixed by upgrading to a supported bitcoind on Sat 15th: 2025-02-15 16:06:18,291 INFO f.a.e.b.b.zmq.ZMQActor - connected to tcp://127.0.0.1:29000 The last msg=UpdateFailHtlc before the restart was recorded 2025-02-14 11:50:04,425 to the log. |
The stack trace is very helpful! The issue comes from an incoming HTLCs that somehow contains invalid content (which should never crash the node...), I still need to figure out why exactly. This means it's not something coming from your DB, so your temporary patch should be fine and doesn't create a risk of mass channel force-close or loss of funds. I have what I need to keep investigating and will come back to this issue once I've figured it out. |
I'm now on master and Bitcoin Core 28.1, same issue unfortunately.
Discussed in #3008
Originally posted by EagleTM February 15, 2025
Hi,
I'm running into a fatal issue on a bech32 wallet on 0.10.x with core 25.0 the error persists upon upgrading to 0.11.x with bitcoin core 27.2
The node was shutdown cleanly. Upon restart the error message is:
It never binds the ln port, so can't be queried further:
2025-02-15 17:01:17,722 INFO fr.acinq.eclair.Setup - initial address= for bitcoin wallet=eclair
2025-02-15 17:01:17,811 INFO akka.actor.ActorCell - channels listener is ready
2025-02-15 17:01:17,871 ERROR a.a.OneForOneStrategy - requirement failed: public key is invalidjava.lang.IllegalArgumentException: requirement failed: public key is invalid
at scala.Predef$.require(Predef.scala:337)
at fr.acinq.bitcoin.scalacompat.Crypto$PublicKey$.fromBin(Crypto.scala:115)
at fr.acinq.bitcoin.scalacompat.Crypto$PublicKey$.apply(Crypto.scala:111)
at fr.acinq.eclair.wire.protocol.CommonCodecs$.$anonfun$publicKey$4(CommonCodecs.scala:167)
at scodec.DecodeResult.map(DecodeResult.scala:17)
at fr.acinq.eclair.wire.protocol.CommonCodecs$.$anonfun$publicKey$3(CommonCodecs.scala:167)
at scodec.Attempt$Successful.map(Attempt.scala:111)
at fr.acinq.eclair.wire.protocol.CommonCodecs$.$anonfun$publicKey$2(CommonCodecs.scala:167)
at scodec.Codec$$anon$10.decode(Codec.scala:484)
at scodec.Codec$$anon$7.decode(Codec.scala:411)
at scodec.DecoderFunctions.decodeBothCombine(Decoder.scala:137)
at scodec.DecoderFunctions.decodeBothCombine$(Decoder.scala:133)
at scodec.Codec$.decodeBothCombine(Codec.scala:472)
at scodec.codecs.HListCodec$$anon$2.decode(HListCodec.scala:22)
at scodec.Codec$$anon$2.decode(Codec.scala:201)
at scodec.DecoderFunctions.decodeCollect(Decoder.scala:184)
at scodec.DecoderFunctions.decodeCollect$(Decoder.scala:175)
at scodec.Decoder$.decodeCollect(Decoder.scala:228)
at scodec.codecs.ListCodec.decode(ListCodec.scala:16)
at scodec.Decoder$$anon$1.decode(Decoder.scala:48)
at scodec.GenCodec$$anon$2.decode(GenCodec.scala:78)
at scodec.Decoder$$anon$2.$anonfun$decode$2(Decoder.scala:57)
at scodec.Attempt$Successful.flatMap(Attempt.scala:113)
at scodec.Decoder$$anon$2.decode(Decoder.scala:56)
I tried starting with elcair network database moved to backup, no difference
I'm at loss what the issue could be - I'm assuming it has issues parsing bitcoin-core wallet pubkeys rather than ln pubkeys.
Any ideas what I could do to debug this further?
The text was updated successfully, but these errors were encountered: