Skip to content

Commit 4412177

Browse files
committed
Merge branch 'refs/heads/release_v4.7.5' into feature/implement-TIP653
# Conflicts: # actuator/src/main/java/org/tron/core/utils/ProposalUtil.java # chainbase/src/main/java/org/tron/core/store/DynamicPropertiesStore.java # common/src/main/java/org/tron/common/parameter/CommonParameter.java # framework/src/main/java/org/tron/core/Wallet.java # framework/src/main/java/org/tron/core/consensus/ProposalService.java
2 parents 3aa94e0 + fd3d8f6 commit 4412177

File tree

24 files changed

+227
-35
lines changed

24 files changed

+227
-35
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;
@@ -763,6 +765,20 @@ public static void validator(DynamicPropertiesStore dynamicPropertiesStore,
763765
}
764766
break;
765767
}
768+
case MAX_CREATE_ACCOUNT_TX_SIZE: {
769+
if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_7_5)) {
770+
throw new ContractValidateException(
771+
"Bad chain parameter id [MAX_CREATE_ACCOUNT_TX_SIZE]");
772+
}
773+
if (value < CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE
774+
|| value > CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE) {
775+
throw new ContractValidateException(
776+
"This value[MAX_CREATE_ACCOUNT_TX_SIZE] is only allowed to be greater than or equal "
777+
+ "to " + CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE + " and less than or equal to "
778+
+ CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE + "!");
779+
}
780+
break;
781+
}
766782
default:
767783
break;
768784
}
@@ -840,7 +856,8 @@ public enum ProposalType { // current value, value range
840856
ALLOW_CANCEL_ALL_UNFREEZE_V2(77), // 0, 1
841857
MAX_DELEGATE_LOCK_PERIOD(78), // (86400, 10512000]
842858
ALLOW_OLD_REWARD_OPT(79), // 0, 1
843-
ALLOW_ENERGY_ADJUSTMENT(81); // 0, 1
859+
ALLOW_ENERGY_ADJUSTMENT(81), // 0, 1
860+
MAX_CREATE_ACCOUNT_TX_SIZE(82); // [500, 10000]
844861

845862
private long code;
846863

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

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

118121
public byte[] getOwnerAddress() {
119122
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
if (trx.getResultSerializedSize() > Constant.MAX_RESULT_SIZE_IN_TX * contracts.size()) {
101102
throw new TooBigTransactionResultException();
@@ -127,6 +128,17 @@ public void consume(TransactionCapsule trx, TransactionTrace trace)
127128
}
128129
long now = chainBaseManager.getHeadSlot();
129130
if (contractCreateNewAccount(contract)) {
131+
if (!trx.isInBlock()) {
132+
long maxCreateAccountTxSize = dynamicPropertiesStore.getMaxCreateAccountTxSize();
133+
int signatureCount = trx.getInstance().getSignatureCount();
134+
long createAccountBytesSize = trx.getInstance().toBuilder().clearRet()
135+
.build().getSerializedSize() - (signatureCount * PER_SIGN_LENGTH);
136+
if (createAccountBytesSize > maxCreateAccountTxSize) {
137+
throw new TooBigTransactionException(String.format(
138+
"Too big new account transaction, TxId %s, the size is %d bytes, maxTxSize %d",
139+
trx.getTransactionId(), createAccountBytesSize, maxCreateAccountTxSize));
140+
}
141+
}
130142
consumeForCreateNewAccount(accountCapsule, bytesSize, now, trace);
131143
continue;
132144
}

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
@@ -221,6 +221,8 @@ public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule>
221221

222222
private static final byte[] ALLOW_ENERGY_ADJUSTMENT = "ALLOW_ENERGY_ADJUSTMENT".getBytes();
223223

224+
private static final byte[] MAX_CREATE_ACCOUNT_TX_SIZE = "MAX_CREATE_ACCOUNT_TX_SIZE".getBytes();
225+
224226
@Autowired
225227
private DynamicPropertiesStore(@Value("properties") String dbName) {
226228
super(dbName);
@@ -2863,6 +2865,18 @@ public long getAllowEnergyAdjustment() {
28632865
.orElse(CommonParameter.getInstance().getAllowEnergyAdjustment());
28642866
}
28652867

2868+
public void saveMaxCreateAccountTxSize(long maxCreateAccountTxSize) {
2869+
this.put(MAX_CREATE_ACCOUNT_TX_SIZE,
2870+
new BytesCapsule(ByteArray.fromLong(maxCreateAccountTxSize)));
2871+
}
2872+
2873+
public long getMaxCreateAccountTxSize() {
2874+
return Optional.ofNullable(getUnchecked(MAX_CREATE_ACCOUNT_TX_SIZE))
2875+
.map(BytesCapsule::getData)
2876+
.map(ByteArray::toLong)
2877+
.orElse(CommonParameter.getInstance().getMaxCreateAccountTxSize());
2878+
}
2879+
28662880
private static class DynamicResourceProperties {
28672881

28682882
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
@@ -670,6 +670,10 @@ public class CommonParameter {
670670
@Setter
671671
public long allowEnergyAdjustment;
672672

673+
@Getter
674+
@Setter
675+
public long maxCreateAccountTxSize = 1000L;
676+
673677
private static double calcMaxTimeRatio() {
674678
//return max(2.0, min(5.0, 5 * 4.0 / max(Runtime.getRuntime().availableProcessors(), 1)));
675679
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
@@ -26,13 +26,16 @@ public class Constant {
2626

2727
// config for transaction
2828
public static final long TRANSACTION_MAX_BYTE_SIZE = 500 * 1_024L;
29+
public static final int CREATE_ACCOUNT_TRANSACTION_MIN_BYTE_SIZE = 500;
30+
public static final int CREATE_ACCOUNT_TRANSACTION_MAX_BYTE_SIZE = 10000;
2931
public static final long MAXIMUM_TIME_UNTIL_EXPIRATION = 24 * 60 * 60 * 1_000L; //one day
3032
public static final long TRANSACTION_DEFAULT_EXPIRATION_TIME = 60 * 1_000L; //60 seconds
3133
public static final long TRANSACTION_FEE_POOL_PERIOD = 1; //1 blocks
3234
// config for smart contract
3335
public static final long SUN_PER_ENERGY = 100; // 1 us = 100 SUN = 100 * 10^-6 TRX
3436
public static final long ENERGY_LIMIT_IN_CONSTANT_TX = 3_000_000L; // ref: 1 us = 1 energy
3537
public static final long MAX_RESULT_SIZE_IN_TX = 64; // max 8 * 8 items in result
38+
public static final long PER_SIGN_LENGTH = 65L;
3639
public static final long PB_DEFAULT_ENERGY_LIMIT = 0L;
3740
public static final long CREATOR_DEFAULT_ENERGY_LIMIT = 1000 * 10_000L;
3841

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
@@ -1339,6 +1339,11 @@ public Protocol.ChainParameters getChainParameters() {
13391339
.setValue(dbManager.getDynamicPropertiesStore().getAllowEnergyAdjustment())
13401340
.build());
13411341

1342+
builder.addChainParameter(Protocol.ChainParameters.ChainParameter.newBuilder()
1343+
.setKey("getMaxCreateAccountTxSize")
1344+
.setValue(dbManager.getDynamicPropertiesStore().getMaxCreateAccountTxSize())
1345+
.build());
1346+
13421347
return builder.build();
13431348
}
13441349

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ public static boolean process(Manager manager, ProposalCapsule proposalCapsule)
363363
manager.getDynamicPropertiesStore().saveAllowEnergyAdjustment(entry.getValue());
364364
break;
365365
}
366+
case MAX_CREATE_ACCOUNT_TX_SIZE: {
367+
manager.getDynamicPropertiesStore().saveMaxCreateAccountTxSize(entry.getValue());
368+
break;
369+
}
366370
default:
367371
find = false;
368372
break;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ public void consumeMemoFee(TransactionCapsule trx, TransactionTrace trace)
966966

967967
public void consumeBandwidth(TransactionCapsule trx, TransactionTrace trace)
968968
throws ContractValidateException, AccountResourceInsufficientException,
969-
TooBigTransactionResultException {
969+
TooBigTransactionResultException, TooBigTransactionException {
970970
BandwidthProcessor processor = new BandwidthProcessor(chainBaseManager);
971971
processor.consume(trx, trace);
972972
}
@@ -1422,6 +1422,7 @@ public TransactionInfo processTransaction(final TransactionCapsule trxCap, Block
14221422

14231423
if (Objects.nonNull(blockCap)) {
14241424
chainBaseManager.getBalanceTraceStore().initCurrentTransactionBalanceTrace(trxCap);
1425+
trxCap.setInBlock(true);
14251426
}
14261427

14271428
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();

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.tron.core.exception.AccountResourceInsufficientException;
3636
import org.tron.core.exception.ContractExeException;
3737
import org.tron.core.exception.ContractValidateException;
38+
import org.tron.core.exception.TooBigTransactionException;
3839
import org.tron.core.exception.TooBigTransactionResultException;
3940
import org.tron.core.exception.TronException;
4041
import org.tron.core.exception.VMIllegalException;
@@ -186,7 +187,8 @@ public void testSuccessNoBandd() {
186187

187188
private byte[] createContract()
188189
throws ContractValidateException, AccountResourceInsufficientException,
189-
TooBigTransactionResultException, ContractExeException, VMIllegalException {
190+
TooBigTransactionResultException, ContractExeException, VMIllegalException,
191+
TooBigTransactionException {
190192
AccountCapsule owner = dbManager.getAccountStore()
191193
.get(Commons.decodeFromBase58Check(OwnerAddress));
192194
long energy = owner.getEnergyUsage();

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

Lines changed: 2 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;
@@ -198,7 +199,7 @@ public void testSuccessNoBandWidth() {
198199
private byte[] createContract()
199200
throws ContractValidateException, AccountResourceInsufficientException,
200201
TooBigTransactionResultException, ContractExeException, ReceiptCheckErrException,
201-
VMIllegalException {
202+
VMIllegalException, TooBigTransactionException {
202203
AccountCapsule owner = dbManager.getAccountStore()
203204
.get(Commons.decodeFromBase58Check(OwnerAddress));
204205
long energy = owner.getEnergyUsage();

0 commit comments

Comments
 (0)