Commit Graph

37328 Commits

Author SHA1 Message Date
Luke Dashjr
ada4eca6ec If -spkreuse=0, ensure transactions in mempool always have unique scriptPubKeys
Exceptions:
- Multiple inputs in the same transaction are allowed to spend against the same scriptPubKey
- The same scriptPubKey may be used in the mempool as both first an output, and then spent in a later transaction's input
2023-10-19 16:53:27 +00:00
Luke Dashjr
437badb77d Merge branch 'sendraw_force-25+knots' into unique_spk_mempool-25+knots 2023-10-19 16:53:21 +00:00
Luke Dashjr
0eb97b111e Merge branch 'whitelist_outgoing-mini-25+knots' into unique_spk_mempool-25+knots 2023-10-19 16:53:17 +00:00
Luke Dashjr
74144bcf53 Adjust -whitelist to default to both incoming and outgoing connections 2023-10-19 16:43:54 +00:00
Luke Dashjr
f5e5abe37f Diff-minimisation 2023-10-19 16:43:54 +00:00
brunoerg
622ae61e0b test: add coverage for whitelisting outgoing connections
Github-Pull: #27114
Rebased-From: 51618c9c8a87f3a1cd7fcb9b4f7d4da96f182138
2023-10-19 16:43:54 +00:00
Luke Dashjr
7ca26240f1 Accept "in" and "out" flags to -whitelist to allow whitelisting outgoing connections
Github-Pull: #27114
Rebased-From: 22e64e8ab55310fa613946eaf3861b7211a493e1
2023-10-19 14:57:44 +00:00
Luke Dashjr
c1bd439b38 net_processing: Move extra service flag into InitializeNode
Github-Pull: #27114
Rebased-From: a3cdcf17f819f90f39df421de92b4e2fb9a966c5
2023-10-19 02:36:39 +00:00
Luke Dashjr
e11c4d433e net: Move NetPermissionFlags::Implicit verification to InitializePermissionFlag
Github-Pull: #27114
Rebased-From: 54b22e726273d9bf9699c823e24e61bbb94014f0
2023-10-19 02:28:57 +00:00
Luke Dashjr
9351637cba Support ignoring package-fee-too-low rejection 2023-09-29 02:10:30 +00:00
Luke Dashjr
553fcbebed RPC/mempool: Accept ignore_rejects in sendrawtransaction's 2nd & 3rd params for backward compatibility with Knots <25 2023-09-29 02:10:30 +00:00
Luke Dashjr
cbbf96cc43 Bugfix: policy/rbf: Recognise "too many potential replacements" string in ignore_rejects 2023-09-29 02:10:30 +00:00
Luke Dashjr
2851e0f83e QA: rpc_rawtransaction: Test ignore_rejects 2023-09-29 02:10:30 +00:00
Luke Dashjr
8c507bf766 RPC: Add support for ignore_rejects in testmempoolaccept 2023-09-29 02:10:30 +00:00
Luke Dashjr
7678ea0e74 Implement ignore_rejects for transaction packages 2023-09-29 02:10:30 +00:00
Luke Dashjr
890d993743 node: Accept "absurdly-high-fee" and "max-fee-exceeded" reject reasons to ignore max_tx_fee 2023-09-29 02:10:30 +00:00
Luke Dashjr
b4f6e44d2c RPC: sendrawtransaction: Replace boolean allowhighfees with an Array of rejections to ignore (in a backward compatible manner) 2023-09-29 02:10:30 +00:00
Luke Dashjr
99f70a4af3 node: Extend BroadcastTransaction to accept ignore_rejects 2023-09-29 02:10:30 +00:00
Luke Dashjr
d0f4c6a1e3 Make bad-witness-nonstandard rejection more specific, and support overriding some 2023-09-29 02:10:30 +00:00
Luke Dashjr
af456a1196 Ability to ignore AreInputsStandard rejection reasons 2023-09-29 02:10:30 +00:00
Luke Dashjr
d5c1bfa989 Ability to ignore IsStandardTx rejection reasons 2023-09-29 02:10:30 +00:00
Luke Dashjr
635a6275a7 AcceptToMemoryPool: Support overriding many top-level rejections 2023-09-29 02:10:30 +00:00
Luke Dashjr
5b7a44112a AcceptToMemoryPool: Minimally change bool bypass_limits to unordered_set<string> ignore_rejects 2023-09-29 02:10:29 +00:00
Luke Dashjr
24e8860e2f AreInputsStandard: Return specific reject reasons 2023-09-29 02:10:29 +00:00
Luke Dashjr
9f786cbe04 Merge branch 'fix_bytespersigop_checks-25' into sendraw_force-25+knots 2023-09-29 02:10:22 +00:00
Luke Dashjr
1bfbc750dd Diff-minimise 2023-09-22 20:40:16 +00:00
Luke Dashjr
c10f1326aa Bugfix: GUI/PSBTOperationsDialog: Pass feerate limit as a CFeeRate instead of assuming 1kvB
Github-Pull: #28345
Rebased-From: 6cd57e509c2f72ce4cd3abd71f18527c0a839695
2023-09-22 20:40:16 +00:00
Luke Dashjr
b152fb564a Bugfix: RPC/Mempool: Pass CFeeRate to BroadcastTransaction to correctly account for non-weight vsize
Github-Pull: #28345
Rebased-From: ae232c72384c4b2b0cacb85eaeedd79fa78a9f73
2023-09-22 20:40:16 +00:00
Luke Dashjr
14c2af07ae node: Refactor BroadcastTransaction to accept a CFeeRate maximum
Github-Pull: #28345
Rebased-From: 46e993c57e212725418aa3a6d8495a454b56b344
2023-09-22 20:40:11 +00:00
Luke Dashjr
9cb2925be9 Merge branch 'fix_pkg_eval_sigops_pr28471-25+knots' into fix_bytespersigop_checks-25 2023-09-22 18:06:02 +00:00
Greg Sanders
c6dfebd149 Add functional test to catch too large vsize packages
Github-Pull: #28471
Rebased-From: eb8f58f5e4
2023-09-22 18:05:33 +00:00
Greg Sanders
8f0bc19767 Handle over-sized (in virtual bytes) packages with no in-mempool ancestors
Github-Pull: #28471
Rebased-From: 1a579f9d01
2023-09-22 18:05:33 +00:00
Luke Dashjr
1d8b2d966c Bugfix: Pass correct virtual size to CheckPackageLimits
Github-Pull: #28471
Rebased-From: bc013fe8e3
2023-09-22 18:05:33 +00:00
Greg Sanders
189f0bff22 Replace MAX_PACKAGE_SIZE with MAX_PACKAGE_WEIGHT to avoid vbyte confusion
While allowing submitted packages to be slightly larger than what
may be allowed in the mempool to allow simpler reasoning
about contextual-less checks vs chain limits.

