Skip to content

Conversation

@jnewbery
Copy link
Contributor

@jnewbery jnewbery commented Dec 2, 2017

Next step in #10603.

  • first four commits tidy up bip68-112-113-p2p.py
  • fifth commit removes usage of ComparisonTestFramework

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Reviewed following non-#11771 commits:

  • utACK 117f261bfcff1249be96d66f48350338e16580e3 [tests] Change bip68-112-113-p2p.py to use BitcoinTestFramework
  • utACK 7424bb122997da17276526d074e6380f2e112e3f [tests] Move utility functions in bip68-112-113-p2p.py out of class.
  • utACK e78b600be47bf34c4271b217b616a77f8957e531 [tests] Remove nested loops from bip68-112-113-p2p.py
  • utACK 44db6e78cf6acefe07ff9f5edb5f9995c7b45d7a [tests] improve logging in bip68-112-113-p2p.py
  • utACK 9c513676921f93ff3f3886e8c6072fd4c3314249 [tests] fix flake8 nits in bip68-112-113-p2p.py

Copy link
Contributor

Choose a reason for hiding this comment

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

In commit "Remove nested loops from bip68-112-113-p2p.py"

Should be able to avoid a lookup with [tx['tx'] for tx in txs.values()]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's better. Fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

In commit "Remove nested loops from bip68-112-113-p2p.py"

It seems better to continue returning a list than a dictionary. A dictionary is just slower and introduces nondeterminism in the test for no reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - returning a list is much better. Changed. Thanks

@jnewbery jnewbery force-pushed the refactor_bip68-112-113-p2p branch from 117f261 to 6bb4850 Compare February 14, 2018 03:31
@jnewbery
Copy link
Contributor Author

jnewbery commented Feb 14, 2018

Rebased now that #11771 has been merged.

edit: Just realised that I have't addressed Russ's comment here: #11817 (comment). Will do that later

@jnewbery jnewbery force-pushed the refactor_bip68-112-113-p2p branch from 6bb4850 to 96b02a0 Compare February 14, 2018 21:41
@jnewbery
Copy link
Contributor Author

ok, properly rebased and Russ's comment addressed.

Copy link
Contributor

Choose a reason for hiding this comment

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

To go along with @ryanofsky earlier comments in related PRs. This can be simplified to int(hash,16)

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Can be int(hash,16)

@conscott
Copy link
Contributor

Added small nits, but ACK.

@laanwj
Copy link
Member

laanwj commented Feb 16, 2018

utACK 96b02a0f62a64819c0048357b9e8b9da91af195f

@laanwj laanwj requested a review from maflcko February 16, 2018 16:55
@jnewbery jnewbery changed the title [tests] Change bip68-112-113-p2p to use BitcoinTestFramework [tests] Change feature_csv_activation.py to use BitcoinTestFramework Feb 16, 2018
@jnewbery
Copy link
Contributor Author

@conscott thanks for the review. I agree that int(hash, 16) is better, but I'll leave that change out of this PR. The main aim is to change this test to use the BitcoinTestFramework. We can address further nits in a future PR.

@maflcko
Copy link
Member

maflcko commented Mar 14, 2018

Needs rebase in the commit that moves the methods. Sorry for letting this sit for so long.

@jnewbery
Copy link
Contributor Author

Sorry for letting this sit for so long.

Not a problem. This is low priority, will rebase next week.

@jnewbery
Copy link
Contributor Author

Rebased. Also addressed @conscott's comments: #11817 (comment) in the first commit.

@jnewbery jnewbery force-pushed the refactor_bip68-112-113-p2p branch from 96b02a0 to cb5b047 Compare March 18, 2018 22:49
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

utACK cb5b047a6f6fb58afee, just some bike-shedding about formatting and comments. Feel free to ignore.

Copy link
Member

Choose a reason for hiding this comment

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

In commit c5427d1f4e3652a1b55968c752fb362b31996186

