Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Aug 14, 2024

Issue being fixed or feature implemented

What was done?

Backport bitcoin#22818 which helped to activate all forks from block-1 at regtest.
Activate next dash's softforks at block 1:

  • DIP-0001 (blocksize 2mb)
  • DIP-0020 (opcodes)
  • DIP-0008 (chainlocks)
  • BRR (block reward reallocation)

How Has This Been Tested?

Breaking Changes

All changes are relevant to RegTest only

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

@knst knst added this to the 21.2 milestone Aug 14, 2024
@knst knst marked this pull request as draft August 14, 2024 06:59
@knst knst force-pushed the forks-speedup-p2 branch from ddaa779 to 84b6eea Compare August 14, 2024 09:30
merge-script and others added 2 commits August 14, 2024 16:58
…, unless overridden

fa4db86 test: Activate all regtest softforks at height 1, unless overridden (MarcoFalke)
faad1e5 Introduce -testactivationheight=name@height setting (MarcoFalke)
fadb2ef test: Add extra_args argument to TestChain100Setup constructor (MarcoFalke)
faa4698 test: Remove version argument from build_next_block in p2p_segwit test (MarcoFalke)
fa086ef test: Remove unused ~TestChain100Setup (MarcoFalke)

Pull request description:

  All softforks that are active at the tip of mainnet, should also be active from genesis in regtest. Otherwise their rules might not be enforced in user testing, thus making their testing less useful.

  To still allow tests to check pre-softfork rules, a runtime argument can change the activation height.

ACKs for top commit:
  laanwj:
    Code review ACK fa4db86
  theStack:
    re-ACK fa4db86

Tree-SHA512: 6397d46ff56ebc48c007a4cda633904d6ac085bc76b4ecf83097c546c7eec93ac0c44b88083b2611b9091c8d1fb8ee1e314065de078ef15e922c015de7ade8bf
@knst knst force-pushed the forks-speedup-p2 branch from 84b6eea to d9fef89 Compare August 14, 2024 10:04
@knst knst marked this pull request as ready for review August 15, 2024 03:28
@knst knst force-pushed the forks-speedup-p2 branch from d9fef89 to c01226e Compare August 15, 2024 04:27
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls see fde8ed1 and 55aa14e

@knst
Copy link
Collaborator Author

knst commented Aug 15, 2024

@UdjinM6 , I would disagree with both patches.

55aa14e:

