Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Aug 27, 2021

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.

@laanwj
Copy link
Member

laanwj commented Aug 27, 2021

Concept ACK.
But I would personally prefer to overload one argument for the different activation heights, instead of adding a new argument for every single thing, for now and in the future. Either e,g,:

-testactivationheights=<bip34height>,<dersigheight>,<cltvheight>,<csvheight>

(this will work fine for the tests which "know" about everything anyway, even if new things get added)
or, alternatively

-testactivationheight=bip34,<height>
-testactivationheight=dersig,<height>
…

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 28, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #22976 (scripted-diff: Rename overloaded int GetArg to GetIntArg by ryanofsky)
  • #22711 (test: check for specific block reject reasons in p2p_segwit.py by theStack)
  • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
  • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
  • #10102 ([experimental] Multiprocess bitcoin by ryanofsky)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@theStack
Copy link
Contributor

Concept ACK

1 similar comment
@kristapsk
Copy link
Contributor

Concept ACK

@maflcko
Copy link
Member Author

maflcko commented Aug 30, 2021

-testactivationheight=bip34,

Done

@practicalswift
Copy link
Contributor

Strong Concept ACK

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

LGTM overall, left two small improvement suggestions.

@maflcko maflcko force-pushed the 2108-regtestSoft branch 2 times, most recently from fa89e40 to fa32518 Compare September 6, 2021 09:19
Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

ACK fa32518 🍴

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

re-ACK fa5b518

Checked via git range-diff fa32518a...fa5b518f that changes since my last ACK are only rebase-related.

@maflcko
Copy link
Member Author

maflcko commented Sep 10, 2021

Force pushed (trivial, without rebase)

MarcoFalke added 4 commits September 16, 2021 18:52
'bip65': {'type': 'buried', 'active': True, 'height': CLTV_HEIGHT},
'csv': {'type': 'buried', 'active': False, 'height': 432},
'segwit': {'type': 'buried', 'active': True, 'height': 0},
'bip34': {'type': 'buried', 'active': True, 'height': 1},
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't having slightly different activation heights here (even it its 1,2,3,4,5) make for a better test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can do on the next force push or another pull request (whichever happens earlier)

@laanwj
Copy link
Member

laanwj commented Sep 20, 2021

Code review ACK fa4db86

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

re-ACK fa4db86

@maflcko maflcko merged commit 8e9801b into bitcoin:master Sep 24, 2021
@maflcko maflcko deleted the 2108-regtestSoft branch September 24, 2021 12:07
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 24, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 24, 2021
maflcko pushed a commit to bitcoin-core/gui that referenced this pull request Sep 25, 2021
… rpc_blockchain

fa4ca8d test: Add -testactivationheight tests to rpc_blockchain (MarcoFalke)

Pull request description:

  Suggested: bitcoin/bitcoin#22818 (comment)

ACKs for top commit:
  laanwj:
    Code review ACK fa4ca8d
  theStack:
    Concept and code-review ACK fa4ca8d

Tree-SHA512: 41304db1a15c0c705a9cc2808c9f1d7831a321a8a7948a28ec5d3ee1ed3da6a0ce67cd50c99a33aaed86830c59608eb6ffadbeaba67d95245c490f9b6c277912
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 25, 2021
…ckchain

fa4ca8d test: Add -testactivationheight tests to rpc_blockchain (MarcoFalke)

Pull request description:

  Suggested: bitcoin#22818 (comment)

ACKs for top commit:
  laanwj:
    Code review ACK fa4ca8d
  theStack:
    Concept and code-review ACK fa4ca8d

Tree-SHA512: 41304db1a15c0c705a9cc2808c9f1d7831a321a8a7948a28ec5d3ee1ed3da6a0ce67cd50c99a33aaed86830c59608eb6ffadbeaba67d95245c490f9b6c277912
Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

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

