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

Closed
wants to merge 128 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+5,305 −571
Diff settings

Always

Just for now

Copy path View file
@@ -21,7 +21,7 @@
REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
# list unsupported, deprecated and duplicate args as they need no documentation
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay'])
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags'])
def main():
used = check_output(CMD_GREP_ARGS, shell=True)
Copy path View file
@@ -136,6 +136,8 @@
'invalidtxrequest.py',
'abandonconflict.py',
'p2p-versionbits-warning.py',
'p2p-segwit.py',
'segwit.py',
'importprunedfunds.py',
'signmessages.py',
]
Copy path View file
@@ -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

This comment has been minimized.

@JDutil

JDutil Jun 3, 2016

Why is the max arbitrarily set here?

This comment has been minimized.

@sipa

sipa via email Jun 3, 2016

Member

This comment has been minimized.

@MarcoFalke

MarcoFalke via email Jun 3, 2016

Member

This comment has been minimized.

@JDutil

JDutil Jun 3, 2016

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.

This comment has been minimized.

@sipa

sipa Jun 4, 2016

Member

Oh, I misunderstood your comment. Sure, I should add a constant for the new max block size on the python side.

This comment has been minimized.

@JDutil

JDutil Jun 4, 2016

@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.

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):

This comment has been minimized.

@nicola

nicola May 20, 2016

do you mind explaining this calculation?

This comment has been minimized.

@rebroad

rebroad Aug 25, 2016

Contributor

at least 4 people so far waiting for an answer to this one, @sipa curious minds want to know!

This comment has been minimized.

@MarcoFalke

MarcoFalke Aug 25, 2016

Member

@rebroad and other 3: Explanation should be in OP of #8559

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)
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.