Skip to content

Add tests for ContextualCheckBlock#579

Merged
Gnappuraz merged 8 commits into
dtr-org:masterfrom
Gnappuraz:contextualcheckblock-tests
Feb 12, 2019
Merged

Add tests for ContextualCheckBlock#579
Gnappuraz merged 8 commits into
dtr-org:masterfrom
Gnappuraz:contextualcheckblock-tests

Conversation

@Gnappuraz

@Gnappuraz Gnappuraz commented Feb 11, 2019

Copy link
Copy Markdown
Member

This PR adds unit test coverage for ContextualCheckBlock(). This helps #553.

Matteo Sumberaz added 2 commits February 11, 2019 16:37
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
@Gnappuraz Gnappuraz requested review from a team, kostyantyn and scravy February 11, 2019 15:39
Comment thread src/test/validation_tests.cpp Outdated
@Gnappuraz Gnappuraz added the tests Automated tests label Feb 11, 2019
@Gnappuraz Gnappuraz self-assigned this Feb 11, 2019

@scravy scravy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

utACK 8280102

I am having the suspicion that this should maybe be rebased with master.

Comment thread src/test/validation_tests.cpp Outdated
Comment thread src/validation.h Outdated
Comment thread src/test/validation_tests.cpp
Comment thread src/test/validation_tests.cpp
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
Comment thread src/test/validation_tests.cpp Outdated

@kostyantyn kostyantyn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

utACK 3db9f00

Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>

@castarco castarco left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

utACK 3db9f00

Matteo Sumberaz added 2 commits February 11, 2019 16:56
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
Comment thread src/validation.cpp

@castarco castarco left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A couple of tests have to be fixed.

Signed-off-by: Matteo Sumberaz <matteo@thirdhash.com>
@Gnappuraz Gnappuraz dismissed castarco’s stale review February 12, 2019 08:46

Tests have been fixed.

@Gnappuraz Gnappuraz merged commit 42371f5 into dtr-org:master Feb 12, 2019

@castarco castarco left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

late utACK 1fd9f9b

scravy added a commit that referenced this pull request Feb 13, 2019
- Removes one PoW check in ::ContextualCheckBlockHeader
- Remove bad-diffbits check from feature-block tests

This uses `BlockValidator::ContextualCheckBlockHeader` as a drop-in
replacement in `ContextualCheckBlockHeader`. Thanks to the tests which
were added by @Gnappuraz in #579 the very same tests will also check the new
contextual check block.

This does remove one PoW check. All other PoW checks are still there,
especially in `CheckBlockHeader`.

The new `BlockValidator::ContextualCheckBlockHeader` does invoke `BlockValidator::CheckBlockHeader` if the validation context passed in `ValidationInfo` does not know that it succeeded already. The new `BlockValidator::CheckBlockHeader` does not do a `PoW` check but it checks that the timestamp is well-formed. This check is bypassed and there's UNIT-E TODO slapped on to it.

Disabling the check for `bad-diffbits`. This is the check which was actually removed, it is in contextual check block to check the difficulty against the calulated one. This works completely different in the PoS setting as it affects the kernel protocol.

Signed-off-by: Julian Fleischer <julian@thirdhash.com>
@Gnappuraz Gnappuraz deleted the contextualcheckblock-tests branch February 25, 2019 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants