Commit Graph

12826 Commits

Author SHA1 Message Date
tomFlowee f0d426dc90 make compile 2024-08-11 18:49:35 +02:00
tomFlowee d2ce7e61d2 Refactor socket to live in a wrapping class. 2024-08-11 18:49:35 +02:00
tomFlowee 0eefbd28fb Also add the ssl to the exported cmake 2024-08-11 18:49:35 +02:00
tomFlowee 712dcdb3a6 Start to implement the ssl server. 2024-08-11 18:49:35 +02:00
tomFlowee 6966dd8643 Minor messaging cleanups in cmake. 2024-08-11 18:49:35 +02:00
tomFlowee b4e90cf945 Add ssl lib to networkmanager 2024-08-11 18:49:35 +02:00
tomFlowee 210fef16cc Start making space for an ssl backend. 2024-08-11 18:49:35 +02:00
tomFlowee e9f89556eb Backport uPNP compile fix
This comes from Bitcoin Core commit: 8acdf6654

upnp: add compatibility for miniupnpc 2.2.8
original patch by: Cory Fields
2024-07-26 11:50:13 +02:00
tomFlowee 4c2adc1728 Silence cmake
The cmake boost integration has changed, which means we need to
test how to do this over a large number of setups to do
it "correctly" and that's going to be a task for later.

For now, lets avoid the message and make clear we want to keep
the old behavior.
2024-07-06 22:13:44 +02:00
tomFlowee 85a6e20e1a Have better spread checkpoints and adjust the unit test
This updates the unit test to move the tiny chain it tests to match the
new checkpoint location.
2024-07-06 22:00:34 +02:00
tomFlowee 9008b4a312 Update checkpoints
The checkpoints were formerly copied from the full node, so based
on possible fork-events.
That seems less useful nowadays and since we want to be able to
allow starting a blockchain instance from any checkpoint it makes
sense to spread them out more evenly.
Based on the concept that the BCH chain generates around 50K blocks
a year, we simply use that interval.

This removes various very old ones meaning that the total count is
roughly equal.
2024.07.0
2024-06-29 20:26:35 +02:00
tomFlowee 0838a4cc93 Add more support for checkpoint based chains.
This improves the docs, adds a getter and last it makes the
blockHeightAtTime() more secure by not returning a value below the
checkpoint. As this would throw if used directly in the block() method.
2024-06-29 11:52:29 +02:00
tomFlowee f3f14f8074 New version 2024-06-26 21:57:37 +02:00
tomFlowee 4acc8ee883 Fix check for chain integrity. 2024-06-26 21:57:07 +02:00
tomFlowee c2ae326620 More sanity checks for creating partial chain. 2024-06-25 23:01:59 +02:00
tomFlowee 3b91e503ff Fix binary search on smaller chain
When a chain starts from a checkpoint instead of '1', we should limit
our search to that in order to avoid codepaths that throw.
2024-06-25 23:00:51 +02:00
tomFlowee 073e133ec7 Improve readability of warning 2024-06-25 22:59:36 +02:00
tomFlowee 68cf4ae48f Fix ConstBuffer::indexOf constness
This method is now const, as it should be.
2024-06-11 21:34:41 +02:00
tomFlowee 6a84a262cc Add more ConstBuffer helper methods
This adds endsWith() and an extra startsWith() overload.

We also added tests for the case when either the argument or the object
are empty and specify the behavior. I copied the behavior of QString.

See unit tests that specify the behavior with empties.
2024-06-11 17:57:17 +02:00
tomFlowee dc3545857d [p2pnet] Add Blockchain::replaceStatichain()
This public method allows an application to replace the static-
header files in a life-situation. Without needing to restart the app.

The idea is that a static chain starts at a checkpoint, and we extend
it into the past to start at an earlier checkpoint. This suddenly
makes available a larger amount of history without changing anything
of the data that was already there.
2024-06-02 21:22:37 +02:00
tomFlowee 5ada583bd1 Fixlets in code and comments. 2024-06-02 11:58:05 +02:00
tomFlowee dcaddcca7c Remove unused include 2024-06-01 19:22:27 +02:00
tomFlowee 7ecd46ba1c Make checkpoints available via method call.
This also adds docs.
And this moves away from the map which isn't worth the code complexity
with the low number of entries.
2024-05-31 13:05:38 +02:00
tomFlowee 422822530b Add Blockchain::dataSources() getter
The blockchain object holds all block-headers, the backing store for
this class is now being exposed more to allow understanding what we have
or not have available. And also what the source of that info is.
2024-05-28 10:51:52 +02:00
tomFlowee 6229055dd2 new release version 2024.05.0 2024-05-05 21:30:27 +02:00
tomFlowee 4845de2470 Add PrivateKey::fromBase58() 2024-05-01 21:55:25 +02:00
tomFlowee e28b5e1823 Make simpler 2024-05-01 21:54:22 +02:00
tomFlowee 4f3fd8b5bd Add support for xpriv import on HDMasterKey
This essentially adds support for a derived HDMasterKey to exist.
2024-05-01 21:54:19 +02:00
tomFlowee 2cd73ba4fb Add xpriv creation with derivation path. 2024-04-29 21:13:03 +02:00
tomFlowee 65517840ac Add level() getter 2024-04-26 16:56:44 +02:00
tomFlowee 8da1892995 Add ConstBuffer toHex() methods to get a string out. 2024-04-21 00:11:47 +02:00
tomFlowee 3e9cf0173f Add assert to avoid misuse and mem issues. 2024-04-21 00:11:07 +02:00
tomFlowee 2bb858b62d Tweak UTXO numbers
As the "normal" machine that runs this kind of software gets more
memory, it is Ok to increase the numbers in order to aim to keep more
data cached in memory between check-points, and have less check-points.

