Skip to content

Commit

Permalink
Merge pull request tronprotocol#3959 from tronprotocol/release_v4.3.0
Browse files Browse the repository at this point in the history
Release v4.3.0
  • Loading branch information
lvs007 authored Aug 3, 2021
2 parents 8dbd75d + 8ef5ccf commit c1d9dfd
Show file tree
Hide file tree
Showing 16 changed files with 582 additions and 229 deletions.
4 changes: 2 additions & 2 deletions actuator/src/main/java/org/tron/core/utils/ProposalUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ public static void validator(DynamicPropertiesStore dynamicPropertiesStore,
if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_3)) {
throw new ContractValidateException("Bad chain parameter id [TOTAL_NET_LIMIT]");
}
if (value < 0 || value > 1000_000_000_000L) {
if (value < 0 || value > 1_000_000_000_000L) {
throw new ContractValidateException(
"Bad chain parameter value, valid range is [0, 1000_000_000_000L]");
"Bad chain parameter value, valid range is [0, 1_000_000_000_000L]");
}
break;
}
Expand Down
198 changes: 33 additions & 165 deletions actuator/src/main/java/org/tron/core/vm/EnergyCost.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@
public class EnergyCost {

private static EnergyCost instance = null;
/* backwards compatibility, remove eventually */
private final int STEP = 1;
/* backwards compatibility, remove eventually */
private final int SSTORE = 300;
private final int ZEROSTEP = 0;
private final int QUICKSTEP = 2;
private final int FASTESTSTEP = 3;
private final int FASTSTEP = 5;
private final int MIDSTEP = 8;
private final int SLOWSTEP = 10;
private final int EXTSTEP = 20;
private final int GENESISENERGYLIMIT = 1000000;
private final int MINENERGYLIMIT = 125000;
private final int BALANCE = 20;
private final int SHA3 = 30;
private final int SHA3_WORD = 6;
Expand All @@ -28,33 +15,18 @@ public class EnergyCost {
private final int RESET_SSTORE = 5000;
private final int REFUND_SSTORE = 15000;
private final int CREATE = 32000;
private final int JUMPDEST = 1;
private final int CREATE_DATA_BYTE = 5;
private final int CALL = 40;
private final int STIPEND_CALL = 2300;
private final int VT_CALL = 9000; //value transfer call
private final int NEW_ACCT_CALL = 25000; //new account call
private final int VT_CALL = 9000; // value transfer call
private final int NEW_ACCT_CALL = 25000; // new account call
private final int MEMORY = 3;
private final int SUICIDE_REFUND = 24000;
private final int QUAD_COEFF_DIV = 512;
private final int CREATE_DATA = 200;
private final int TX_NO_ZERO_DATA = 68;
private final int TX_ZERO_DATA = 4;
private final int TRANSACTION = 21000;
private final int TRANSACTION_CREATE_CONTRACT = 53000;
private final int LOG_ENERGY = 375;
private final int LOG_DATA_ENERGY = 8;
private final int LOG_TOPIC_ENERGY = 375;
private final int COPY_ENERGY = 3;
private final int EXP_ENERGY = 10;
private final int EXP_BYTE_ENERGY = 10;
private final int IDENTITY = 15;
private final int IDENTITY_WORD = 3;
private final int RIPEMD160 = 600;
private final int RIPEMD160_WORD = 120;
private final int SHA256 = 60;
private final int SHA256_WORD = 12;
private final int EC_RECOVER = 3000;
private final int EXT_CODE_SIZE = 20;
private final int EXT_CODE_COPY = 20;
private final int EXT_CODE_HASH = 400;
Expand All @@ -73,235 +45,131 @@ public static EnergyCost getInstance() {
return instance;
}

public int getSTEP() {
return STEP;
}

public int getSSTORE() {
return SSTORE;
}

public int getZEROSTEP() {
return ZEROSTEP;
}

public int getQUICKSTEP() {
return QUICKSTEP;
}

public int getFASTESTSTEP() {
return FASTESTSTEP;
}

public int getFASTSTEP() {
return FASTSTEP;
}

public int getMIDSTEP() {
return MIDSTEP;
}

public int getSLOWSTEP() {
return SLOWSTEP;
}

public int getEXTSTEP() {
return EXTSTEP;
}

public int getGENESISENERGYLIMIT() {
return GENESISENERGYLIMIT;
}

public int getMINENERGYLIMIT() {
return MINENERGYLIMIT;
}

public int getBALANCE() {
public int getBalance() {
return BALANCE;
}

public int getSHA3() {
public int getSha3() {
return SHA3;
}

public int getSHA3_WORD() {
public int getSha3Word() {
return SHA3_WORD;
}

public int getSLOAD() {
public int getSLoad() {
return SLOAD;
}

public int getSTOP() {
public int getStop() {
return STOP;
}

public int getSUICIDE() {
public int getSuicide() {
return SUICIDE;
}

public int getCLEAR_SSTORE() {
public int getClearSStore() {
return CLEAR_SSTORE;
}

public int getSET_SSTORE() {
public int getSetSStore() {
return SET_SSTORE;
}

public int getRESET_SSTORE() {
public int getResetSStore() {
return RESET_SSTORE;
}

public int getREFUND_SSTORE() {
public int getRefundSStore() {
return REFUND_SSTORE;
}

public int getCREATE() {
public int getCreate() {
return CREATE;
}

public int getJUMPDEST() {
return JUMPDEST;
}

public int getCREATE_DATA_BYTE() {
return CREATE_DATA_BYTE;
}

public int getCALL() {
public int getCall() {
return CALL;
}

public int getSTIPEND_CALL() {
public int getStipendCall() {
return STIPEND_CALL;
}

public int getVT_CALL() {
public int getVtCall() {
return VT_CALL;
}

public int getNEW_ACCT_CALL() {
public int getNewAcctCall() {
return NEW_ACCT_CALL;
}

public int getNEW_ACCT_SUICIDE() {
public int getNewAcctSuicide() {
return NEW_ACCT_SUICIDE;
}

public int getMEMORY() {
public int getMemory() {
return MEMORY;
}

public int getSUICIDE_REFUND() {
return SUICIDE_REFUND;
}

public int getQUAD_COEFF_DIV() {
return QUAD_COEFF_DIV;
}

public int getCREATE_DATA() {
return CREATE_DATA;
}

public int getTX_NO_ZERO_DATA() {
return TX_NO_ZERO_DATA;
}

public int getTX_ZERO_DATA() {
return TX_ZERO_DATA;
}

public int getTRANSACTION() {
return TRANSACTION;
}

public int getTRANSACTION_CREATE_CONTRACT() {
return TRANSACTION_CREATE_CONTRACT;
}

public int getLOG_ENERGY() {
public int getLogEnergy() {
return LOG_ENERGY;
}

public int getLOG_DATA_ENERGY() {
public int getLogDataEnergy() {
return LOG_DATA_ENERGY;
}

public int getLOG_TOPIC_ENERGY() {
public int getLogTopicEnergy() {
return LOG_TOPIC_ENERGY;
}

public int getCOPY_ENERGY() {
public int getCopyEnergy() {
return COPY_ENERGY;
}

public int getEXP_ENERGY() {
public int getExpEnergy() {
return EXP_ENERGY;
}

public int getEXP_BYTE_ENERGY() {
public int getExpByteEnergy() {
return EXP_BYTE_ENERGY;
}

public int getIDENTITY() {
return IDENTITY;
}

public int getIDENTITY_WORD() {
return IDENTITY_WORD;
}

public int getRIPEMD160() {
return RIPEMD160;
}

public int getRIPEMD160_WORD() {
return RIPEMD160_WORD;
}

public int getSHA256() {
return SHA256;
}

public int getSHA256_WORD() {
return SHA256_WORD;
}

public int getEC_RECOVER() {
return EC_RECOVER;
}

public int getEXT_CODE_SIZE() {
public int getExtCodeSize() {
return EXT_CODE_SIZE;
}

public int getEXT_CODE_COPY() {
public int getExtCodeCopy() {
return EXT_CODE_COPY;
}

public int getEXT_CODE_HASH() {
public int getExtCodeHash() {
return EXT_CODE_HASH;
}

public int getFREEZE() {
public int getFreeze() {
return FREEZE;
}

public int getUNFREEZE() {
public int getUnfreeze() {
return UNFREEZE;
}

public int getFREEZE_EXPIRE_TIME() {
public int getFreezeExpireTime() {
return FREEZE_EXPIRE_TIME;
}

public int getVOTE_WITNESS() {
public int getVoteWitness() {
return VOTE_WITNESS;
}

public int getWITHDRAW_REWARD() {
public int getWithdrawReward() {
return WITHDRAW_REWARD;
}
}
Loading

0 comments on commit c1d9dfd

Please sign in to comment.