Skip to content

Commit 68a3728

Browse files
committed
Merge remote-tracking branch 'upstream/release_v4.7.5' into feature/remove_redundant_ret
# Conflicts: # common/src/main/java/org/tron/core/Constant.java # framework/src/main/java/org/tron/core/db/Manager.java # framework/src/test/java/org/tron/core/db/ManagerTest.java
2 parents 271e3d0 + b089ca0 commit 68a3728

File tree

26 files changed

+234
-38
lines changed

26 files changed

+234
-38
lines changed

actuator/src/main/java/org/tron/core/utils/ProposalUtil.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.tron.core.utils;
22

3+
import static org.tron.core.Constant.CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE;
4+
import static org.tron.core.Constant.CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE;
35
import static org.tron.core.Constant.DYNAMIC_ENERGY_INCREASE_FACTOR_RANGE;
46
import static org.tron.core.Constant.DYNAMIC_ENERGY_MAX_FACTOR_RANGE;
57
import static org.tron.core.config.Parameter.ChainConstant.ONE_YEAR_BLOCK_NUMBERS;
@@ -748,6 +750,20 @@ public static void validator(DynamicPropertiesStore dynamicPropertiesStore,
748750
}
749751
break;
750752
}
753+
case MAX_CREATE_ACCOUNT_TX_SIZE: {
754+
if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_7_5)) {
755+
throw new ContractValidateException(
756+
"Bad chain parameter id [MAX_CREATE_ACCOUNT_TX_SIZE]");
757+
}
758+
if (value < CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE
759+
|| value > CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE) {
760+
throw new ContractValidateException(
761+
"This value[MAX_CREATE_ACCOUNT_TX_SIZE] is only allowed to be greater than or equal "
762+
+ "to " + CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE + " and less than or equal to "
763+
+ CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE + "!");
764+
}
765+
break;
766+
}
751767
default:
752768
break;
753769
}
@@ -824,7 +840,8 @@ public enum ProposalType { // current value, value range
824840
ALLOW_TVM_SHANGHAI(76), // 0, 1
825841
ALLOW_CANCEL_ALL_UNFREEZE_V2(77), // 0, 1
826842
MAX_DELEGATE_LOCK_PERIOD(78), // (86400, 10512000]
827-
ALLOW_OLD_REWARD_OPT(79); // 0, 1
843+
ALLOW_OLD_REWARD_OPT(79), // 0, 1
844+
MAX_CREATE_ACCOUNT_TX_SIZE(82); // [500, 10000]
828845

829846
private long code;
830847

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public class TransactionCapsule implements ProtoCapsule<Transaction> {
115115
@Getter
116116
@Setter
117117
private boolean isTransactionCreate = false;
118+
@Getter
119+
@Setter
120+
private boolean isInBlock = false;
118121

119122
public byte[] getOwnerAddress() {
120123
if (this.ownerAddress == null) {

chainbase/src/main/java/org/tron/core/db/BandwidthProcessor.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package org.tron.core.db;
22

3+
import static org.tron.core.Constant.PER_SIGN_LENGTH;
34
import static org.tron.core.config.Parameter.ChainConstant.TRX_PRECISION;
45
import static org.tron.protos.Protocol.Transaction.Contract.ContractType.ShieldedTransferContract;
56
import static org.tron.protos.Protocol.Transaction.Contract.ContractType.TransferAssetContract;
7+
import static org.tron.protos.contract.Common.ResourceCode.BANDWIDTH;
68

79
import com.google.protobuf.ByteString;
810
import java.util.HashMap;
@@ -19,13 +21,12 @@
1921
import org.tron.core.capsule.TransactionCapsule;
2022
import org.tron.core.exception.AccountResourceInsufficientException;
2123
import org.tron.core.exception.ContractValidateException;
24+
import org.tron.core.exception.TooBigTransactionException;
2225
import org.tron.core.exception.TooBigTransactionResultException;
2326
import org.tron.protos.Protocol.Transaction.Contract;
2427
import org.tron.protos.contract.AssetIssueContractOuterClass.TransferAssetContract;
2528
import org.tron.protos.contract.BalanceContract.TransferContract;
2629

27-
import static org.tron.protos.contract.Common.ResourceCode.BANDWIDTH;
28-
2930
@Slf4j(topic = "DB")
3031
public class BandwidthProcessor extends ResourceProcessor {
3132

@@ -95,7 +96,7 @@ public void updateUsage(AssetIssueCapsule assetIssueCapsule, long now) {
9596
@Override
9697
public void consume(TransactionCapsule trx, TransactionTrace trace)
9798
throws ContractValidateException, AccountResourceInsufficientException,
98-
TooBigTransactionResultException {
99+
TooBigTransactionResultException, TooBigTransactionException {
99100
List<Contract> contracts = trx.getInstance().getRawData().getContractList();
100101
long resultSizeWithMaxContractRet = trx.getResultSizeWithMaxContractRet();
101102
if (!trx.isInBlock() && resultSizeWithMaxContractRet >
@@ -134,6 +135,17 @@ public void consume(TransactionCapsule trx, TransactionTrace trace)
134135
}
135136
long now = chainBaseManager.getHeadSlot();
136137
if (contractCreateNewAccount(contract)) {
138+
if (!trx.isInBlock()) {
139+
long maxCreateAccountTxSize = dynamicPropertiesStore.getMaxCreateAccountTxSize();
140+
int signatureCount = trx.getInstance().getSignatureCount();
141+
long createAccountBytesSize = trx.getInstance().toBuilder().clearRet()
142+
.build().getSerializedSize() - (signatureCount * PER_SIGN_LENGTH);
143+
if (createAccountBytesSize > maxCreateAccountTxSize) {
144+
throw new TooBigTransactionException(String.format(
145+
"Too big new account transaction, TxId %s, the size is %d bytes, maxTxSize %d",
146+
trx.getTransactionId(), createAccountBytesSize, maxCreateAccountTxSize));
147+
}
148+
}
137149
consumeForCreateNewAccount(accountCapsule, bytesSize, now, trace);
138150
continue;
139151
}

chainbase/src/main/java/org/tron/core/db/ResourceProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.tron.core.exception.AccountResourceInsufficientException;
1212
import org.tron.core.exception.BalanceInsufficientException;
1313
import org.tron.core.exception.ContractValidateException;
14+
import org.tron.core.exception.TooBigTransactionException;
1415
import org.tron.core.exception.TooBigTransactionResultException;
1516
import org.tron.core.store.AccountStore;
1617
import org.tron.core.store.DynamicPropertiesStore;
@@ -35,7 +36,7 @@ protected ResourceProcessor(DynamicPropertiesStore dynamicPropertiesStore,
3536
}
3637

3738
abstract void consume(TransactionCapsule trx, TransactionTrace trace)
38-
throws ContractValidateException, AccountResourceInsufficientException, TooBigTransactionResultException;
39+
throws ContractValidateException, AccountResourceInsufficientException, TooBigTransactionResultException, TooBigTransactionException;
3940

4041
protected long increase(long lastUsage, long usage, long lastTime, long now) {
4142
return increase(lastUsage, usage, lastTime, now, windowSize);

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule>
219219

220220
private static final byte[] ALLOW_OLD_REWARD_OPT = "ALLOW_OLD_REWARD_OPT".getBytes();
221221

222+
private static final byte[] MAX_CREATE_ACCOUNT_TX_SIZE = "MAX_CREATE_ACCOUNT_TX_SIZE".getBytes();
223+
222224
@Autowired
223225
private DynamicPropertiesStore(@Value("properties") String dbName) {
224226
super(dbName);
@@ -2850,6 +2852,18 @@ public long getAllowOldRewardOpt() {
28502852
.orElse(CommonParameter.getInstance().getAllowOldRewardOpt());
28512853
}
28522854

2855+
public void saveMaxCreateAccountTxSize(long maxCreateAccountTxSize) {
2856+
this.put(MAX_CREATE_ACCOUNT_TX_SIZE,
2857+
new BytesCapsule(ByteArray.fromLong(maxCreateAccountTxSize)));
2858+
}
2859+
2860+
public long getMaxCreateAccountTxSize() {
2861+
return Optional.ofNullable(getUnchecked(MAX_CREATE_ACCOUNT_TX_SIZE))
2862+
.map(BytesCapsule::getData)
2863+
.map(ByteArray::toLong)
2864+
.orElse(CommonParameter.getInstance().getMaxCreateAccountTxSize());
2865+
}
2866+
28532867
private static class DynamicResourceProperties {
28542868

28552869
private static final byte[] ONE_DAY_NET_LIMIT = "ONE_DAY_NET_LIMIT".getBytes();

common/src/main/java/org/tron/common/parameter/CommonParameter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ public class CommonParameter {
666666
@Setter
667667
public long allowOldRewardOpt;
668668

669+
@Getter
670+
@Setter
671+
public long maxCreateAccountTxSize = 1000L;
672+
669673
private static double calcMaxTimeRatio() {
670674
//return max(2.0, min(5.0, 5 * 4.0 / max(Runtime.getRuntime().availableProcessors(), 1)));
671675
return 5.0;

common/src/main/java/org/tron/core/Constant.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ public class Constant {
2424

2525
// config for transaction
2626
public static final long TRANSACTION_MAX_BYTE_SIZE = 500 * 1_024L;
27+
public static final int CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE = 500;
28+
public static final int CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE = 10000;
2729
public static final long MAXIMUM_TIME_UNTIL_EXPIRATION = 24 * 60 * 60 * 1_000L; //one day
2830
public static final long TRANSACTION_DEFAULT_EXPIRATION_TIME = 60 * 1_000L; //60 seconds
2931
public static final long TRANSACTION_FEE_POOL_PERIOD = 1; //1 blocks
3032
// config for smart contract
3133
public static final long SUN_PER_ENERGY = 100; // 1 us = 100 SUN = 100 * 10^-6 TRX
3234
public static final long ENERGY_LIMIT_IN_CONSTANT_TX = 3_000_000L; // ref: 1 us = 1 energy
3335
public static final long MAX_RESULT_SIZE_IN_TX = 64; // max 8 * 8 items in result
36+
public static final long PER_SIGN_LENGTH = 65L;
3437
public static final long MAX_CONTRACT_RESULT_SIZE = 2L;
3538
public static final long PB_DEFAULT_ENERGY_LIMIT = 0L;
3639
public static final long CREATOR_DEFAULT_ENERGY_LIMIT = 1000 * 10_000L;

common/src/main/java/org/tron/core/config/Parameter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public enum ForkBlockVersionEnum {
2323
VERSION_4_7(26, 1596780000000L, 80),
2424
VERSION_4_7_1(27, 1596780000000L, 80),
2525
VERSION_4_7_2(28, 1596780000000L, 80),
26-
VERSION_4_7_4(29, 1596780000000L, 80);
26+
VERSION_4_7_4(29, 1596780000000L, 80),
27+
VERSION_4_7_5(30, 1596780000000L, 80);
2728
// if add a version, modify BLOCK_VERSION simultaneously
2829

2930
@Getter
@@ -72,7 +73,7 @@ public class ChainConstant {
7273
public static final int SINGLE_REPEAT = 1;
7374
public static final int BLOCK_FILLED_SLOTS_NUMBER = 128;
7475
public static final int MAX_FROZEN_NUMBER = 1;
75-
public static final int BLOCK_VERSION = 29;
76+
public static final int BLOCK_VERSION = 30;
7677
public static final long FROZEN_PERIOD = 86_400_000L;
7778
public static final long DELEGATE_PERIOD = 3 * 86_400_000L;
7879
public static final long TRX_PRECISION = 1000_000L;

consensus/src/main/java/org/tron/consensus/dpos/DposTask.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ private State produceBlock() {
9191
try {
9292
synchronized (dposService.getBlockHandle().getLock()) {
9393

94+
state = stateManager.getState();
95+
if (!State.OK.equals(state)) {
96+
return state;
97+
}
98+
9499
long slot = dposSlot.getSlot(System.currentTimeMillis() + 50);
95100
if (slot == 0) {
96101
return State.NOT_TIME_YET;

framework/src/main/java/org/tron/core/Wallet.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,11 @@ public Protocol.ChainParameters getChainParameters() {
13321332
.setValue(dbManager.getDynamicPropertiesStore().getAllowOldRewardOpt())
13331333
.build());
13341334

1335+
builder.addChainParameter(Protocol.ChainParameters.ChainParameter.newBuilder()
1336+
.setKey("getMaxCreateAccountTxSize")
1337+
.setValue(dbManager.getDynamicPropertiesStore().getMaxCreateAccountTxSize())
1338+
.build());
1339+
13351340
return builder.build();
13361341
}
13371342

framework/src/main/java/org/tron/core/consensus/ProposalService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ public static boolean process(Manager manager, ProposalCapsule proposalCapsule)
359359
manager.getDynamicPropertiesStore().saveAllowOldRewardOpt(entry.getValue());
360360
break;
361361
}
362+
case MAX_CREATE_ACCOUNT_TX_SIZE: {
363+
manager.getDynamicPropertiesStore().saveMaxCreateAccountTxSize(entry.getValue());
364+
break;
365+
}
362366
default:
363367
find = false;
364368
break;

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,9 @@ void validateCommon(TransactionCapsule transactionCapsule)
807807
}
808808
if (transactionCapsule.getData().length > Constant.TRANSACTION_MAX_BYTE_SIZE) {
809809
throw new TooBigTransactionException(String.format(
810-
"Too big transaction, the size is %d bytes", transactionCapsule.getData().length));
810+
"Too big transaction, TxId %s, the size is %d bytes, maxTxSize %d",
811+
transactionCapsule.getTransactionId(), transactionCapsule.getData().length,
812+
TRANSACTION_MAX_BYTE_SIZE));
811813
}
812814
long transactionExpiration = transactionCapsule.getExpiration();
813815
long headBlockTime = chainBaseManager.getHeadBlockTimeStamp();
@@ -978,7 +980,7 @@ public void consumeMemoFee(TransactionCapsule trx, TransactionTrace trace)
978980

979981
public void consumeBandwidth(TransactionCapsule trx, TransactionTrace trace)
980982
throws ContractValidateException, AccountResourceInsufficientException,
981-
TooBigTransactionResultException {
983+
TooBigTransactionResultException, TooBigTransactionException {
982984
BandwidthProcessor processor = new BandwidthProcessor(chainBaseManager);
983985
processor.consume(trx, trace);
984986
}
@@ -1440,6 +1442,7 @@ public TransactionInfo processTransaction(final TransactionCapsule trxCap, Block
14401442

14411443
if (Objects.nonNull(blockCap)) {
14421444
chainBaseManager.getBalanceTraceStore().initCurrentTransactionBalanceTrace(trxCap);
1445+
trxCap.setInBlock(true);
14431446
}
14441447

14451448
validateTapos(trxCap);

framework/src/main/java/org/tron/core/net/messagehandler/BlockMsgHandler.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ public void processMessage(PeerConnection peer, TronMessage msg) throws P2pExcep
6161
BlockMessage blockMessage = (BlockMessage) msg;
6262
BlockId blockId = blockMessage.getBlockId();
6363

64+
BlockCapsule blockCapsule = blockMessage.getBlockCapsule();
65+
if (blockCapsule.getInstance().getSerializedSize() > maxBlockSize) {
66+
logger.error("Receive bad block {} from peer {}, block size over limit",
67+
blockMessage.getBlockId(), peer.getInetSocketAddress());
68+
throw new P2pException(TypeEnum.BAD_MESSAGE, "block size over limit");
69+
}
70+
long gap = blockCapsule.getTimeStamp() - System.currentTimeMillis();
71+
if (gap >= BLOCK_PRODUCED_INTERVAL) {
72+
logger.error("Receive bad block {} from peer {}, block time error",
73+
blockMessage.getBlockId(), peer.getInetSocketAddress());
74+
throw new P2pException(TypeEnum.BAD_MESSAGE, "block time error");
75+
}
6476
if (!fastForward && !peer.isRelayPeer()) {
6577
check(peer, blockMessage);
6678
}
@@ -109,18 +121,6 @@ private void check(PeerConnection peer, BlockMessage msg) throws P2pException {
109121
msg.getBlockId(), peer.getInetSocketAddress());
110122
throw new P2pException(TypeEnum.BAD_MESSAGE, "no request");
111123
}
112-
BlockCapsule blockCapsule = msg.getBlockCapsule();
113-
if (blockCapsule.getInstance().getSerializedSize() > maxBlockSize) {
114-
logger.error("Receive bad block {} from peer {}, block size over limit",
115-
msg.getBlockId(), peer.getInetSocketAddress());
116-
throw new P2pException(TypeEnum.BAD_MESSAGE, "block size over limit");
117-
}
118-
long gap = blockCapsule.getTimeStamp() - System.currentTimeMillis();
119-
if (gap >= BLOCK_PRODUCED_INTERVAL) {
120-
logger.error("Receive bad block {} from peer {}, block time error",
121-
msg.getBlockId(), peer.getInetSocketAddress());
122-
throw new P2pException(TypeEnum.BAD_MESSAGE, "block time error");
123-
}
124124
}
125125

126126
private void processBlock(PeerConnection peer, BlockCapsule block) throws P2pException {
@@ -150,14 +150,7 @@ private void processBlock(PeerConnection peer, BlockCapsule block) throws P2pExc
150150

151151
try {
152152
tronNetDelegate.processBlock(block, false);
153-
154153
witnessProductBlockService.validWitnessProductTwoBlock(block);
155-
156-
tronNetDelegate.getActivePeer().forEach(p -> {
157-
if (p.getAdvInvReceive().getIfPresent(blockId) != null) {
158-
p.setBlockBothHave(blockId);
159-
}
160-
});
161154
} catch (Exception e) {
162155
logger.warn("Process adv block {} from peer {} failed. reason: {}",
163156
blockId, peer.getInetAddress(), e.getMessage());

framework/src/main/java/org/tron/core/net/service/adv/AdvService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ public void broadcast(Message msg) {
200200
logger.info("Ready to broadcast block {}", blockMsg.getBlockId().getString());
201201
blockMsg.getBlockCapsule().getTransactions().forEach(transactionCapsule -> {
202202
Sha256Hash tid = transactionCapsule.getTransactionId();
203-
invToSpread.remove(tid);
204203
trxCache.put(new Item(tid, InventoryType.TRX),
205204
new TransactionMessage(transactionCapsule.getInstance()));
206205
});

framework/src/main/java/org/tron/core/net/service/fetchblock/FetchBlockService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ public void fetchBlock(List<Sha256Hash> sha256HashList, PeerConnection peer) {
7171
sha256HashList.stream().filter(sha256Hash -> new BlockCapsule.BlockId(sha256Hash).getNum()
7272
== chainBaseManager.getHeadBlockNum() + 1)
7373
.findFirst().ifPresent(sha256Hash -> {
74-
fetchBlockInfo = new FetchBlockInfo(sha256Hash, peer, System.currentTimeMillis());
74+
long now = System.currentTimeMillis();
75+
fetchBlockInfo = new FetchBlockInfo(sha256Hash, peer, now);
7576
logger.info("Set fetchBlockInfo, block: {}, peer: {}, time: {}", sha256Hash,
76-
fetchBlockInfo.getPeer().getInetAddress(), fetchBlockInfo.getTime());
77+
peer.getInetAddress(), now);
7778
});
7879
}
7980

framework/src/main/java/org/tron/core/net/service/sync/SyncService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,9 @@ private void processSyncBlock(BlockCapsule block, PeerConnection peerConnection)
321321
}
322322

323323
for (PeerConnection peer : tronNetDelegate.getActivePeer()) {
324-
if (blockId.equals(peer.getSyncBlockToFetch().peek())) {
325-
peer.getSyncBlockToFetch().pop();
324+
BlockId bid = peer.getSyncBlockToFetch().peek();
325+
if (blockId.equals(bid)) {
326+
peer.getSyncBlockToFetch().remove(bid);
326327
if (flag) {
327328
peer.setBlockBothHave(blockId);
328329
if (peer.getSyncBlockToFetch().isEmpty() && peer.isFetchAble()) {

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.7.3.1-78-ge84a9e778";
66
public static final String VERSION_CODE = "18260";
7-
private static final String VERSION = "4.7.4";
7+
private static final String VERSION = "4.7.5";
88

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

framework/src/test/java/org/tron/common/runtime/vm/BandWidthRuntimeOutOfTimeTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.tron.core.exception.AccountResourceInsufficientException;
3434
import org.tron.core.exception.ContractExeException;
3535
import org.tron.core.exception.ContractValidateException;
36+
import org.tron.core.exception.TooBigTransactionException;
3637
import org.tron.core.exception.TooBigTransactionResultException;
3738
import org.tron.core.exception.TronException;
3839
import org.tron.core.exception.VMIllegalException;
@@ -154,7 +155,8 @@ public void testSuccess() {
154155

155156
private byte[] createContract()
156157
throws ContractValidateException, AccountResourceInsufficientException,
157-
TooBigTransactionResultException, ContractExeException, VMIllegalException {
158+
TooBigTransactionResultException, ContractExeException, VMIllegalException,
159+
TooBigTransactionException {
158160
AccountCapsule owner = dbManager.getAccountStore()
159161
.get(Commons.decodeFromBase58Check(OwnerAddress));
160162
long energy = owner.getEnergyUsage();

framework/src/test/java/org/tron/common/runtime/vm/BandWidthRuntimeOutOfTimeWithCheckTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.tron.core.exception.ContractExeException;
3535
import org.tron.core.exception.ContractValidateException;
3636
import org.tron.core.exception.ReceiptCheckErrException;
37+
import org.tron.core.exception.TooBigTransactionException;
3738
import org.tron.core.exception.TooBigTransactionResultException;
3839
import org.tron.core.exception.TronException;
3940
import org.tron.core.exception.VMIllegalException;
@@ -156,7 +157,8 @@ public void testSuccess() {
156157

157158
private byte[] createContract()
158159
throws ContractValidateException, AccountResourceInsufficientException,
159-
TooBigTransactionResultException, ContractExeException, VMIllegalException {
160+
TooBigTransactionResultException, ContractExeException, VMIllegalException,
161+
TooBigTransactionException {
160162
AccountCapsule owner = dbManager.getAccountStore()
161163
.get(Commons.decodeFromBase58Check(OwnerAddress));
162164
long energy = owner.getEnergyUsage();

0 commit comments

Comments
 (0)