The "flags" to indicate if the random high- or low-bit was set are never read. Might as well not include it in the object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good spot. I've removed the 'srhb' and 'srlb' keys.

Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed as above

Copy link
Member

Choose a reason for hiding this comment

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

In commit c5427d1f4e3652a1b55968c752fb362b31996186:

Any reason you remove the trailing comments in all lines but not in this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed this one. Now removed.

Copy link
Member

Choose a reason for hiding this comment

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

In commit cb5b047a6f6fb58afee:

Nit: Sometimes you use named args for the bool, and sometimes you don't. Might as well use the success=False everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good. Updated.

@sipa
Copy link
Member

sipa commented Mar 21, 2018

Concept ACK, and very weak utACK (read through the changes, not a Python expert).

@jnewbery jnewbery force-pushed the refactor_bip68-112-113-p2p branch from cb5b047 to 1298268 Compare March 22, 2018 13:39
@maflcko
Copy link
Member

maflcko commented Mar 22, 2018

re-utACK 1298268 only changes were style changes that shouldn't change behaviour.

Copy link
Contributor

@conscott conscott 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 1298268

@maflcko maflcko merged commit 1298268 into bitcoin:master Apr 1, 2018
maflcko pushed a commit that referenced this pull request Apr 1, 2018
…TestFramework

1298268 [tests] Change feature_csv_activation.py to use BitcoinTestFramework (John Newbery)
db7ffb9 [tests] Move utility functions in feature_csv_activation.py out of class. (John Newbery)
0842edf [tests] Remove nested loops from feature_csv_activation.py (John Newbery)
2e511d5 [tests] improve logging in feature_csv_activation.py (John Newbery)
6f7f5bc [tests] fix flake8 nits in feature_csv_activation.py (John Newbery)

Pull request description:

  Next step in #10603.

  - first four commits tidy up bip68-112-113-p2p.py
  - fifth commit removes usage of ComparisonTestFramework

Tree-SHA512: 34466be12280096ad92ac842f9c594ae40c19be9b4edc73c1e37964d03d55f4e75b80cea50c9940404096effc23705671503a883a7b7773b5866a29f653ba710
@jnewbery jnewbery deleted the refactor_bip68-112-113-p2p branch April 2, 2018 17:45
maflcko pushed a commit that referenced this pull request Apr 5, 2018
…TestFramework]

9c92c8c [tests] Remove Comparison Test Framework (John Newbery)
e80c640 [tests] Remove bip9-softforks.py (John Newbery)

Pull request description:

  Builds on #11772, #11773 and #11817. Please review those PRs first.

  Final step in #10603.

  - First commit removes bip9-softforks.py.  bip9-sofforks.py was intended to be a generic test for versionbits deployments. However, it only tests CSV activation and was not updated to test segwit activation. CSV activation is tested by bip68-112-113-p2p.py, so this test is duplicated effort. Rather than try to update it to use the BitcoinTestFramework, just remove it. (see btcdrak#8 for previous discussion around the redundancy of bip9-softforks.py)
  - Second commit removes the now unused BitcoinComparisonFramework class and the comptool and blockstore modules.

Tree-SHA512: 4bb7196d521048b3b8ba95c87dde73005a1ac73d29ccbb869f11ce9a71089686e7eacd7335337853041dfbd3a5b110172b105adbada58779814d4db22b1376f5
UdjinM6 pushed a commit to dashpay/dash that referenced this pull request Jan 11, 2020
…se BitcoinTestFramework (#3278)

* [tests] fix flake8 nits in feature_csv_activation.py

* [tests] improve logging in feature_csv_activation.py

* [tests] Remove nested loops from feature_csv_activation.py

Makes the test a lot clearer.

* [tests] Move utility functions in feature_csv_activation.py out of class.

* [tests] Change feature_csv_activation.py to use BitcoinTestFramework

* Few import fixes

Co-authored-by: John Newbery <[email protected]>
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants