Page MenuHomePhabricator

Add simple big block test
ClosedPublic

Authored by freetrader on Jun 11 2017, 21:46.

Details

Summary

The abc-p2p-fullblocktest-simple.py test generates a 2MB block
and an oversize block under EB2 conditions.

This test is intended as a starting point to derive further cases and tests,
while we look into adapting p2p-fullblocktest.py as such (it is very complex and
hard to adapt to bigger block sizes and other consensus rule changes).

Depends on D171

Test Plan

qa/pull-tester/rpc-tests.py abc-p2p-fullblocktest-simple

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptJun 11 2017, 21:46
qa/rpc-tests/abc-p2p-fullblocktest-simple.py
47 ↗(On Diff #385)

Be careful, this will need to be changed when changes to D171 are done.

Planning to change the command line option name to 'excessiveblocksize' as per D171 review comments.

Rename blocksizeacceptlimit option to excessiveblocksize

Also rename variables to avoid confusion.

qa/rpc-tests/abc-p2p-fullblocktest-simple.py
233 ↗(On Diff #385)

why not just using = rather than <= ?

qa/rpc-tests/abc-p2p-fullblocktest-simple.py
47 ↗(On Diff #385)

+1

233 ↗(On Diff #385)

Because I'm testing if the concrete size of the block will fit in to whatever the upper cap is currently set to in the test. It just has to fit in.

We should add more test steps to try increase the limit, then check again with a > 2MB block etc.

For what it's worth, I arc patched that diff and ran the test, it passes.

If you run this test with --nocleanup , it will leave behind a /tmp/test* folder (telling you the name).

You can then find in there a node0/regtest/debug.log which shows that the client actually accepted the bigger block.

It's missing addition of the to the list of tests in rpc-tester

It's missing addition to the list

qa/rpc-tests/abc-p2p-fullblocktest-simple.py
234 ↗(On Diff #389)

So this creates a block with block size whatever is given as block_size ? Can we make sure it actually generate a block larger than LEGACY_MAX_BLOCK_SIZE ? because if not, then we are testing nothing.

deadalnix changed the visibility from "All Users" to "Public (No Login Required)".Jun 12 2017, 17:51
qa/rpc-tests/abc-p2p-fullblocktest-simple.py
234 ↗(On Diff #389)

This is what line 153 in the next_block() method checks:

assert_equal(len(block.serialize()), block_size)

This revision is now accepted and ready to land.Jun 12 2017, 18:12
This revision was automatically updated to reflect the committed changes.