Commit Graph

180 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
c4ed92fb52
Merge pull request #2178 from ProofOfKeags/standardness-cleanup
Update standardness rules congruent to Bitcoin Core
2024-05-21 15:44:24 -07:00
Keagan McClelland
da2f3b1e5f mempool: make txn's below 65 non-witness bytes non-standard
This is to mitigate CVE-2017-12842. Along the way, also error when
deserializing transactions that have the witness marker flag set
but have no witnesses. This matches Bitcoin Core's behaviour initially
introduced here https://github.com/bitcoin/bitcoin/pull/14039. Allowing
such transactions is benign, but this makes sure that our parsing code
matches Core's exactly.
2024-05-21 12:30:17 -07:00
Oliver Gugger
a03259b26b
Merge pull request #1991 from ffranr/add-json-support
Convert `witnessToHex` into a method `ToHexStrings` on `TxWitness`
2024-03-26 13:03:46 -06:00
mattn
3cb9f602e8
fix typos (#2100) 2024-03-25 09:44:25 -04:00
ffranr
75fe7e4790
wire: make witnessToHex a TxWitness method called ToHexStrings 2024-03-25 12:56:12 +00:00
ffranr
2a225e9d36
wire: add method TxID to MsgTx
This commit adds a method to MsgTx called TxID. This method returns the
transaction ID (txid) of the subject transaction.
2024-03-25 12:21:41 +00:00
yyforyongyu
9cda0f7e95
wire: add Copy method to MsgBlock 2024-01-21 18:43:15 +08:00
Olaoluwa Osuntokun
16684f6cbc
Merge pull request #2073 from Roasbeef/wire-opts
wire: only borrow/return binaryFreeList buffers at the message level
2023-12-28 18:52:53 -08:00
Olaoluwa Osuntokun
b0e9636689
wire: consistently use defer for returning scratch buffers 2023-12-28 18:37:43 -08:00
Olaoluwa Osuntokun
c3c3545f9b
multi: update main package to chainhash/v1.1.0, use optimized dsha256
In this commit, we update the top-level btcd package to use the latest
version of btcutil and also the chainhash package. With this version
bump, we can now use the new optimized dsha256 routine where applicable.

With this commit, I've covered most of the areas we'll hash an entire
transaction/block/header, but we may want to optimize some other areas
further, in particular, the witness sighash calc.
2023-12-19 15:01:55 -08:00
Conner Fromknecht
8c4da83890
wire/msgblock+msgtx: user block-level script slab 2023-12-15 16:38:02 -08:00
Conner Fromknecht
d7396dc13d
wire/msgtx: use tx-level script slab 2023-12-15 16:37:57 -08:00
Conner Fromknecht
2e6eefcab1
wire/msgtx: remove unused read/writeOutPoint 2023-12-15 16:37:54 -08:00
Conner Fromknecht
4cc4f76c55
wire/msgtx: remove unused readScript 2023-12-15 16:37:51 -08:00
Conner Fromknecht
e0fa866890
wire/msgtx: remove unused readTxIn 2023-12-15 16:37:49 -08:00
Conner Fromknecht
f0184e58ba
wire/msgtx: remove unused writeTxIn 2023-12-15 16:37:46 -08:00
Conner Fromknecht
da89ed68ff
wire/msgtx: remove unused writeTxWitness 2023-12-15 16:37:44 -08:00
Conner Fromknecht
80ae5d342c
wire/msgpong: remove usage of read/writeElement 2023-12-15 16:37:41 -08:00
Conner Fromknecht
3698f2deab
wire/msgping: remove usage for read/writeElement 2023-12-15 16:37:39 -08:00
Conner Fromknecht
7207967135
wire/msgmerkleblock: optimize serialization by reusing small buffers 2023-12-15 16:37:36 -08:00
Conner Fromknecht
8bf07cc0bf
wire/netaddress: add optimiezed read/writeNetAddressBuf 2023-12-15 16:37:34 -08:00
Conner Fromknecht
dc4fbb04b3
wire/msgreject: optimize serialization by reusing small buffers 2023-12-15 16:37:31 -08:00
Conner Fromknecht
57daac345e
wire/common: add optimized writeVarStrBuf an readVarStrBuf 2023-12-15 16:37:29 -08:00
Conner Fromknecht
1cd5e02838
wire/invvect: remove unused readInvVect and writeInvVect 2023-12-15 16:37:26 -08:00
Conner Fromknecht
efcf964be2
wire/msgnotfound: optimize serialization by reusing small buffers 2023-12-15 16:37:24 -08:00
Conner Fromknecht
834febbb86
wire/msgcfilter: optimize serialization by reusing small buffers 2023-12-15 16:37:21 -08:00
Conner Fromknecht
ddeba60026
wiree/msggetcfilters: optimize serialization by reusing small buffers 2023-12-15 16:37:19 -08:00
Conner Fromknecht
d6594daa49
wire/msggetdata: optimize serialization by reusing small buffers 2023-12-15 16:37:16 -08:00
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