Skip to content

Commit f6dd0d9

Browse files
authored
Merge pull request #5181 from halibobo1205/feat/merge_master
merge master to release_v4.7.2
2 parents 58ca710 + 5112ab5 commit f6dd0d9

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

chainbase/src/main/java/org/tron/core/capsule/ReceiptCapsule.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ public void payEnergyBill(DynamicPropertiesStore dynamicPropertiesStore,
192192
AccountCapsule caller,
193193
long percent, long originEnergyLimit, EnergyProcessor energyProcessor, long now)
194194
throws BalanceInsufficientException {
195+
196+
// Reset origin energy usage here! Because after stake 2.0, this field are reused for
197+
// recording pre-merge frozen energy for origin account. If total energy usage is zero, this
198+
// field will be a dirty record.
199+
this.setOriginEnergyUsage(0);
200+
195201
if (receipt.getEnergyUsageTotal() <= 0) {
196202
return;
197203
}

chainbase/src/main/java/org/tron/core/store/TransactionRetStore.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.tron.core.db.TransactionStore;
1515
import org.tron.core.db.TronStoreWithRevoking;
1616
import org.tron.core.exception.BadItemException;
17+
import org.tron.protos.Protocol;
1718
import org.tron.protos.Protocol.TransactionInfo;
1819

1920
@Slf4j(topic = "DB")
@@ -54,6 +55,17 @@ public TransactionInfoCapsule getTransactionInfo(byte[] key) throws BadItemExcep
5455
ByteString id = ByteString.copyFrom(key);
5556
for (TransactionInfo transactionResultInfo : result.getInstance().getTransactioninfoList()) {
5657
if (transactionResultInfo.getId().equals(id)) {
58+
Protocol.ResourceReceipt receipt = transactionResultInfo.getReceipt();
59+
// If query a result with dirty origin usage in receipt, we just reset it.
60+
if (receipt.getEnergyUsageTotal() == 0 && receipt.getOriginEnergyUsage() > 0) {
61+
transactionResultInfo =
62+
transactionResultInfo.toBuilder()
63+
.setReceipt(
64+
receipt.toBuilder()
65+
.clearOriginEnergyUsage()
66+
.build())
67+
.build();
68+
}
5769
return new TransactionInfoCapsule(transactionResultInfo);
5870
}
5971
}

framework/src/main/java/org/tron/core/services/RpcApiService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private void callContract(TriggerSmartContract request,
298298
retBuilder.setResult(false).setCode(response_code.CONTRACT_EXE_ERROR)
299299
.setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));
300300
trxExtBuilder.setResult(retBuilder);
301-
logger.warn("When run constant call in VM, failed for reason: " + e.getMessage());
301+
logger.warn("When run constant call in VM, have RuntimeException: " + e.getMessage());
302302
} catch (Exception e) {
303303
retBuilder.setResult(false).setCode(response_code.OTHER_ERROR)
304304
.setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));
@@ -1886,7 +1886,7 @@ private void callContract(TriggerSmartContract request,
18861886
retBuilder.setResult(false).setCode(response_code.CONTRACT_EXE_ERROR)
18871887
.setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));
18881888
trxExtBuilder.setResult(retBuilder);
1889-
logger.warn("When run constant call in VM, failed for reason: " + e.getMessage());
1889+
logger.warn("When run constant call in VM, have Runtime Exception: " + e.getMessage());
18901890
} catch (Exception e) {
18911891
retBuilder.setResult(false).setCode(response_code.OTHER_ERROR)
18921892
.setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
public class Version {
44

5-
public static final String VERSION_NAME = "GreatVoyage-v4.7.0.1-75-g36fc5063e9";
6-
public static final String VERSION_CODE = "17673";
5+
public static final String VERSION_NAME = "GreatVoyage-v4.7.1-11-ge5e347de7";
6+
public static final String VERSION_CODE = "17686";
77
private static final String VERSION = "4.7.2";
88

99
public static String getVersion() {

0 commit comments

Comments
 (0)