Skip to content

Commit cf53d4f

Browse files
committed
feat(approving): convert the approving window configuration to chain governance
1 parent 3398c41 commit cf53d4f

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,10 @@ public class CommonParameter {
724724
@Setter
725725
public long allowTvmBlob;
726726

727+
/**
728+
* Committee parameter.
729+
* Indicate the number of blocks after which the proposal approval window will take effect.
730+
*/
727731
@Getter
728732
@Setter
729733
public long proposalVotingWindow;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public class Constant {
4141
public static final long CREATOR_DEFAULT_ENERGY_LIMIT = 1000 * 10_000L;
4242
public static final long MIN_PROPOSAL_VOTING_WINDOW = 0L; // Number of blocks to 0 day
4343
public static final long MAX_PROPOSAL_VOTING_WINDOW = 10512000L; // Number of blocks to 365 days
44+
/**
45+
* default number of blocks to 3 days
46+
*/
47+
public static final long DEFAULT_PROPOSAL_VOTING_WINDOW = 86400L;
4448

4549

4650
// Numbers

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static org.tron.common.math.Maths.max;
55
import static org.tron.common.math.Maths.min;
66
import static org.tron.core.Constant.ADD_PRE_FIX_BYTE_MAINNET;
7+
import static org.tron.core.Constant.DEFAULT_PROPOSAL_VOTING_WINDOW;
78
import static org.tron.core.Constant.DYNAMIC_ENERGY_INCREASE_FACTOR_RANGE;
89
import static org.tron.core.Constant.DYNAMIC_ENERGY_MAX_FACTOR_RANGE;
910
import static org.tron.core.config.Parameter.ChainConstant.BLOCK_PRODUCE_TIMEOUT_PERCENT;
@@ -247,6 +248,7 @@ public static void clearParam() {
247248
PARAMETER.consensusLogicOptimization = 0;
248249
PARAMETER.allowTvmCancun = 0;
249250
PARAMETER.allowTvmBlob = 0;
251+
PARAMETER.proposalVotingWindow = DEFAULT_PROPOSAL_VOTING_WINDOW;
250252
}
251253

252254
/**
@@ -1299,7 +1301,7 @@ public static void setParam(final Config config) {
12991301

13001302
PARAMETER.proposalVotingWindow =
13011303
config.hasPath(Constant.COMMITTEE_PROPOSAL_VOTING_WINDOW) ? config
1302-
.getInt(Constant.COMMITTEE_PROPOSAL_VOTING_WINDOW) : 86400L;
1304+
.getInt(Constant.COMMITTEE_PROPOSAL_VOTING_WINDOW) : DEFAULT_PROPOSAL_VOTING_WINDOW;
13031305

13041306
logConfig();
13051307
}

0 commit comments

Comments
 (0)