Commit graph

4045 commits

Author SHA1 Message Date
Conner Fromknecht
2383a04977
wire/msginv: optimize by reusing small buffers 2023-12-15 16:37:13 -08:00
Conner Fromknecht
f37f4750dc
wire/msgcfcheckpt: optimize serialization by reusing small buffers 2023-12-15 16:37:09 -08:00
Conner Fromknecht
1990555eee
wire/msggetcfcheckpt: optimize by removing read/writeElement 2023-12-15 16:37:02 -08:00
Conner Fromknecht
1c525dbd0e
wire/msgcfheaders: optimize encode/decode by using one small buffer 2023-12-15 16:36:56 -08:00
Conner Fromknecht
d042fe0586
wire/msggetcfheaders: use single small buffer for encode/decode 2023-12-15 16:36:54 -08:00
Conner Fromknecht
83675cb393
wire/msgheaders: optimize serialization by reusing small buffers 2023-12-15 16:36:51 -08:00
Conner Fromknecht
c0d35e6d92
wire/msggetheaders: optimize serialization by reusing small buffers 2023-12-15 16:36:49 -08:00
Conner Fromknecht
d8e08170bd
wire/msgblock: optimize DeserializeTxLoc by reusing small buffers 2023-12-15 16:36:46 -08:00
Conner Fromknecht
ee1f8077d8
wire/msgblock: use only one small buffer per block encode/decode 2023-12-15 16:36:44 -08:00
Conner Fromknecht
4ebc651689
wire/msggetblocks: optimize by reusing small buffer 2023-12-15 16:36:41 -08:00
Conner Fromknecht
674c2202ea
wire/invvect: add optimized readInvVectBuf and writeInvVectBuf 2023-12-15 16:36:38 -08:00
Conner Fromknecht
3cee06eaeb
wire/blockheader: introduce optimized writeBlockHeaderBuf 2023-12-15 16:36:36 -08:00
Conner Fromknecht
aa769e3da6
wire/bench_test: introduce optimized readBlockHeaderBuf 2023-12-15 16:36:33 -08:00
Conner Fromknecht
0cf8c19d5a
wire/msgtx: use readScriptBuf in txn serialization 2023-12-15 16:36:31 -08:00
Conner Fromknecht
3a91303a1a
wire/msgtx: use writeTxWitnessBuf in txn serialization 2023-12-15 16:36:28 -08:00
Conner Fromknecht
3bfd0c6cb3
wire/msgtx: introduce optimized writeTxWitnessBuf 2023-12-15 16:36:26 -08:00
Conner Fromknecht
24d42177a2
wire/msgtx: use readTxOutBuf in txn serialization 2023-12-15 16:36:23 -08:00
Conner Fromknecht
aebc74398a
wire/msgtx: introduce optimized readTxOutBuf 2023-12-15 16:36:20 -08:00
Conner Fromknecht
48d31e5926
wire/msgtx: use WriteTxOutBuf in txn serialization 2023-12-15 16:36:18 -08:00
Conner Fromknecht
7c8844f56f
wire/msgtx: introduce optimized WriteTxOutBuf 2023-12-15 16:36:15 -08:00
Conner Fromknecht
607eea193f
wire/msgtx: use readTxInBuf in txn serialization 2023-12-15 16:36:13 -08:00
Conner Fromknecht
6f4a7a142a
wire/msgtx: introduce optimized readTxInBuf 2023-12-15 16:36:10 -08:00
Conner Fromknecht
99f6488fa0
wire/msgtx: introduce optimized readScriptBuf 2023-12-15 16:36:08 -08:00
Conner Fromknecht
4829ff793b
wire/msgtx: use writeTxInBuf in txn encoding 2023-12-15 16:36:05 -08:00
Conner Fromknecht
d43d9d57a9
wire/msgtx: introduce optimized writeTxInBuf 2023-12-15 16:36:02 -08:00
Conner Fromknecht
b1710129f6
wire/msgtx: introduce optimized read/writeOutPointBuf 2023-12-15 16:36:00 -08:00
Conner Fromknecht
7951aa5a97
wire/common: add optimized Read/WriteVarBytesBuf 2023-12-15 16:35:57 -08:00
Conner Fromknecht
e12d32d41c
wire/msgtx: reuse tx-level buffer for version and locktime 2023-12-15 16:35:55 -08:00
Conner Fromknecht
e58aadc7b4
wire/msgtx: use Read/WriteVarIntBuf in tx serialization 2023-12-15 16:35:52 -08:00
Conner Fromknecht
6275db9970
wire: introduce Read/WriteVarIntBuf to reuse buffers between invocations 2023-12-15 16:35:49 -08:00
Conner Fromknecht
a371aeb945
wire/common: optimize Read/WriteVarInt 2023-12-15 16:35:47 -08:00
Conner Fromknecht
a9edc326fb
wire/bench: add witness block 2023-12-15 16:35:44 -08:00
Conner Fromknecht
b434080727
wire/bench_test: report allocs in benchmarks 2023-12-15 16:35:40 -08:00
Olaoluwa Osuntokun
28a816f050
btcutil/psbt: update to chaincfg/chainhash/v1.1.0 + btcutil/v1.1.3
We also remove the replace directives in place.
2023-12-15 14:55:10 -08:00
Olaoluwa Osuntokun
7745cbb679
btcutl/gcs: update filter logic to use new DoubleHashRaw 2023-12-15 14:42:35 -08:00
Olaoluwa Osuntokun
e22513c237
btcutil: update to chaincfg/chainhash/v1.1.0 2023-12-15 14:42:29 -08:00
Olaoluwa Osuntokun
96c9fd8078
Merge pull request #1978 from kcalvinalvin/memory-efficient-txhash
chainhash, wire, btcutil, main: Memory efficient txhash
2023-12-15 14:18:05 -08:00
Calvin Kim
e318551538 blockchain: Add sizehelper
This change is part of the effort to add utxocache support to btcd.

