Skip to content

Commit e06abd1

Browse files
authored
Merge pull request tronprotocol#4462 from tronprotocol/release_v4.5.1
merge release v4.5.1 to master
2 parents 66e69f0 + 0d58fd3 commit e06abd1

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

actuator/src/main/java/org/tron/core/actuator/VMActuator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ private void create()
384384
.createProgramInvoke(TrxType.TRX_CONTRACT_CREATION_TYPE, executorType, trx,
385385
tokenValue, tokenId, blockCap.getInstance(), rootRepository, vmStartInUs,
386386
vmShouldEndInUs, energyLimit);
387+
if (isConstantCall) {
388+
programInvoke.setConstantCall();
389+
}
387390
this.program = new Program(ops, contractAddress, programInvoke, rootInternalTx);
388391
if (VMConfig.allowTvmCompatibleEvm()) {
389392
this.program.setContractVersion(1);

actuator/src/main/java/org/tron/core/vm/program/Program.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,14 @@ public void setNonce(long nonceValue) {
170170
}
171171

172172
public ProgramPrecompile getProgramPrecompile() {
173+
if (isConstantCall()) {
174+
if (programPrecompile == null) {
175+
programPrecompile = ProgramPrecompile.compile(ops);
176+
}
177+
return programPrecompile;
178+
}
173179
if (programPrecompile == null) {
174-
Key key = getCodeHashKey();
180+
Key key = getJumpDestAnalysisCacheKey();
175181
if (programPrecompileLRUMap.containsKey(key)) {
176182
programPrecompile = programPrecompileLRUMap.get(key);
177183
} else {
@@ -1056,9 +1062,8 @@ public byte[] getCodeHash() {
10561062
return codeHash;
10571063
}
10581064

1059-
private Key getCodeHashKey() {
1060-
byte[] codeHash = getCodeHash();
1061-
return Key.create(codeHash);
1065+
private Key getJumpDestAnalysisCacheKey() {
1066+
return Key.create(ByteUtil.merge(codeAddress, getCodeHash()));
10621067
}
10631068

10641069
public byte[] getContextAddress() {

framework/src/main/java/org/tron/program/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class Version {
44

55
public static final String VERSION_NAME = "GreatVoyage-v4.4.6-241-g7045f0659";
66
public static final String VERSION_CODE = "16928";
7-
private static final String VERSION = "4.5.0";
7+
private static final String VERSION = "4.5.1";
88

99
public static String getVersion() {
1010
return VERSION;

0 commit comments

Comments
 (0)