Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,7 @@ public long getAllowTvmSelfdestructRestriction() {
return Optional.ofNullable(getUnchecked(ALLOW_TVM_SELFDESTRUCT_RESTRICTION))
.map(BytesCapsule::getData)
.map(ByteArray::toLong)
.orElse(CommonParameter.getInstance().getAllowTvmSelfdestructRestriction());
.orElse(0L);
}

public void saveAllowTvmSelfdestructRestriction(long value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,6 @@ public class CommonParameter {
@Setter
public long allowTvmBlob;

@Getter
@Setter
public long allowTvmSelfdestructRestriction;

private static double calcMaxTimeRatio() {
//return max(2.0, min(5.0, 5 * 4.0 / max(Runtime.getRuntime().availableProcessors(), 1)));
return 5.0;
Expand Down
3 changes: 0 additions & 3 deletions common/src/main/java/org/tron/core/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,6 @@ public class Constant {

public static final String COMMITTEE_ALLOW_TVM_BLOB = "committee.allowTvmBlob";

public static final String COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION =
"committee.allowTvmSelfdestructRestriction";

public static final String COMMITTEE_PROPOSAL_EXPIRE_TIME = "committee.proposalExpireTime";

}
5 changes: 0 additions & 5 deletions framework/src/main/java/org/tron/core/config/args/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ public static void clearParam() {
PARAMETER.consensusLogicOptimization = 0;
PARAMETER.allowTvmCancun = 0;
PARAMETER.allowTvmBlob = 0;
PARAMETER.allowTvmSelfdestructRestriction = 0;
PARAMETER.rpcMaxRstStream = 0;
PARAMETER.rpcSecondsPerWindow = 0;
}
Expand Down Expand Up @@ -1272,10 +1271,6 @@ public static void setParam(final Config config) {
config.hasPath(Constant.COMMITTEE_ALLOW_TVM_BLOB) ? config
.getInt(Constant.COMMITTEE_ALLOW_TVM_BLOB) : 0;

PARAMETER.allowTvmSelfdestructRestriction =
config.hasPath(Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION) ? config
.getInt(Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION) : 0;

Choose a reason for hiding this comment

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

Why was Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION not removed?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the reminder. Yes, Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION also need to be removed.

logConfig();
}

Expand Down
2 changes: 0 additions & 2 deletions framework/src/test/java/org/tron/common/ParameterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,5 @@ public void testCommonParameter() {
assertEquals(1, parameter.getAllowEnergyAdjustment());
parameter.setMaxCreateAccountTxSize(1000);
assertEquals(1000, parameter.getMaxCreateAccountTxSize());
parameter.setAllowTvmSelfdestructRestriction(1);
assertEquals(1, parameter.getAllowTvmSelfdestructRestriction());
}
}