There are both values bad-txns-oversize and tx-size used in our (and bitcoin's) implementation.

bad-txns-oversize: https://github.com/dashpay/dash/blob/develop/src/consensus/tx_check.cpp#L34
tx-size: https://github.com/dashpay/dash/blob/develop/src/policy/policy.cpp#L73

I'd say inside ContextualCheckTransaction just has been used a wrong id for failure - let's correct it better rather than wrap it in numerous of exceptions to make it disappear in just particular 2 tests


fde8ed1

That remove existing command line argument, I'd like to keep it for v21.2 just in case if anyone uses it.
I am going to create a new PR with removing bip147, dip3param, dip8param, etc when v22 will be branched-out.

@knst knst requested a review from UdjinM6 August 15, 2024 08:26
@UdjinM6
Copy link

UdjinM6 commented Aug 15, 2024

@UdjinM6 , I would disagree with both patches.

55aa14e:

There are both values bad-txns-oversize and tx-size used in our (and bitcoin's) implementation.

bad-txns-oversize: https://github.com/dashpay/dash/blob/develop/src/consensus/tx_check.cpp#L34 tx-size: https://github.com/dashpay/dash/blob/develop/src/policy/policy.cpp#L73

I'd say inside ContextualCheckTransaction just has been used a wrong id for failure - let's correct it better rather than wrap it in numerous of exceptions to make it disappear in just particular 2 tests

bad-txns-oversize is a consensus level error and tx-size is a mempool policy error, the one you are changing is consensus level one, it was picked intentionally that way.

fde8ed1

That remove existing command line argument, I'd like to keep it for v21.2 just in case if anyone uses it. I am going to create a new PR with removing bip147, dip3param, dip8param, etc when v22 will be branched-out.

Sounds good

…tiveAtTip

The flag fDIP0001ActiveAtTip shows a status of activation of DIP0001

This flag is used currently only in net.cpp for setup block buffer size.
Assume the bigger by default so far as DIP0001 is activated years ago
@knst knst force-pushed the forks-speedup-p2 branch from c01226e to f4ba2bb Compare August 16, 2024 04:14
@knst
Copy link
Collaborator Author

knst commented Aug 16, 2024

bad-txns-oversize is a consensus level error and tx-size is a mempool policy error, the one you are changing is consensus level one, it was picked intentionally that way.

Indeed, it makes sense.

Please check my force-push: I applied your changes and also dropped a global flag fDIP0001ActiveAtTip which is no need anymore

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

side note: thinking more about -bip147height and -dip8params.. they are regtest-only and replacing them with corresponding -testactivationheight cmd-line options is trivial. Dropping them would also prevent confusion when new and old options are used together accidentally. But I won't insist :)

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK f4ba2bb

@PastaPastaPasta PastaPastaPasta merged commit f1e8452 into dashpay:develop Aug 20, 2024
@knst knst deleted the forks-speedup-p2 branch August 21, 2024 11:47
@UdjinM6 UdjinM6 modified the milestones: 21.2, 22 Oct 29, 2024
PastaPastaPasta added a commit that referenced this pull request Dec 10, 2024
…y first block - 7/n

906c2d7 refactor: add annotation gsl::not_null for ConstructCreditPool (Konstantin Akimov)
f1905ca fix: intermittent missing of PoSe ban in feature_llmq_simplepose.py (Konstantin Akimov)
cf84dff fix: bump time for all nodes during mine_quorum in feature_llmq_rotation.py test (Konstantin Akimov)
efd4701 fix: intermittent error for feature_llmq_simplepose due to rotating quorums (Konstantin Akimov)
2bafadf feat: put DIP0024 activation to block 1 on RegTest (Konstantin Akimov)
632c4c4 feat: re-bury DIP0024 with new height when quorums actually appeared (Konstantin Akimov)
343c74b fix: intermittent error in feature_index_prune due to DKG influence (Konstantin Akimov)
de821b9 refactor: remove command line argument -bip147height, -dip8params (Konstantin Akimov)
d8ce0a7 docs: updated comment for DIP0003 activation on RegTest (Konstantin Akimov)
4dafec8 fix: add check that DIP0003 activated before retrieving CbTx for CreditPool (Konstantin Akimov)
26e9813 fix: assertion in Credit Pool validation during connecting blocks (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  This PR is 7th in the achieving ultimate goal to activate old forks from block 1.
  It helps to run unit and functional tests faster; it helps for platform's dev-environment to start faster.

  ## What was done?
  Prior work: #6187, #6189, #6214, #6225, #6269, #6275

  This PR:
   - simplify DIP0024 activation and activate it from block 1 at RegTest
   - removes command lines arguments: -bip147height, -dip8params
   - fixed intermittent errors in feature_index_prune.py and feature_llmq_simplepose.py
   - fix assertion crash on Regtest if using strange combination of -testactivationheight and -dip3params

  ## How Has This Been Tested?
  Run unit, functional tests.

  ## Breaking Changes
  [regtest only] -dip8params, -bip147height are removed.

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 906c2d7
  PastaPastaPasta:
    utACK 906c2d7

Tree-SHA512: fab8a9bc03bb7f220c19dd952a03f8fec0b6ef1362d7308eb77c90e0ba814a241bb2bf36beccf78bb285ede1b6d85ec52fa19b3729ac9b643b420d13fbb63b47
PastaPastaPasta added a commit that referenced this pull request Oct 29, 2025
…]` help text, drop extra `generate`s from test, resolve macOS GID issue

39e847c fix: do not create group if GID is already taken (Kittywhiskers Van Gogh)
36db83a fix: annotate `getblockchaininfo[softforks]` as `OBJ_DYN` (Kittywhiskers Van Gogh)
e4ace44 fix: repair IP extraction in `makeseeds.py`, read from `core_p2p` arr (Kittywhiskers Van Gogh)
9ef8c53 test: drop extra `generate`s from `wallet_signrawtransactionwithwallet` (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * The help text for `getblockchaininfo['softforks']` was introduced in [bitcoin#16060](bitcoin#16060) (backported in [dash#5255](#5255)) _but_ the `RPCResult` help text was introduced in [bitcoin#17809](bitcoin#17809), backported _before_ [bitcoin#16060](bitcoin#16060). This resulted in the help text for `softforks` deviating from upstream without the output to match (which is aligned with upstream).

    This has since been resolved as the output structure hasn't changed, only the help text.

  * [bitcoin#22818](bitcoin#22818) (backported in [dash#6214](#6214)) activated many softforks at height 1, which rendered the block generation calls in `wallet_signrawtransactionwithwallet.py` ([source](https://github.com/dashpay/dash/blob/3e6e8f57c45fb24107816a10854ed8f349c4aa20/test/functional/wallet_signrawtransactionwithwallet.py#L132-L133)) no longer necessary, additionally [bitcoin#22550](bitcoin#22550) (backported in [dash#6189](#6189)) added assertions to validate CSV/CLTV activation that were not included in the backport.
    This has since been resolved, replacing the `generate` calls with assertions.

    * The locktime height was dropped from `1000` to `100` (matching with upstream, [source](https://github.com/bitcoin/bitcoin/blob/24.x/test/functional/wallet_signrawtransactionwithwallet.py#L219)) as we are no longer generating enough blocks to reach that height anymore.

  * `makeseeds.py` is currently mangled because [dash#6666](#6666) updated the script to look for the `core_p2p` purpose even though purpose code support was spun-off into [dash#6674](#6674). This meant, in between [dash#6666](#6666) and [dash#6674](#6674 merger, `makeseeds.py` was broken.

    This necessitated a fix that was introduced as e714c06 ([dash#6858](#6858)) but meant that after  [dash#6674](#6674), `makeseeds.py` is broken again. This has been resolved as part of this PR.

  * macOS users who want to utilise the `develop` container ([source](https://github.com/dashpay/dash/blob/b82450aa7dce2307b13e6fe282f7c4f84b48cbbf/contrib/containers/develop/Dockerfile)) need to set the `USER_ID` and `GROUP_ID` `args` to avoid permissions issues. This creates a slight problem as the GID for `staff` is 20 on macOS but Linux uses GID 20 for `dialout`, so creating a group with GID 20 will _fail_.

    As we only care about the GID, it is safe to skip the group creation step and assign the user to the group anyways as we do it by GID and _not_ name (the user will be presented as a member of the `dialout` group). This should resolve issues for macOS users trying to build the `develop` container.

  ## Breaking Changes

  None expected.

  ## Checklist

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK 39e847c
  knst:
    utACK 39e847c
  UdjinM6:
    utACK 39e847c

Tree-SHA512: 0ecb8bb930d54d4b9024a6e94a2fe3b49c7334666e5f67d38920ac58f54332fb8b4f62bd883bd949969d60b6b5183c7a20a3593f24c2e6bbbb0de143b3de8fe1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants