Bitcoin Forum
May 05, 2024, 11:49:39 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: in bitcoin miner.cpp what means nblocksize  (Read 137 times)
myapple (OP)
Member
**
Offline Offline

Activity: 100
Merit: 11


View Profile
December 28, 2017, 12:03:52 PM
 #1

thanks
1714909779
Hero Member
*
Offline Offline

Posts: 1714909779

View Profile Personal Message (Offline)

Ignore
1714909779
Reply with quote  #2

1714909779
Report to moderator
1714909779
Hero Member
*
Offline Offline

Posts: 1714909779

View Profile Personal Message (Offline)

Ignore
1714909779
Reply with quote  #2

1714909779
Report to moderator
1714909779
Hero Member
*
Offline Offline

Posts: 1714909779

View Profile Personal Message (Offline)

Ignore
1714909779
Reply with quote  #2

1714909779
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4166


View Profile
December 28, 2017, 02:29:50 PM
Merited by ABCbits (1)
 #2

I think you just answered your own question; remove the n and add a space between the block and the size. In the older versions, it's value is 1000.

I'm not sure what source code you're looking at but Core removed the max block size and replaced it with max block weight. The max block weight is 4000 units. This means that in theory, the block size could potentially be about 4MB but I don't think we would see that.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
December 29, 2017, 07:44:59 AM
 #3

it's value is 1000....The max block weight is 4000 units.
You've dropped a few zeros. The max block size was 1000000 bytes. The max block weight is 4000000 units.

ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4166


View Profile
December 29, 2017, 08:24:30 AM
 #4

it's value is 1000....The max block weight is 4000 units.
You've dropped a few zeros. The max block size was 1000000 bytes. The max block weight is 4000000 units.
Yeah, I'm aware. However, it was stated as 4000 in the source code[1], was 1000 as the block size in the past. Why is it so? Was it counted in terms of KB in the past?


[1] https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp#L397

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1053


Please do not PM me loan requests!


View Profile WWW
December 29, 2017, 09:17:43 AM
 #5

it's value is 1000....The max block weight is 4000 units.
You've dropped a few zeros. The max block size was 1000000 bytes. The max block weight is 4000000 units.
Yeah, I'm aware. However, it was stated as 4000 in the source code[1], was 1000 as the block size in the past. Why is it so? Was it counted in terms of KB in the past?


[1] https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp#L397
Actually that's a separate variable which is nBlockMaxWeight (4000000) minus 4000 units. It's just checking if the block is "almost full" of transactions (meaning, weight of at least 3996000, which is 99.9% capacity).

The maximum weight itself is defined as 4000000 in consensus.h here.
myapple (OP)
Member
**
Offline Offline

Activity: 100
Merit: 11


View Profile
December 29, 2017, 09:20:43 AM
 #6

the code nBlockSize 1000 is in miner.cpp in versions 0.9.4
Is it in kB ?
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4166


View Profile
December 29, 2017, 09:45:49 AM
Last edit: December 29, 2017, 10:03:10 AM by ranochigo
 #7

Actually that's a separate variable which is nBlockMaxWeight (4000000) minus 4000 units. It's just checking if the block is "almost full" of transactions (meaning, weight of at least 3996000, which is 99.9% capacity).

The maximum weight itself is defined as 4000000 in consensus.h here.
Oh. That makes so much more sense now. Cheesy Thanks!
the code nBlockSize 1000 is in miner.cpp in versions 0.9.4
Is it in kB ?
Bytes. But it doesn't concern the whole Block size. I realised I've read the whole code wrongly and I had to read it again.

The 1000 value you see isn't the actual block size. The whole point for that line of code is to reserve the coinbase transaction, which they assume to be 1000bytes. If you read the code later on, it would prevent the client from including too many transactions, such that they are unable to include the coinbase transaction.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!