Commit Graph

684 Commits

Author SHA1 Message Date
Chris Stewart
cff757cb55
2023 10 03 node refactors (#5256)
* Rename PeerMessageSender -> PeerConnection

* WIP: Move gossip methods into PeerManagerApi, keep single peer methods in PeerMessageSenderApi, but remove peer parameter

* PeerData.peerMessaageSender -> PeerData.peerConnection

* Remove DataMessageHandler.queue as it is redundant

* Get most test cases passing in nodeTest

* Fix ReConnectionTest

* Fix NeutrinoNodeWithUncachedBitcoindTest test case

* Rename PeerManager.{randomPeerMsgSender, getPeerMessageSender} -> PeerManager.{randomPeerConnection,getPeerConnection}

* Refactor PeerManager.getPeerMessageSender to return the new PeerMessageSender

* Rename param

* scalafmt

* Remove unused method

* Revert onInitialization
2023-10-09 10:32:05 -05:00
Chris Stewart
522821869d
Move filterBatchCache into NodeState.FilterSync (#5253) 2023-10-05 14:56:08 -05:00
Chris Stewart
1602852419
2023 09 29 waitingdisconnection nodestate (#5251)
* Move waitingForDisconnection into NodeState

* Remove PeerManager.waitingForDisconnection

* Remove mutable _waitingForDisconnection

* Fix compile
2023-10-03 15:35:46 -05:00
Chris Stewart
4972d0a368
Move NodeState to core (#5249) 2023-09-29 12:06:24 -05:00
Chris Stewart
3e6ff52194
2023 09 27 issue 5139 (#5247)
* Add test case for reorg on bitcoin network for NeutrinoNodeTest

* Get unit tests passing

* Refactor findNextHeader() to not take an Option[BlockHeaderDb], not it just takes BlockHeaderDb

* Explicity return None in the case where we don't need sync filter headers

* Fix off by one bug when starting filter header sync
2023-09-29 07:35:26 -05:00
Chris Stewart
9b85838823
Implement logic to restart PeerManager in inactivity checks when we have 0 peers (#5171)
* Implement logic to restart PeerManager in inactivity checks when we have 0 peers

* Revert logback-test.xml

* cleanup
2023-08-01 10:07:40 -05:00
Chris Stewart
99ca1b7abf
Add PeerManagerApi.peers (#5170) 2023-07-28 10:51:10 -05:00
Chris Stewart
ef2c96cc99
Add PeerManagerApi (#5164) 2023-07-25 14:34:32 -05:00
Chris Stewart
b1e6488bb7
Move Socks5ProxyParams, Credentials into core (#5138) 2023-07-08 13:57:44 -05:00
Chris Stewart
08a76fb040
Fix bug in DataMessageHandler.isFiltersSynced() (#5118)
* Fix bug in DataMessageHandler.isFiltersSynced()

* Try alternative implementation to fix bug

* Fix valid states for CompactFilterMessage, revert PeerFinder delay
2023-06-27 14:24:26 -05:00
Chris Stewart
1d82ed04a7
2023 06 18 implement tcp connection using akka streams (#5111)
* WIP: Try to move byte streaming/parsing of p2p messages out of P2PClient

* WIP2: Work on killing the actor, replace it with a steram

* Get basic ability to send/receive version message working

* Transition PeerMessageReceiverState to Initializing inside of PeerMessagesender.connect()

* Refactor things out of PeerMessageSender.connect(), add some flow logs

* Get NeutrinoNodeTest be able to sync passing

* Fix some bugs, create ConnectionGraph helper class

* Use killswitch rather than Source.maybe to disconnect peer

* WIP: Debug

* Switch halfClose to false on Tcp.outgoingConnection() to not keep lingering connections

* Delete P2PClientActorTest

* Delete all P2PClient stuff

* Attempt implementing reconnection logic in PeerMessageSender

* remove supervisor

* Empty commit to re-run CI

* Small cleanups

* Implement sendResponseTimeout()

* Restore logback-test.xml

* Add callback to log error message on reconnect

* Increase queueSize/maxConcurrentOffers size
2023-06-24 07:53:44 -05:00
Chris Stewart
3740b4fc35
Implement batchAndParallelExecute with Future.traverse rather than Future.sequence (#5051) 2023-04-20 17:59:09 -05:00
Chris Stewart
447c6d03de
Implement getconnectioncount rpc (#5048)
* Implement getconnectioncount rpc

* Reduce waits in test, add documentation

* Fix docs

* Empty commit to re-run CI
2023-04-19 16:47:54 -05:00
Chris Stewart
3728b9a9d9
Refactor HDPath pattern matching to be safer. (#5046)
* Refactor hd path pattern matching to be safer. Also avoids warnings in scala3

* Allow single element bip32 path
2023-04-19 08:41:10 -05:00
Chris Stewart
dc0e3645d0
2023 03 24 is tip stale (#5024)
* WIP

* Fix test

* Add more tests for stale header

* remove uncessary comments
2023-03-26 08:20:27 -05:00
benthecarman
5e6cb0d514
Fix MilliSatoshis.toSatoshis for large values (#5016) 2023-03-20 09:26:32 -05:00
Chris Stewart
875a67a73c
2023 03 03 rm DataMessageHandler filter params (#5009)
* Remove DataMessageHandler filter params, tests not passing

* Adjust logging levels

* WIP

* Get tests passing

* Cleanup

* Fix logging level

* Invert isSynced flag

* Rework BaseBlockchain.toString

* Fix BlockchainTest

* Fix syncing of compact filters when walletCreationTime is passed into dmh

* Cleanup
2023-03-14 11:45:21 -05:00
rorp
2799d8276a
Update Eclair RPC to v0.8.0 (#4994)
* Update Eclair RPC to v0.8.0

* update unit tests
2023-03-04 09:02:36 -06:00
Chris Stewart
0577b8c1fe
Improve Inventory toString messages (#4997)
* Improve Inventory toString messages

* Add individual counts rather than showing each service identifier

* Add peer= prefix to peer
2023-02-23 14:12:53 -06:00
benthecarman
8bd10d0f40
Correctly handle witness v1+ spks in fallback addresses (#4949) 2023-01-12 11:39:56 -06:00
Chris Stewart
d297311814
Catch non RescanTerminatedEarly errors when rescan is terminated with an exception (#4939) 2023-01-05 12:40:50 -06:00
benthecarman
7a3c6aef36
Fix isLocalhost for 127.0.0.1 (#4900) 2022-11-27 11:29:45 -06:00
benthecarman
cc8d327ea5
Support bip32 paths with 'h' instead of an apostrophe (#4881) 2022-11-12 12:49:38 -06:00
Chris Stewart
4fa31b1bc2
Add OrderedDLCPayoutCurvePieces (#4875) 2022-11-03 10:18:01 -05:00
Chris Stewart
92613709aa
Add OrderedTLVPoints as this is an invariant in the codebase in DLCPayoutCurve (#4874) 2022-11-02 17:20:55 -05:00
Chris Stewart
994ee25733
Fix empty witness from companion object to case class (#4823) 2022-10-12 08:59:31 -05:00
rorp
de43dadf52
Network notifications (#4774)
* Network notifications

* add more tests

* don't drop futures on the floor

* Improve logging, don't drop futures on floor

* scalafmt

* add error messages to the failure notifications

* update unit tests

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-10-09 07:46:13 -05:00
benthecarman
6d0c768975
Compare bytes when comparing ScriptWitnesses (#4521) 2022-10-02 19:19:18 -05:00
Chris Stewart
e8ebcf55cd
Fix bug where signatures were out of order from what was posted in the announcement (#4809) 2022-09-30 14:00:14 -05:00
Chris Stewart
34e023e93f
2022 09 29 handle unordered sigs (#4807)
* Get unit tests passing for unordered nonces/signatures

* Get v0 oracle announcements working again on listannouncements

* Add unit test to make sure we can still validate signatures for attestments with nonces out of order
2022-09-29 11:43:50 -05:00
Chris Stewart
8d91abd678
Add signature ordering to ClaimedDLCStatus.oracleSigs (#4804)
* Add signature ordering to ClaimedDLCStatus.oracleSigs

* fix bug
2022-09-27 09:43:37 -05:00
Chris Stewart
9c506b639f
Add OrderedSchnorrSignatures, use it in OracleAttestment (#4803)
* Add OrderedSchnorrSignatures, use it in OracleAttestment, propagate it threw the codebase

* Small cleanups

* Add SortedVecFactory

* Fix test case with out of order nonces
2022-09-26 19:35:04 -05:00
Chris Stewart
4cb47c4ef4
Remove event descriptor parameter from SigningVersion.calcOutcomeHash() (#4796) 2022-09-23 06:17:38 -05:00
benthecarman
75b034d6e0
Add socket address to NodeUri (#4794) 2022-09-20 16:35:04 -05:00
Chris Stewart
bcddb015ae
2022 09 12 Filter header and filter websocket events (#4777)
* implement chain callbacks for compact filter headers / compact filters

* Wire it up through the websocket

* Fix type for compactfilterprocessed

* Fix bug to write json rather than write a string
2022-09-15 20:05:54 -05:00
benthecarman
2f18f622ab
Give BitcoinNetworks.knownNetworks proper type (#4766) 2022-09-11 13:14:03 -05:00
rorp
16893f999e
DLC connection checks and notifications (#4720)
* DLC connection checks and notifications

* asynchronous connection checks
2022-09-09 14:09:38 -05:00
Chris Stewart
26595ab3ac
Fix bug where no exception was thrown if the acceptor did not have enough money (#4728)
* Fix bug where no exception was thrown if the acceptor did not have enough money

* Revert ContractInfo.max definition, fix bug in acceptDLCOffer

* Fix incorrect usages of ContractInfo.max

* Refactor ContractInfo.max -> ContractInfo.maxOfferorPayout

* Fix dlc.md
2022-09-07 19:08:27 -05:00
Chris Stewart
328e1653a9
Drop support for scalac 2.12.x (#4704)
* Drop support for scalac 2.12.x

* Turn logging level OFF

* Remove more 2.12.x files
2022-09-03 10:16:22 -05:00
rorp
a5186cd1da
Change default DLC peer alias (#4663) 2022-08-25 06:57:16 -05:00
Chris Stewart
a0eb0824a2
Fix some bugs around resetting rescan state when a rescan fails (#4642)
* Fix some bugs around resetting rescan state when a rescan fails

* Add test case

* Use .fail() method
2022-08-22 12:55:18 -05:00
Chris Stewart
86463231d6
2022 08 18 Add configuration to only emit websocket events when IBD is done (#4627)
* Implement isinitialblockdownload flag in databaes

* Change to IsInitialBlockDownload to be less confusing

* Fix missing refactors, add ChainApi.isIBD()

* Implement logic for ChainApi.isIBD(), add configuration flag to toggle whether to emit websocket events while IBD is ongoing or not, add isinitialblockdownload field to getinfo endpoint

* Remove confusing ChainApi.isIBD() that didn't accurately account for the case where IBD wasn't set in the database

* Fix bug around emitting the websocket events

* Add some documentation
2022-08-22 10:09:00 -05:00
benthecarman
825937ea5f
Add more JSON serializers (#4628)
* Add more JSON serializers

* use PicklerKeys for consistent field names across codebase

* scalafmt

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-21 08:38:02 -05:00
Chris Stewart
1b19872ac4
Implement exportstakingaddresswif (#4617)
* Implement exportstakingaddresswif

* Add documentation

* Add unit test
2022-08-16 12:37:58 -05:00
benthecarman
26492d2449
Add descriptor for TaprootScriptPubKey (#4595) 2022-08-10 07:10:23 -05:00
Chris Stewart
326cb9845e
Implement listDLCs(state), use it in getWalletAccounting() (#4591) 2022-08-09 11:02:45 -05:00
benthecarman
b04a34ad02
Use FutureUtil.makeAsync where we are attmepting to create async Futures (#4583) 2022-08-08 15:22:32 -05:00
benthecarman
6119a334fa
Make fundRawTransactionInternal use DBIOActions (#4575)
* Make fundRawTransactionInternal use DBIOActions

* Fix to correctly use callback

* Move reservedUTXOsCallbackF to FundRawTxHelper
2022-08-06 17:14:02 -05:00
Chris Stewart
c03b158f94
Implement RescanTerminatedEarly exception to terminate the stream, implement ArgumentSource (#4574)
* Implement RescanTerminatedEarly exception to terminate the stream, implement ArgumentSource to understand where arguments passed into bitcoin-s are coming from

* Bump timeout
2022-08-04 14:11:07 -05:00
Chris Stewart
a02e25b0ce
Refactor WalletRoutes to take DLCWalletLoaderApi as a paramete (#4565)
* Refactor WalletRoutes to take DLCWalletLoaderApi as a parameter, use the walletHolder inside of DLCWalletLoaderApi to fulfill requests

Fix rebase

Reduce parallelism in fetchFiltersFlow to 1 to reduce chance of hitting akka's max open requests

* Try fix loader test by catching RejectedExecutionException

* Add println to see if catching excpetion gets hit

* WIP: Try to fix recursive rescan

* Don't map on recursiveRescan so we don't block on it
2022-08-04 09:16:46 -05:00