Commit Graph

13024 Commits

Author SHA1 Message Date
tomFlowee 8e5809ddee Re-enable non-spv mode.
As we now follow the full ruleset of Bitcoin Cash again, we enable
normal validation rules for a full node again.
2026.05.0
2026-05-15 10:53:24 +02:00
tomFlowee 39f8da3b3c Update month 2026-05-15 10:52:31 +02:00
tomFlowee 0572486278 Move flag detection to before usage
As flags (like an upgrade being active) have been added in the codepath of
checks2 (contextualChecks), we need to make sure that we update the flags
to the current block just before we do that. So move this one up.
2026-05-15 09:19:57 +02:00
tomFlowee 519c76b149 Remove unused code 2026-05-15 09:19:57 +02:00
tomFlowee 6838d03e57 Fix op-mul activation 2026-05-15 00:03:09 +02:00
tomFlowee 7bb20aa818 Rename method to fix typo 2026-05-14 23:31:17 +02:00
tomFlowee cc4d9fb1f0 Rethrow exception of appropriate type 2026-05-14 23:31:17 +02:00
John Galt 12d94533dd init: recognize chipnet from the command line 2026-05-14 23:31:17 +02:00
John Galt aadc7c0f5a script: include token prefix in forkid signing preimage 2026-05-14 21:28:31 +02:00
John Galt 3a7b716706 tests: cover post-Layla standardness and token commitments 2026-05-14 20:19:07 +02:00
John Galt 4b6f00a514 tests: cover May 2025 and 2026 VM rules 2026-05-14 20:19:07 +02:00
John Galt 99c81869ed script: let malformed multisig fall through to P2S 2026-05-14 20:19:07 +02:00
John Galt db15db1354 core: accept legacy opcode aliases in script parser 2026-05-14 20:19:07 +02:00
John Galt 4876337a55 utils: allow post-Layla token commitments 2026-05-14 20:19:07 +02:00
John Galt 466d02a0e4 validation: apply May 2026 token commitment limit 2026-05-14 20:19:07 +02:00
John Galt 955b5642a7 policy: make post-Layla P2S standard 2026-05-14 20:19:07 +02:00
John Galt eb07e94a3c script: implement May 2026 loops 2026-05-14 20:19:07 +02:00
John Galt f473edf652 script: implement May 2026 functions 2026-05-14 20:19:07 +02:00
John Galt 6b288766ad script: split eval context for May 2026 frames 2026-05-14 20:19:07 +02:00
John Galt 9cd8f7908f script: implement May 2026 bitwise shifts 2026-05-14 20:19:07 +02:00
John Galt 867788038f script: name May 2026 opcode aliases 2026-05-14 20:19:07 +02:00
John Galt 1d463c68c8 script: charge signature hash iterations 2026-05-14 20:19:07 +02:00
John Galt 1751c3f14b script: enforce May 2025 VM accounting limits 2026-05-14 20:19:07 +02:00
John Galt 4f77768864 validation: activate May 2025 and 2026 script flags 2026-05-14 20:19:07 +02:00
John Galt 2699ea03f9 script: add May 2025 and 2026 VM limit constants 2026-05-14 20:19:07 +02:00
tomFlowee a5505f66c7 Avoid confusion with bigint1 and bigint2 2026-05-14 15:30:23 +02:00
tomFlowee 0d410b17d8 Change tx validation to default to on. 2026-05-14 15:21:44 +02:00
tomFlowee aa97cb2f3c Make logic cleaner. 2026-05-14 15:21:25 +02:00
tomFlowee d3948cb5e9 Avoid expensive conversion. 2026-05-14 13:34:48 +02:00
tomFlowee ab318abac6 Remove unneeded checks
The checking usage prior to the activation makes no sense after we
already had activation.
2026-05-14 13:33:13 +02:00
tomFlowee 008eb35f95 Make compile faster
The IDE include checker got to the point where it is actually useful and
this removes a lot of unneeded includes.
Naturally, especially for headers like util.h, this may mean we need to
re-add includes in consuming cpp files that bloats the diff a bit.
2026-05-14 13:27:17 +02:00
tomFlowee 3bf765e2a3 Make sure we have access to Tx
Similar to the previous commit; make sure that the ValidationContext has
access to the new Tx format so new code can use it directly.

In practically all cases (outside of the unit tests) callers already had
a Tx instance. Making it just a matter of sending it with.

Notice that the Tx object is immutable and implicitly shared which makes
it cheaper to pass around.
2026-05-14 13:27:17 +02:00
tomFlowee 5451d1431b Make sure we have access to Tx
The MutableTransaction is only for creation,
the CTransaction is basically only there for backwards compatibility and
is kind of half deprecated.
The Tx class is to be used for all new code in validation.

The reason for this is because the CTransaction and friends are terribly
expensive to create and they have horrible effects on multi-threaded
validation.

So, to help this concept along we now pass both the old and the new tx
to a method that has not been ported to use the new yet. This at
least makes available the new Tx instance so when new code is written
it is easier to do the right thing (tm).
2026-05-14 13:27:17 +02:00
tomFlowee cd26dce4ed Cleanups
This rewrites one method to just use the iterator how it was meant
and it ends up saving a lot of CPU.
2026-05-14 13:27:17 +02:00
tomFlowee f0e026d1c7 Be more tolerant in the concept of 'next' 2026-05-14 10:53:37 +02:00
John Galt 455db5d126 tests: expand CashTokens coverage 2026-05-14 10:28:44 +02:00
John Galt ad730f4d34 script: add CashToken introspection opcodes 2026-05-14 10:28:44 +02:00
John Galt 078ba3a49c script: hash token prefixes in SIGHASH_UTXOS 2026-05-14 10:28:44 +02:00
John Galt a7f416ed68 validation: account CashToken NFTs 2026-05-14 10:28:44 +02:00
John Galt bdda379cc6 validation: account CashToken FT amounts 2026-05-14 10:28:44 +02:00
John Galt 056ceef245 validation: check CashToken input structure 2026-05-14 10:28:44 +02:00
John Galt 2af0af3641 validation: check CashToken output structure 2026-05-14 10:28:44 +02:00
John Galt 6f4c85570a primitives: fix indexed output lookup 2026-05-14 10:28:44 +02:00
tomFlowee b10f6ea2fb Merge UnspentOutputData classes
Two classes that were becoming very similar now are one.
2026-05-13 17:55:43 +02:00
tomFlowee 6996e56330 Cleanup includes 2026-05-13 17:55:03 +02:00
tomFlowee ced4f98beb Add token support to the Tx object
We add a Token class to Tx, which adds an easy to use API when compared
to the plain iterator. The main point of the API chosen is to make sure
we don't do unneeded parsing or copying for tokens unless needed.

Additionally refactor the ValidationPrivate::UnspentOutput class to
inherit from the Tx::Output class in order to avoid lots of duplicated
logic on handling the data.
2026-05-13 17:20:32 +02:00
tomFlowee d27026027f Cleanup includes. 2026-05-13 16:35:51 +02:00
tomFlowee 4ea0a66e9a Remove dead dns feed. 2026-05-12 17:12:22 +02:00
tomFlowee b8840e159c Cleanup test
This turns the code into readable data-driven test cases.
2026-05-12 16:23:25 +02:00
tomFlowee 8cfdc3c79c Cleanup test
Unit tests should keep using simple and readable code. Verbose is better
than hard to follow.
2026-05-12 16:07:59 +02:00