maxCodeSizeChangeBlock to genesis for tracking maxCodeSize value change #947
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
maxCodeSizeChangeBlockto track the block number when themaxCodeSizechanges from default 24K to the value given.For long standing networks, it is possible that contracts which crossed default 24k size were deployed at some time and the network rejected the same with
max code size exceedederror. If the network at later point changed the maxCodeSize to a higher value and post this if a new node joins the network, the new node will sync the old blocks with the higher max code size value and thus the gas computed on the historical block will be different from the network resulting in bad block error.maxCodeSizeChangeBlockhas been added track the block number where the newmaxCodeSizevalue was set for the network overwriting the default value of 24K. This will ensure that any new nodes joining the network will be able to sync the historical blocks without the bad block error.However, it should be noted that, if
maxCodeSizehas been changed several times at network level,maxCodeSizeChangeBlockwill only track the last change and for all other prior blocks it will take 24K as the defaultmaxCodeSize. In this scenario, its possible to get the bad blocks error at the time of network sync#942