Commit graph

3824 commits

Author SHA1 Message Date
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
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
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
Calvin Kim
b4992febff netsync: change isSyncCandidate behavior to include pruned nodes
isSyncCandidate is now changed to return true even if the peer is a
pruned node if and only if our chaintip is within 288 blocks of the
peer.

Rationale:
Pruned nodes that signal NODE_NETWORK_LIMITED MUST serve 288 blocks from
their chaintip.  If our chaintip is within that range, this peer can be
a sync candidate even if they aren't an archival node.
2023-11-07 11:04:34 +09:00
Calvin Kim
a09e7b224a wire: add HasFlag method 2023-11-07 11:04:34 +09:00
Calvin Kim
375f79dcd0 chainhash: Add DoubleHashRaw
DoubleHashRaw provides a simple function for doing double hashes.  Since
it uses the digest instead of making the caller allocate a byte slice, it
can be more memory efficient vs other double hash functions.
2023-11-07 08:27:02 +09:00
ClaytonNorthey92
d15dd71087 added tests for GetBestBlockHashAsync
now testing that GetBestBlockHashAsync sends the getbestblockhash command via websocket connection and that the channel returned can be used to send the response when it is received
2023-11-06 15:56:24 -05:00
ClaytonNorthey92
d988b86027 Added test for client.GetChainTxStatsAsync() in rpcclient. This sets up a test websocket server to run the tests. Also, ensure these are run within a timeout, since they rely on concurrency 2023-11-02 16:16:11 -04:00
ClaytonNorthey92
208800c5f4 Added tests for FutureGetBestBlockHashResult.Receive 2023-11-02 15:17:27 -04:00
0xEclair
0e795fbbfb fix: default forward port 2023-11-01 16:51:20 -04:00
Olaoluwa Osuntokun
e16cdb6bcf
Merge pull request #2051 from Crypt-iQ/txscript_alloc_cb_change
blockchain: export CheckSerializedHeight
2023-10-31 13:02:24 -07:00
eugene
1a615550b7
blockchain: export CheckSerializedHeight, reduce allocs for cb height
parsing

Some callers only want to check the coinbase height rather than be given
the height.
2023-10-30 12:06:10 -04:00
David Cardenas
ad26585576 Update LICENSE 2023-10-20 15:24:16 -04:00
Kevin Heavey
8677a140eb fix typos in sighash.go 2023-10-20 15:23:55 -04:00
Oliver Gugger
a35a687a7f
Merge pull request #2043 from kcalvinalvin/2023-10-12-add-integration-test-for-prune
integration: add test to check prune status
2023-10-16 16:23:15 +00:00
Calvin Kim
520d45e3b1 fixup! integration: add test to check prune status 2023-10-16 16:34:49 +09:00
Calvin Kim
d3d0682dd3 integration: add test to check prune status
Adds a check to make sure that prune status on getblockchaininfo
returns true for pruned nodes.
2023-10-12 15:24:42 +09:00
Calvin Kim
1012f1e4ba wire: add NodeNetworkLimitedBlockThreshold const
NodeNetworkLimitedBlockThreshold is a constant representing how many
blocks from tip a node signaling NODE_NETWORK_LIMITED must serve.
2023-09-25 18:41:36 +09:00
Olaoluwa Osuntokun
80f5a0ffdf
Merge pull request #2028 from yyforyongyu/catch-shutdown
rpcclient: catch shutdown signal when sending RPC requests
2023-09-05 10:09:01 -07:00
yyforyongyu
3a8b851aaf
rpcclient: catch shutdown signal when sending requests 2023-09-04 12:04:32 +08:00
yyforyongyu
d62d537fb5
rpcclient: remove redundant params used in handleSendPostMessage 2023-09-04 12:04:32 +08:00
yyforyongyu
d4f519f5dc
gomod: clean go mod files
Resulted from running `go mod tify`.
2023-09-04 12:04:16 +08:00
Olaoluwa Osuntokun
f12a0b3b56
Merge pull request #2025 from Beerosagos/hash-unmarshal
chainhash: add support to legacy-marshaled hashes
2023-09-01 13:52:39 -07:00
yyforyongyu
87552ddca7
gitignore: ignore vim files 2023-08-30 18:45:58 +08:00