File tree Expand file tree Collapse file tree
actuator/src/main/java/org/tron/core/actuator
common/src/main/java/org/tron/core
framework/src/main/java/org/tron/core/config/args Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import static org .tron .core .actuator .ActuatorConstant .ACCOUNT_EXCEPTION_STR ;
44import static org .tron .core .actuator .ActuatorConstant .NOT_EXIST_STR ;
55import static org .tron .core .actuator .ActuatorConstant .WITNESS_EXCEPTION_STR ;
6- import static org .tron .core .config .Parameter .ChainConstant .BLOCK_PRODUCED_INTERVAL ;
76
87import com .google .protobuf .ByteString ;
98import com .google .protobuf .InvalidProtocolBufferException ;
@@ -53,8 +52,7 @@ public boolean execute(Object result) throws ContractExeException {
5352
5453 long currentMaintenanceTime =
5554 chainBaseManager .getDynamicPropertiesStore ().getNextMaintenanceTime ();
56- long now3 = now + chainBaseManager .getDynamicPropertiesStore ().getProposalVotingWindow ()
57- * BLOCK_PRODUCED_INTERVAL ;
55+ long now3 = now + chainBaseManager .getDynamicPropertiesStore ().getProposalVotingWindow ();
5856 long round = (now3 - currentMaintenanceTime ) / maintenanceTimeInterval ;
5957 long expirationTime =
6058 currentMaintenanceTime + (round + 1 ) * maintenanceTimeInterval ;
Original file line number Diff line number Diff line change @@ -39,12 +39,12 @@ public class Constant {
3939 public static final long MAX_CONTRACT_RESULT_SIZE = 2L ;
4040 public static final long PB_DEFAULT_ENERGY_LIMIT = 0L ;
4141 public static final long CREATOR_DEFAULT_ENERGY_LIMIT = 1000 * 10_000L ;
42- public static final long MIN_PROPOSAL_VOTING_WINDOW = 0L ; // Number of blocks to 0 day
43- public static final long MAX_PROPOSAL_VOTING_WINDOW = 10512000L ; // Number of blocks to 365 days
42+ public static final long MIN_PROPOSAL_VOTING_WINDOW = 0L ; // 0 ms
43+ public static final long MAX_PROPOSAL_VOTING_WINDOW = 31536000000L ; // ms of 365 days
4444 /**
4545 * default number of blocks to 3 days
4646 */
47- public static final long DEFAULT_PROPOSAL_VOTING_WINDOW = 86400L ;
47+ public static final long DEFAULT_PROPOSAL_VOTING_WINDOW = 259200000L ;
4848
4949
5050 // Numbers
Original file line number Diff line number Diff line change @@ -1299,9 +1299,18 @@ public static void setParam(final Config config) {
12991299 config .hasPath (Constant .COMMITTEE_ALLOW_TVM_BLOB ) ? config
13001300 .getInt (Constant .COMMITTEE_ALLOW_TVM_BLOB ) : 0 ;
13011301
1302- PARAMETER .proposalVotingWindow =
1303- config .hasPath (Constant .COMMITTEE_PROPOSAL_VOTING_WINDOW ) ? config
1304- .getInt (Constant .COMMITTEE_PROPOSAL_VOTING_WINDOW ) : DEFAULT_PROPOSAL_VOTING_WINDOW ;
1302+ if (config .hasPath (Constant .COMMITTEE_PROPOSAL_VOTING_WINDOW )) {
1303+ // Highest priority: As long as COMMITTEE_PROPOSAL_VOTING_WINDOW is configured, it will be
1304+ // taken
1305+ PARAMETER .proposalVotingWindow = config .getInt (Constant .COMMITTEE_PROPOSAL_VOTING_WINDOW );
1306+ } else if (config .hasPath (Constant .BLOCK_PROPOSAL_EXPIRE_TIME )) {
1307+ // Secondary priority: If the former is not configured but the latter is configured,
1308+ // choose the latter
1309+ PARAMETER .proposalVotingWindow = config .getInt (Constant .BLOCK_PROPOSAL_EXPIRE_TIME );
1310+ } else {
1311+ // Lowest priority: Neither is configured, use default values
1312+ PARAMETER .proposalVotingWindow = DEFAULT_PROPOSAL_VOTING_WINDOW ;
1313+ }
13051314
13061315 logConfig ();
13071316 }
You can’t perform that action at this time.
0 commit comments