Skip to content

Commit 7ebed48

Browse files
aiden3885halibobo1205
authored andcommitted
feat(tvm): remove deprecated config in TIP-6780 implementation (tronprotocol#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 92f4a0c commit 7ebed48

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
@@ -252,7 +252,6 @@ public static void clearParam() {
252252
PARAMETER.consensusLogicOptimization = 0;
253253
PARAMETER.allowTvmCancun = 0;
254254
PARAMETER.allowTvmBlob = 0;
255-
PARAMETER.allowTvmSelfdestructRestriction = 0;
256255
PARAMETER.rpcMaxRstStream = 0;
257256
PARAMETER.rpcSecondsPerWindow = 0;
258257
}
@@ -1284,10 +1283,6 @@ public static void setParam(final Config config) {
12841283
config.hasPath(Constant.COMMITTEE_ALLOW_TVM_BLOB) ? config
12851284
.getInt(Constant.COMMITTEE_ALLOW_TVM_BLOB) : 0;
12861285

1287-
PARAMETER.allowTvmSelfdestructRestriction =
1288-
config.hasPath(Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION) ? config
1289-
.getInt(Constant.COMMITTEE_ALLOW_TVM_SELFDESTRUCT_RESTRICTION) : 0;
1290-
12911286
logConfig();
12921287
}
12931288

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)