-
Notifications
You must be signed in to change notification settings - Fork 648
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
Reduce the max-block-size that is used in new networks by default #419
Conversation
... unless the genesis block is modified manually, or the committee changes that parameter on the chain. This fixes the issue that blocks might otherwise become bigger than the MAX_MESSAGE_SIZE of the p2p code. This far, I am unaware that the p2p does segmentation of messages.
Do a replay to make sure it didn't break anything. |
I agree that the blocks shouldn't be allowed to be larger than MAX_MESSAGE_SIZE. Messages are not segmented by the p2p code. It's probably a good idea to test that there's no overhead that makes the final message larger than the nominal block size (for example, by creating a block of max size and trying to propagate it). As a related issue, I don't know why 2MB was chosen as the max message size, but this could certainly be increased some. |
Setting max block size to the same as max message size won't help, because of the message overhead. You need to stay below that, for example use 2000000 to be on the safe side. |
Someone just exploited this on the testnet |
For reference, this is how you can truncate the blockchain locally:
truncating the last 32 bytes effectively pops the last block from your block db replay is needed |
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.
As @pmconrad mentioned, best change it to an even smaller value.
... unless the genesis block is modified manually, or the committee
changes that parameter on the chain.
This fixes the issue that blocks might otherwise become bigger than the
MAX_MESSAGE_SIZE of the p2p code. This far, I am unaware that the p2p
does segmentation of messages.