This mostly helps speeding up initial block download, it also helps keeping
the utxo datadir small and non-fragmented. All good for speed.
2024-04-07 20:19:46 +02:00
tomFlowee b749d4fbe5 Minor changes 2024-04-07 20:19:46 +02:00
tomFlowee d4b1d240f0 Add unspentdb export --no-export argument
This basically just walks the of records without actually exporting
them.
It will nicely print related info files, number of actual records found
etc.
2024-04-07 20:19:46 +02:00
tomFlowee 665d61eeb4 Add various helpful warnings and info messages. 2024-04-07 20:19:46 +02:00
tomFlowee 20e6b356da Add ability for Export to take a dir
This will iterate over all DBs and list all of them.

Additionally, add a 'height' option to list at a specific height.
2024-04-07 20:19:46 +02:00
tomFlowee d680346e25 Make the command line arguments a bit clearer
This allows us to explicitly specify dir/info/db arguments.
2024-04-07 20:19:46 +02:00
tomFlowee 1165da7336 Make bloom filter cheaper 2024-04-05 12:38:21 +02:00
tomFlowee 995750fc99 Increase the requested FD count
Our database uses memmapping and each blk file allocates a file-
descriptor (FD). As such we should increase the number at the start of
the app, if we can.

Notice that the 2000 is chosen to work with a full node that still uses
tiny blk files (128 typically) instead of 1GB files as the Hub makes by
default.

Also fix a bug in the handing code. Using the hardcoded default
FD_SETSIZE made no sense there..
2024-03-28 16:16:48 +01:00
tomFlowee f84c61e187 Follow styleguide; methods start with a lowercase char. 2024-03-20 19:12:50 +01:00
tomFlowee 517a90abeb Detect too many orphans
If for some reason there are a massive amount of orphaned headers, we
don't just keep them around until they are resolved as that is
detrimental to the operation of the node.

Special case this for a reindex and simply skip all orphans fur the
duration.
2024-03-20 19:11:58 +01:00
tomFlowee f1505c0ac7 Handle a large set of metadata files better
Don't wait more than 10 seconds for missing DB data, we'll have to
conclude they won't be forthcoming and just register this in the log.
2024-03-20 19:05:38 +01:00
tomFlowee 96660d90c6 remove unused includes 2024-03-20 19:03:10 +01:00
tomFlowee 53d417e727 Allow using tiny DB files.
Doing a -reindex on a datadir of a different client gives us thousands
of small blk files, which may result in us hitting the max simultaneous
open files limit.
This change forces us to flush the list a bit more aggressively and
close open files.
2024-03-19 09:08:55 +01:00
tomFlowee 2983c8e7a0 Add txversion getter/setter 2024-03-13 17:02:19 +01:00
tomFlowee f62acbed6b New version 2024.02.0 2024-02-27 19:43:19 +01:00
tomFlowee 6ade318b2e Introduce interleaving during download
The download from a peer is now limited to just 4000 blocks, at which
point the download proceeds from another peer.
Naturally it can go back to the first afterwards too.

The idea is that we download a month worth of blocks at a time and then
fetch the same blocks from a backup peer in order to be certain we
actually see the real state.
The problem we've seen is that after the first downloads we end up
starting the second and if the initial sync or a similar large download
happens, many people won't leave it running until the backup actually
completes since the UI looks like its finished.

This is also a good starting point for rating peers at download speed by
having predictable chunks and that means we could time and aim to use
the faster peers.
This is becoming relevant as we can see a huge difference where peers
give you 10x performance compared to some of the slower ones.
2024-02-23 22:08:28 +01:00
tomFlowee a53d03c5a3 Avoid too harsh a reaction on slowness
Afterall, the slowness can very well be temporary.
2024-02-23 22:01:48 +01:00
tomFlowee 58ec8fb8f8 Fix typo in enum name. 2024-02-23 17:28:40 +01:00