Skip to content

Commit 40cc590

Browse files
authored
feat(tvm): remove deprecated config in TIP-6780 implementation (#6448)
* feat(tvm): remove allowtvmselfdestructRestriction from commonParameter * feat(test): remove test for allowtvmselfdestructRestriction commonParameter * feat(tvm): remove constant COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION
1 parent 68773e3 commit 40cc590

File tree

5 files changed

+1
-15
lines changed

5 files changed

+1
-15
lines changed

chainbase/src/main/java/org/tron/core/store/DynamicPropertiesStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2957,7 +2957,7 @@ public long getAllowTvmSelfdestructRestriction() {
29572957
return Optional.ofNullable(getUnchecked(ALLOW_TVM_SELFDESTRUCT_RESTRICTION))
29582958
.map(BytesCapsule::getData)
29592959
.map(ByteArray::toLong)
2960-
.orElse(CommonParameter.getInstance().getAllowTvmSelfdestructRestriction());
2960+
.orElse(0L);
29612961
}
29622962

29632963
public void saveAllowTvmSelfdestructRestriction(long value) {

common/src/main/java/org/tron/common/parameter/CommonParameter.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,6 @@ public class CommonParameter {
750750
@Setter
751751
public long allowTvmBlob;
752752

753-
@Getter
754-
@Setter
755-
public long allowTvmSelfdestructRestriction;
756-
757753
private static double calcMaxTimeRatio() {
758754
//return max(2.0, min(5.0, 5 * 4.0 / max(Runtime.getRuntime().availableProcessors(), 1)));
759755
return 5.0;

common/src/main/java/org/tron/core/Constant.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,6 @@ public class Constant {
421421

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

424-
public static final String COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION =
425-
"committee.allowTvmSelfdestructRestriction";
426-
427424
public static final String COMMITTEE_PROPOSAL_EXPIRE_TIME = "committee.proposalExpireTime";
428425

429426
}

framework/src/main/java/org/tron/core/config/args/Args.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ public static void clearParam() {
250250
PARAMETER.consensusLogicOptimization = 0;
251251
PARAMETER.allowTvmCancun = 0;
252252
PARAMETER.allowTvmBlob = 0;
253-
PARAMETER.allowTvmSelfdestructRestriction = 0;
254253
PARAMETER.rpcMaxRstStream = 0;
255254
PARAMETER.rpcSecondsPerWindow = 0;
256255
}
@@ -1272,10 +1271,6 @@ public static void setParam(final Config config) {
12721271
config.hasPath(Constant.COMMITTEE_ALLOW_TVM_BLOB) ? config
12731272
.getInt(Constant.COMMITTEE_ALLOW_TVM_BLOB) : 0;
12741273

1275-
PARAMETER.allowTvmSelfdestructRestriction =
1276-
config.hasPath(Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION) ? config
1277-
.getInt(Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION) : 0;
1278-
12791274
logConfig();
12801275
}
12811276

framework/src/test/java/org/tron/common/ParameterTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,5 @@ public void testCommonParameter() {
322322
assertEquals(1, parameter.getAllowEnergyAdjustment());
323323
parameter.setMaxCreateAccountTxSize(1000);
324324
assertEquals(1000, parameter.getMaxCreateAccountTxSize());
325-
parameter.setAllowTvmSelfdestructRestriction(1);
326-
assertEquals(1, parameter.getAllowTvmSelfdestructRestriction());
327325
}
328326
}

0 commit comments

Comments
 (0)