-
Notifications
You must be signed in to change notification settings - Fork 130
Make contract size limit configurable. #1227
Make contract size limit configurable. #1227
Conversation
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.
LGTM.
@@ -59,7 +60,8 @@ | |||
|
|||
private MainnetProtocolSpecs() {} | |||
|
|||
public static ProtocolSpecBuilder<Void> frontierDefinition() { | |||
public static ProtocolSpecBuilder<Void> frontierDefinition(final OptionalInt contractSizeLimit) { | |||
int frontierContractSizeLimit = contractSizeLimit.orElse(FRONTIER_CONTRACT_SIZE_LIMIT); |
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.
This probably should just be called contractSizeLimit
since it's not necessarily the frontier limit anymore (similarly for the other cases).
…ng it possible to override milestone based configurations in a private network.
a3fc66c
to
899bead
Compare
protocolSchedule, OptionalLong.of(0), MainnetProtocolSpecs.frontierDefinition()); | ||
protocolSchedule, | ||
OptionalLong.of(0), | ||
MainnetProtocolSpecs.frontierDefinition(config.getContractSizeLimit())); |
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.
nit: perhaps extract config.getContractSizeLimit() to a local var to make the code little more readable. It's used quite a few times in this function.
public static ProtocolSpecBuilder<Void> frontierDefinition() { | ||
public static ProtocolSpecBuilder<Void> frontierDefinition( | ||
final OptionalInt configContractSizeLimit) { | ||
int contractSizeLimit = configContractSizeLimit.orElse(FRONTIER_CONTRACT_SIZE_LIMIT); |
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.
nit: make contractSizeLimit final
return frontierDefinition() | ||
public static ProtocolSpecBuilder<Void> homesteadDefinition( | ||
final OptionalInt configContractSizeLimit) { | ||
int contractSizeLimit = configContractSizeLimit.orElse(FRONTIER_CONTRACT_SIZE_LIMIT); |
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.
nit: make contractSizeLimit final
* Make the contract size limit configurable in the genesis config, making it possible to override milestone based configurations in a private network.
* Make the contract size limit configurable in the genesis config, making it possible to override milestone based configurations in a private network.
Make the contract size limit configurable in the genesis config, making it possible to override milestone based configurations in a private network.