Github-Pull: #28471
Rebased-From: 533660c58a
2023-09-22 18:05:33 +00:00
Luke Dashjr
9d58bf6a27 Merge branch 'qa_tfw_generate_keypair-21' into fix_pkg_eval_sigops_pr28471-25+knots 2023-09-22 17:53:46 +00:00
Sebastian Falbesoner
d2548cd38a test: introduce generate_keypair helper with WIF support
In functional tests it is a quite common scenario to generate fresh
elliptic curve keypairs, which is currently a bit cumbersome as it
involves multiple steps, e.g.:

    privkey = ECKey()
    privkey.generate()
    privkey_wif = bytes_to_wif(privkey.get_bytes())
    pubkey = privkey.get_pubkey().get_bytes()

Simplify this by providing a new `generate_keypair` helper function that
returns the private key either as `ECKey` object or as WIF-string
(depending on the boolean `wif` parameter) and the public key as
byte-string; these formats are what we mostly need (currently we don't
use `ECPubKey` objects from generated keypairs anywhere).

With this, most of the affected code blocks following the pattern above
can be replaced by one-liners, e.g.:

    privkey, pubkey = generate_keypair(wif=True)

Github-Pull: #27733
Rebased-From: 1a572ce7d6 [partial]
2023-09-22 17:21:14 +00:00
Luke Dashjr
8009cc1263 Merge branch 'neutrino_whitelist-mini' into whitelist_outgoing-mini-25+knots 2023-08-28 17:26:08 +00:00
Luke Dashjr
fdf53a874d Diff-minimise 2023-08-24 19:07:26 +00:00
Luke Dashjr
21a7f5ad0c Refactor to avoid conflicts in new p2p permissions 2023-08-24 19:07:26 +00:00
Luke Dashjr
e529e00643 Include "blockfilters" in NetPermissions::ToStrings as appropriate 2023-08-24 19:07:26 +00:00
Luke Dashjr
76f055d909 net: Add blockfilters white{bind,list} permission flag 2023-08-24 19:07:26 +00:00
fanquake
bbbf89a9de
Merge bitcoin/bitcoin#27503: Bump to 25.99 and remove release note fragments
9c24826e7b doc: Remove 25.0 release note fragments (Andrew Chow)
088a93dce8 build: Bump to 25.99 (Andrew Chow)

Pull request description:

  Pre-25.x branch off version bump and release note fragments removal.

  The 25.0 draft release notes are in the dev wiki: https://github.com/bitcoin-core/bitcoin-devwiki/wiki/25.0-Release-Notes-Draft

ACKs for top commit:
  fanquake:
    ACK 9c24826e7b

Tree-SHA512: f7c7b04aa904e946bc672b5b07082a819b9d76ebccda0838bc27d0e6179cfb88b8f110500d5ea815f711580916bcfa0275774ec50a7298a4c66e645647111125
2023-04-20 20:51:20 +01:00
Andrew Chow
9c24826e7b doc: Remove 25.0 release note fragments 2023-04-20 14:01:06 -04:00
Andrew Chow
088a93dce8 build: Bump to 25.99 2023-04-20 13:58:00 -04:00
Andrew Chow
6db0a3002b
Merge bitcoin/bitcoin#27488: p2p: update hardcoded mainnet seeds for 25.x
31b1798d2c p2p: update hardcoded mainnet seeds for 25.x (Jon Atack)
04dd1d3926 contrib: make-seeds updates for 25.x (Jon Atack)
f5c8788628 p2p: update manual tor/i2p/cjdns mainnet seeds for 25.x (Jon Atack)