sizehelper introduces code for 2 main things:
    1: Calculating how many entries to allocate for a map given a size
       in bytes.
    2: Calculating how much a map takes up in memory given the entries
       were allocated for the map.

These functionality are useful for allocating maps so that they'll be
allocating below a certain number of bytes.  Since go maps will always
allocate in powers of B (where B is the bucket size for the given map),
it may allocate too much memory.  For example, for a map that can store
8GB of entries, the map will grow to be 16GB once the map is full and
the caller puts an extra entry onto the map.

If we want to give a memory guarantee to the user, we can either:
    1: Limit the cache size to fixed sizes (4GB, 8GB, ...).
    2: Allocate a slice of maps.

The sizehelper code helps with (2).
2023-12-13 23:48:54 +09:00
Oliver Gugger
4f72645a8a make: add install and release-install goals
To simplify building the release-grade (stripped and
reproducible) binaries from source, we add the install and
release-install make goals. Running either of the commands will create
binaries in the $GOPATH/bin directories.
The main difference between the two goals is that the release-install
will not contain any local paths and no debug information.
2023-12-11 09:16:27 -05:00
Oliver Gugger
36637f9ff9 git: add binaries to .gitignore file 2023-12-11 09:16:27 -05:00
Oliver Gugger
c9cda53709 multi: remove use of GO111MODULE
The use of the GO111MODULE environment variable doesn't have any effect
anymore and hasn't for a couple of versions. The default was set to "on"
a while back, so we can remove that variable everywhere.
2023-12-11 09:16:27 -05:00
Olaoluwa Osuntokun
55ac06b142
Merge pull request #2035 from kcalvinalvin/2023-09-25-change-is-sync-candidate-behavior
wire, netsync: change isSyncCandidate behavior
2023-12-08 16:28:18 -08:00
Peter Todd
909106575e Update petertodd seed DNS to .net
Also, add mainnet seed.
2023-12-08 09:58:00 -05:00
Olaoluwa Osuntokun
ac068e7f61
Merge pull request #1688 from kcalvinalvin/add-blockindex-parentskips
blockchain: Add ancestor optimization to finding Ancestor
2023-12-06 16:27:05 -08:00
John C. Vernaleo
7520523a9a Correct comments in singature.go 2023-11-29 13:20:44 -05:00
wydengyre
a4236c5010 schnorr: simplify some signing math
We reuse the Bytes() function rather than duplicating its logic.
2023-11-29 09:44:44 -05:00
Evan Tedesco
6ea604df63 Fix typos on signature.go 2023-11-28 16:44:19 -05:00
xiaolou86
4171854739 Fix typos 2023-11-20 12:04:31 -05:00
Calvin Kim
f396b3d3d9 blockchain: better Ancestor with skiplists
On startup, Ancestor call was taking a lot of time when the node was
loading the blockindex onto memory. This change speeds up the Ancestor
function significantly and speeds up the node during startup.

On testnet3 at blockheight ~2,500,000, the startup was around 30seconds
on current main and was 5 seconds with this change. Below is a benchstat
result showing the significant speedup.

goos: darwin
goarch: arm64
pkg: github.com/utreexo/utreexod/blockchain
           │     old.txt      │               new.txt                │
           │      sec/op      │    sec/op     vs base                │
Ancestor-8   120819.301µ ± 5%   7.013µ ± 19%  -99.99% (p=0.000 n=10)

           │  old.txt   │            new.txt             │
           │    B/op    │    B/op     vs base            │
Ancestor-8   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

           │  old.txt   │            new.txt             │
           │ allocs/op  │ allocs/op   vs base            │
Ancestor-8   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal
2023-11-17 16:55:58 +09:00
Olaoluwa Osuntokun
f7e9fba086
Merge pull request #1918 from kcalvinalvin/2022-11-06-implement-getchaintips
blockchain, btcjson: Implement getchaintips rpc call
2023-11-14 17:16:15 -08:00