Skip to content

Conversation

@gmaxwell
Copy link
Contributor

No description provided.

@gmaxwell
Copy link
Contributor Author

gmaxwell commented May 23, 2017

This will crash on master. Fix is currently in the per-txout PR. Edit: Sipa asked me to just add the fix here, doing so now.

Thanks to Suhas Daftuar for figuring this out.
@fanquake fanquake added the Tests label May 23, 2017
@sipa
Copy link
Member

sipa commented May 24, 2017

utACK 4b3dd975a303a0d7efaec790c387f0285a4bb8c4

Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

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

utACK 4b3dd975a303a0d7efaec790c387f0285a4bb8c4

@paveljanik
Copy link
Contributor

ACK 4b3dd97

FWIW: The new test crashes on master with:

2017-05-24 06:50:24.034000 TestFramework (INFO): Initializing test directory /var/folders/65/fn0h49r55k7779vg1b_h461r0000gn/T/test0wr7ofxj
Assertion failed: (valid_), function key, file leveldb/db/db_iter.cc, line 67.

Fixed in this PR.

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

I can't review the code change in src/txdb.cpp since I don't know that code, but I can confirm that this test causes bitcoind to crash without the code change, and passes successfully with the code change.

A few nits inline. Also consider changing line 35 of the test from:

        self.num_nodes = 2

to:

        self.num_nodes = 1

I know that wsan't changed by this PR, but 2 nodes are unnecessary for this test, and changing it to 1 cuts the test time in half (from 5s to 2.5s on my pc) due to node startup/shutdown time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment (or info log) here explaining what this test is for:

self.log.info("Test that gettxoutsetinfo() works for blockchain with just the genesis block")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not test all fields:

assert_equal(res2['bestblock'], node.getblockhash(0)))
assert_equal(len(res2['hash_serialized']), 64)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done (and also added that to the first check)

Copy link
Contributor

Choose a reason for hiding this comment

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

Again, a comment/info log would be nice here:

self.log.info("Test that gettxoutsetinfo() returns the same result after invalidate/reconsider block")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider just testing equality of res and res3 for succinctness:

assert_equal(res, res3)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Equality will be the wrong comparison with the disk usage field which is about to be added.

@sdaftuar
Copy link
Member

ACK

@gmaxwell
Copy link
Contributor Author

updated for @jnewbery 's nits. (Thanks!)

@jnewbery
Copy link
Contributor

tested reACK 513da90

@sdaftuar
Copy link
Member

utACK 513da90

@paveljanik
Copy link
Contributor

reACK 513da90

@sipa sipa merged commit 513da90 into bitcoin:master May 26, 2017
sipa added a commit that referenced this pull request May 26, 2017
…xoutsetinfo.

513da90 Add test for empty chain and reorg consistency for gettxoutsetinfo. (Gregory Maxwell)
822755a Fix: make CCoinsViewDbCursor::Seek work for missing keys (Pieter Wuille)

Tree-SHA512: e549921e8b8f599bf61ebe0ee7ef1d2f474043723d633e24665fe434b996a98e039612de8a1c2cd16b63f154943ff5ea1c1935e9561cfb813a00d47d926d0b22
@gmaxwell gmaxwell changed the title Add test for empty chain and reorg consistency for gettxoutsetinfo. Fix and add test for empty chain and reorg consistency for gettxoutsetinfo. Jun 1, 2017
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Jun 5, 2017
Thanks to Suhas Daftuar for figuring this out.

Github-Pull: bitcoin#10445
Rebased-From: 822755a
codablock pushed a commit to codablock/dash that referenced this pull request Oct 24, 2017
…or gettxoutsetinfo.

513da90 Add test for empty chain and reorg consistency for gettxoutsetinfo. (Gregory Maxwell)
822755a Fix: make CCoinsViewDbCursor::Seek work for missing keys (Pieter Wuille)

Tree-SHA512: e549921e8b8f599bf61ebe0ee7ef1d2f474043723d633e24665fe434b996a98e039612de8a1c2cd16b63f154943ff5ea1c1935e9561cfb813a00d47d926d0b22
@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