Pull request description:

  Update the hardcoded P2P network seeds for 25.x after updating the manual seeds and the generation script as necessary. Previous update was #25911.

  The manual seeds are selected for reachability, uptime and service bit 1 and/or curated trusted peers. We need more Tor and CJDNS seeds and some of the current Tor and I2P seeds are no longer reachable.

  Can be tested by following the steps in `contrib/seeds/README.md` and verifying the manual seeds by checking their presence and services in getnodeaddresses and/or connecting to them and checking their services with getpeerinfo and behavior with -netinfo.

  Tool output:

  ```
  $ python3 makeseeds.py -a asmap-filled.dat -s seeds_main.txt > nodes_main.txt

  Loading asmap database "asmap-filled.dat"…Done.
  Loading and parsing DNS seeds…Done.
    IPv4   IPv6  Onion Pass
    3972   1118      0 Initial
    3972   1118      0 Skip entries with invalid address
    3972   1118      0 After removing duplicates
    3946   1112      0 Enforce minimal number of blocks
    3946   1112      0 Require service bit 1
    2791    798      0 Require minimum uptime
    2757    788      0 Require a known and recent user agent
    2757    788      0 Filter out hosts with multiple bitcoin ports
     512    289      0 Look up ASNs and limit results per ASN and per net```

ACKs for top commit:
  achow101:
    ACK 31b1798d2c
  mzumsande:
    reACK 31b1798d2c

Tree-SHA512: 40cdd0ac74e3d26975ab688ee4af09bedcf15f6e02311757b27c91aafdc4da16cca2be90fee767207bb4ccd542ad19197e4d5e00011185018239de35da19c174
2023-04-20 13:42:01 -04:00
Jon Atack
31b1798d2c p2p: update hardcoded mainnet seeds for 25.x 2023-04-20 06:08:22 -07:00
Jon Atack
04dd1d3926 contrib: make-seeds updates for 25.x
and make the steps in /contrib/seeds/README.md easier to copy-paste
2023-04-20 06:08:22 -07:00
Jon Atack
f5c8788628 p2p: update manual tor/i2p/cjdns mainnet seeds for 25.x
selected for reachability, uptime, and service bit 1
2023-04-20 06:08:22 -07:00
fanquake
3133d935ce
Merge bitcoin/bitcoin#27482: kernel: chainparams updates for 25.x
a2bef805c1 kernel: update m_assumed_* chain params for 25.x (fanquake)
4128e01dba kernel: update chainTxData for 25.x (fanquake)
00b2b114b4 kernel: update nMinimumChainWork & defaultAssumeValid for 25.x (fanquake)
07fcc0a82c doc: update references to kernel/chainparams.cpp (fanquake)

Pull request description:

  Update chainparams pre `25.x` branch off.
  Co-Author in the commits as a PR (#27223) had previously been opened too-early to do the same.

  Note: Remember that some variance is expected in the `m_assumed_*` sizes.

ACKs for top commit:
  achow101:
    ACK a2bef805c1
  josibake:
    ACK a2bef805c1
  gruve-p:
    ACK a2bef805c1
  dergoegge:
    ACK a2bef805c1 on the new mainnet params

Tree-SHA512: 0b19c2ef15c6b15863d6a560a1053ee223057c7bfb617ffd3400b1734cee8f75bc6fd7f04d8f8e3f5af6220659a1987951a1b36945d6fe17d06972004fd62610
2023-04-20 11:23:13 +01:00
fanquake
b627924300
Merge bitcoin/bitcoin#26681: contrib: Bugfix for checking bad dns seeds without casting in makeseeds.py
3cc989da5c Fix checking bad dns seeds without casting (Yusuf Sahin HAMZA)

Pull request description:

  - Since seed lines comes with `str` type, comparing `good` column directly with **0** (`int` type) in the if statement was not working at all. This is fixed by casting `int` type to the values in the `good` column of seeds text file.
  - Lines that starts with comment in the seeds text file are now ignored.
  - If statement for checking bad seeds are moved to the top of the `parseline` function as if a seed is bad; there is no point of going forward from there.

  Since this bug-fix eliminates bad seeds over **550k** in the first place, in my case; particular job for parsing all seeds speed is up by **600%** and whole script's speed is up by **%30**.

  Note that **stats** in the terminal are not going to include bad seeds after this fix, which would be the same if this bug were never there before.

ACKs for top commit:
  achow101:
    ACK 3cc989da5c
  jonatack:
    ACK 3cc989da5c

Tree-SHA512: 13c82681de4d72de07293f0b7f09721ad8514a2ad99b0584d1c94fa5f2818821df2000944f9514d6a222a5dccc82856d16c8c05aa36d905cfa7d4610c629fd38
2023-04-20 10:04:47 +01:00