The change of consensus.SegwitHeight from 0 to 1 has the effect that if I create a regtest enviroment with a current master (or 23.0), and then try to load the chain with an older version (e.g. 22.0), I get an InitError
Witness data for blocks after height 0 requires validation. Please restart with -reindex
because BLOCK_OPT_WITNESS is no longer set for the Genesis block and NeedsRedownload() in validation returns true.
That might be a bit annoying for some tests - @MarcoFalke @theStack what do you think?

@maflcko
Copy link
Member Author

maflcko commented Mar 10, 2022

No objection setting it back to 0. An alternative might be to just use -reindex with 22.x, which will make the datadir compatible for 22.x and 23.x at the same time.

mzumsande added a commit to mzumsande/bitcoin that referenced this pull request Mar 10, 2022
This was changed in bitcoin#22818 from 0 to 1. Since it changes
BLOCK_OPT_WIT of the genesis block, older versions of bitcoin
core would not read regtest directories created with newer versions
without a reindex.
@mzumsande
Copy link
Contributor

see #24527

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Mar 13, 2022
5ce3057 test: set segwit height back to 0 on regtest (Martin Zumsande)

Pull request description:

  The change of `consensus.SegwitHeight` from 0 to 1 for regtest in bitcoin#22818 had the effect that if I create a regtest enviroment with  current master (or 23.x), and then try to load this chain with an older version (22.x), I get an InitError
  `Witness data for blocks after height 0 requires validation. Please restart with -reindex`
  and have to reindex because `BLOCK_OPT_WITNESS` is no longer set for the Genesis block and `NeedsRedownload()` in validation returns `true` with an older version.
  That might be a bit annoying for tests that use a shared regtest dir with different versions.

  If people think this is enough of an issue to be worth fixing, I think it should also make it into 23.x

ACKs for top commit:
  theStack:
    Concept and code-review ACK 5ce3057

Tree-SHA512: b0e89ff7fc953bc0ae929d2da44cde7149321d987fb4763934f6c9635d00d807129a50b459cc5e69e86bb1819e4b063b969486e8016a1cb8db8f905fa315653d
jonatack pushed a commit to jonatack/bitcoin that referenced this pull request Mar 13, 2022
This was changed in bitcoin#22818 from 0 to 1. Since it changes
BLOCK_OPT_WIT of the genesis block, older versions of bitcoin
core would not read regtest directories created with newer versions
without a reindex.

Github-Pull: bitcoin#24527
Rebased-From: 5ce3057
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 13, 2022
5ce3057 test: set segwit height back to 0 on regtest (Martin Zumsande)

Pull request description:

  The change of `consensus.SegwitHeight` from 0 to 1 for regtest in bitcoin#22818 had the effect that if I create a regtest enviroment with  current master (or 23.x), and then try to load this chain with an older version (22.x), I get an InitError
  `Witness data for blocks after height 0 requires validation. Please restart with -reindex`
  and have to reindex because `BLOCK_OPT_WITNESS` is no longer set for the Genesis block and `NeedsRedownload()` in validation returns `true` with an older version.
  That might be a bit annoying for tests that use a shared regtest dir with different versions.

  If people think this is enough of an issue to be worth fixing, I think it should also make it into 23.x

ACKs for top commit:
  theStack:
    Concept and code-review ACK 5ce3057

Tree-SHA512: b0e89ff7fc953bc0ae929d2da44cde7149321d987fb4763934f6c9635d00d807129a50b459cc5e69e86bb1819e4b063b969486e8016a1cb8db8f905fa315653d
hebasto pushed a commit to hebasto/bitcoin that referenced this pull request Mar 31, 2022
This was changed in bitcoin#22818 from 0 to 1. Since it changes
BLOCK_OPT_WIT of the genesis block, older versions of bitcoin
core would not read regtest directories created with newer versions
without a reindex.

Github-Pull: bitcoin#24527
Rebased-From: 5ce3057
delta1 added a commit to delta1/elements that referenced this pull request Apr 23, 2023
delta1 added a commit to delta1/elements that referenced this pull request Apr 24, 2023
delta1 added a commit to delta1/elements that referenced this pull request Apr 24, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants