Skip to content

Commit 84027de

Browse files
committed
feature(block ): Optimize pack transaction into block.
1.retry exec transaction when pack block when the transaction is executed for the first time it does not time out, but probably time out due to gc.
1 parent 63517dd commit 84027de

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

framework/src/main/java/org/tron/core/db/Manager.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,23 +1305,23 @@ public TransactionInfo processTransaction(final TransactionCapsule trxCap, Block
13051305

13061306
if (Objects.nonNull(blockCap)) {
13071307
trace.setResult();
1308+
if (trace.checkNeedRetry()) {
1309+
String txId = Hex.toHexString(trxCap.getTransactionId().getBytes());
1310+
logger.info("Retry for tx id: {}", txId);
1311+
trace.init(blockCap, eventPluginLoaded);
1312+
trace.checkIsConstant();
1313+
trace.exec();
1314+
trace.setResult();
1315+
logger.info("Retry result when push:{}, for tx id: {}, tx resultCode in receipt: {}",
1316+
blockCap.hasWitnessSignature(), txId, trace.getReceipt().getResult());
1317+
}
13081318
if (blockCap.hasWitnessSignature()) {
1309-
if (trace.checkNeedRetry()) {
1310-
String txId = Hex.toHexString(trxCap.getTransactionId().getBytes());
1311-
logger.info("Retry for tx id: {}", txId);
1312-
trace.init(blockCap, eventPluginLoaded);
1313-
trace.checkIsConstant();
1314-
trace.exec();
1315-
trace.setResult();
1316-
logger.info("Retry result for tx id: {}, tx resultCode in receipt: {}",
1317-
txId, trace.getReceipt().getResult());
1318-
}
13191319
trace.check();
13201320
}
13211321
}
13221322

13231323
trace.finalization();
1324-
if (Objects.nonNull(blockCap) && getDynamicPropertiesStore().supportVM()) {
1324+
if (getDynamicPropertiesStore().supportVM()) {
13251325
trxCap.setResult(trace.getTransactionContext());
13261326
}
13271327
chainBaseManager.getTransactionStore().put(trxCap.getTransactionId().getBytes(), trxCap);

0 commit comments

Comments
 (0)