New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segregated witness #7910
Segregated witness #7910
Changes from all commits
644b2c5
afdc413
fdec2bc
e69265d
66dbd81
70ebe86
f8bcd86
58847fe
bb4bb47
3b1ff49
e35d020
adb1c09
ac6886d
cb9d4d3
2c87be1
1e47805
97f34f7
6a8021f
271e45e
d374139
92c6dc3
3955218
5a47b98
e573571
a6386c2
1b6c6f1
351a2fe
abbe085
c3fe53f
ec385fa
a2d6f8a
2ed1d11
3c0b16f
24746d2
3409ad6
e5ffcc1
5e6abe5
7b539f9
cfb0a83
bb2bfca
64c1527
cc741f5
c28179f
6a5da9b
88e0135
da60fae
4f827be
058f495
c1e7a95
dbe6391
97d7402
f0f6123
a613599
5d6b6e2
77c613c
f889bec
3ddabe4
c744a1e
4709595
122ca81
5df3e51
36e1656
f726402
cf2c531
0fb6e4e
ccd0e6c
3a62cb9
a541f0b
f38671f
ba7e292
e7821e9
76142af
8708de8
b846298
38e3fcd
fd85b77
433daf4
9590289
17277c9
1e9cba2
8f50b96
75335ca
306858f
036fa47
7eb0d75
8adb03a
a1d1d0c
019860e
c815c16
f16067f
059d4d1
c1c38a2
0acd1dc
869f26e
14d4d1d
4840f6d
3dbf852
f98de5f
c06c40b
d8b5db9
57d4bd2
0bfbf60
496d8c0
7799a7c
4c19c18
7613bbb
a9bff09
92ab64c
40f7829
b644339
00bf5e1
c8f2fb2
f3a7ed4
1b9893f
3483e5c
2a6516f
c7b5de5
cc19adc
efc251d
396f4b8
b508f5b
10433cf
2948c02
d7fe873
0e177a2
c7795ee
c708c3a
c4e3c75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,7 +97,7 @@ def __init__(self): | |
| def setup_network(self): | ||
| # Start a node with maxuploadtarget of 200 MB (/24h) | ||
| self.nodes = [] | ||
| self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-maxuploadtarget=200", "-blockmaxsize=999000"])) | ||
| self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-maxuploadtarget=800", "-blockmaxsize=999000"])) | ||
|
|
||
| def mine_full_block(self, node, address): | ||
| # Want to create a full block | ||
|
|
@@ -175,13 +175,13 @@ def run_test(self): | |
| getdata_request = msg_getdata() | ||
| getdata_request.inv.append(CInv(2, big_old_block)) | ||
|
|
||
| max_bytes_per_day = 200*1024*1024 | ||
| daily_buffer = 144 * MAX_BLOCK_SIZE | ||
| max_bytes_per_day = 800*1024*1024 | ||
| daily_buffer = 144 * 4000000 | ||
| max_bytes_available = max_bytes_per_day - daily_buffer | ||
| success_count = max_bytes_available // old_block_size | ||
|
|
||
| # 144MB will be reserved for relaying new blocks, so expect this to | ||
| # succeed for ~70 tries. | ||
| # 576MB will be reserved for relaying new blocks, so expect this to | ||
| # succeed for ~235 tries. | ||
| for i in range(success_count): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you mind explaining this calculation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at least 4 people so far waiting for an answer to this one, @sipa curious minds want to know! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| test_nodes[0].send_message(getdata_request) | ||
| test_nodes[0].sync_with_ping() | ||
|
|
@@ -198,9 +198,9 @@ def run_test(self): | |
|
|
||
| # Requesting the current block on test_nodes[1] should succeed indefinitely, | ||
| # even when over the max upload target. | ||
| # We'll try 200 times | ||
| # We'll try 800 times | ||
| getdata_request.inv = [CInv(2, big_new_block)] | ||
| for i in range(200): | ||
| for i in range(800): | ||
| test_nodes[1].send_message(getdata_request) | ||
| test_nodes[1].sync_with_ping() | ||
| assert_equal(test_nodes[1].block_receive_map[big_new_block], i+1) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the max arbitrarily set here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so this is test code, but the test code used to be against the MAX_BLOCK_SIZE why is the max block size no longer important? Sorry if I sound stupid here being ruby dev not python, but I'd like to understand this seemingly arbitrary change that IMHO is way worse than being arbitrary it is changing the TEST ITSELF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misunderstood your comment. Sure, I should add a constant for the new max block size on the python side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sipa 👍 on a new constant to make things readable, but sorry I'm just starting to learn the source code here so I still have simple questions. Is the reason your setting this different than the MAX_BLOCK_SIZE because segwit is supposed to help double the amount of data per block? I would think this would be 4MB not 4_000_000 which is close... Makes me think the test would be MAX_BLOCK_SIZE * 2. My main misunderstanding is why this value is changing from max constant when the test appears to be testing mining full blocks... Hopefully that helps clear up my confusion.