Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Make contract size limit configurable. #1227

Merged

Conversation

rojotek
Copy link
Member

@rojotek rojotek commented Apr 6, 2019

Make the contract size limit configurable in the genesis config, making it possible to override milestone based configurations in a private network.

@rojotek rojotek requested a review from ajsutton April 6, 2019 10:47
Copy link
Contributor

@ajsutton ajsutton left a 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);
Copy link
Contributor

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

rojotek added 2 commits April 8, 2019 06:06
…ng it possible to override milestone based configurations in a private network.
@rojotek rojotek force-pushed the make-contract-size-limit-configurable branch from a3fc66c to 899bead Compare April 7, 2019 20:06
protocolSchedule, OptionalLong.of(0), MainnetProtocolSpecs.frontierDefinition());
protocolSchedule,
OptionalLong.of(0),
MainnetProtocolSpecs.frontierDefinition(config.getContractSizeLimit()));
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make contractSizeLimit final

@rojotek rojotek merged commit 668d4af into PegaSysEng:master Apr 7, 2019
notlesh pushed a commit to notlesh/pantheon that referenced this pull request Apr 24, 2019
* Make the contract size limit configurable in the genesis config, making it possible to override milestone based configurations in a private network.
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 4, 2019
* Make the contract size limit configurable in the genesis config, making it possible to override milestone based configurations in a private network.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants