33import static java .lang .Math .max ;
44import static java .lang .Math .min ;
55import static org .apache .commons .lang3 .ArrayUtils .getLength ;
6- import static org .apache .commons .lang3 .ArrayUtils .isEmpty ;
76import static org .apache .commons .lang3 .ArrayUtils .isNotEmpty ;
87import static org .tron .common .runtime .utils .MUtil .convertToTronAddress ;
98import static org .tron .common .runtime .utils .MUtil .transfer ;
3130import org .tron .common .runtime .config .VMConfig ;
3231import org .tron .common .runtime .vm .DataWord ;
3332import org .tron .common .runtime .vm .EnergyCost ;
34- import org .tron .common .runtime .vm .PrecompiledContracts ;
3533import org .tron .common .runtime .vm .VM ;
3634import org .tron .common .runtime .vm .program .InternalTransaction ;
3735import org .tron .common .runtime .vm .program .InternalTransaction .ExecutorType ;
5553import org .tron .core .config .Parameter .ChainConstant ;
5654import org .tron .core .config .args .Args ;
5755import org .tron .core .db .EnergyProcessor ;
58- import org .tron .core .db .StorageMarket ;
5956import org .tron .core .db .TransactionTrace ;
60- import org .tron .core .exception .BadTransactionException ;
6157import org .tron .core .exception .ContractExeException ;
6258import org .tron .core .exception .ContractValidateException ;
6359import org .tron .core .exception .VMIllegalException ;
@@ -310,7 +306,7 @@ private void create()
310306 }
311307 SmartContract newSmartContract = contract .getNewContract ();
312308 if (!contract .getOwnerAddress ().equals (newSmartContract .getOriginAddress ())) {
313- logger .error ("OwnerAddress not equals OriginAddress" );
309+ logger .info ("OwnerAddress not equals OriginAddress" );
314310 throw new VMIllegalException ("OwnerAddress is not equals OriginAddress" );
315311 }
316312 byte [] code = newSmartContract .getBytecode ().toByteArray ();
@@ -343,7 +339,7 @@ private void create()
343339 .getAccount (newSmartContract .getOriginAddress ().toByteArray ());
344340
345341 long MAX_CPU_TIME_OF_ONE_TX = deposit .getDbManager ().getDynamicPropertiesStore ()
346- .getMaxCpuTimeOfOneTX () * 1000 ;
342+ .getMaxCpuTimeOfOneTx () * 1000 ;
347343
348344 long thisTxCPULimitInUs = (long ) (MAX_CPU_TIME_OF_ONE_TX * getThisTxCPULimitInUsRatio ());
349345
@@ -352,7 +348,7 @@ private void create()
352348
353349 long feeLimit = trx .getRawData ().getFeeLimit ();
354350 if (feeLimit < 0 || feeLimit > VMConfig .MAX_FEE_LIMIT ) {
355- logger .warn ("invalid feeLimit {}" , feeLimit );
351+ logger .info ("invalid feeLimit {}" , feeLimit );
356352 throw new ContractValidateException (
357353 "feeLimit must be >= 0 and <= " + VMConfig .MAX_FEE_LIMIT );
358354 }
@@ -369,7 +365,7 @@ private void create()
369365 this .program .setRootTransactionId (new TransactionCapsule (trx ).getTransactionId ().getBytes ());
370366 this .program .setRootCallConstant (isCallConstant ());
371367 } catch (Exception e ) {
372- logger .error (e .getMessage ());
368+ logger .info (e .getMessage ());
373369 throw new ContractValidateException (e .getMessage ());
374370 }
375371
@@ -397,7 +393,7 @@ private void call()
397393 throws ContractValidateException {
398394
399395 if (!deposit .getDbManager ().getDynamicPropertiesStore ().supportVM ()) {
400- logger .error ("vm work is off, need to be opened by the committee" );
396+ logger .info ("vm work is off, need to be opened by the committee" );
401397 throw new ContractValidateException ("VM work is off, need to be opened by the committee" );
402398 }
403399
@@ -414,7 +410,7 @@ private void call()
414410
415411 ContractCapsule deployedContract = this .deposit .getContract (contractAddress );
416412 if (null == deployedContract ) {
417- logger .error ("No contract or not a smart contract" );
413+ logger .info ("No contract or not a smart contract" );
418414 throw new ContractValidateException ("No contract or not a smart contract" );
419415 }
420416 byte [] code = this .deposit .getCode (contractAddress );
@@ -426,7 +422,7 @@ private void call()
426422 .getOriginAddress ().toByteArray ());
427423
428424 long MAX_CPU_TIME_OF_ONE_TX = deposit .getDbManager ().getDynamicPropertiesStore ()
429- .getMaxCpuTimeOfOneTX () * 1000 ;
425+ .getMaxCpuTimeOfOneTx () * 1000 ;
430426 long thisTxCPULimitInUs =
431427 (long ) (MAX_CPU_TIME_OF_ONE_TX * getThisTxCPULimitInUsRatio ());
432428
@@ -435,7 +431,7 @@ private void call()
435431
436432 long feeLimit = trx .getRawData ().getFeeLimit ();
437433 if (feeLimit < 0 || feeLimit > VMConfig .MAX_FEE_LIMIT ) {
438- logger .warn ("invalid feeLimit {}" , feeLimit );
434+ logger .info ("invalid feeLimit {}" , feeLimit );
439435 throw new ContractValidateException (
440436 "feeLimit must be >= 0 and <= " + VMConfig .MAX_FEE_LIMIT );
441437 }
@@ -534,26 +530,26 @@ public void go() {
534530 result = program .getResult ();
535531 result .setException (e );
536532 runtimeError = result .getException ().getMessage ();
537- logger .error ("JVMStackOverFlowException: {}" , result .getException ().getMessage ());
533+ logger .info ("JVMStackOverFlowException: {}" , result .getException ().getMessage ());
538534 } catch (OutOfResourceException e ) {
539535 program .spendAllEnergy ();
540536 result = program .getResult ();
541537 result .setException (e );
542538 runtimeError = result .getException ().getMessage ();
543- logger .error ("timeout: {}" , result .getException ().getMessage ());
539+ logger .info ("timeout: {}" , result .getException ().getMessage ());
544540 } catch (ContractValidateException e ) {
545- logger .error ("when check constant, {}" , e .getMessage ());
541+ logger .info ("when check constant, {}" , e .getMessage ());
546542 }catch (Throwable e ) {
547543 program .spendAllEnergy ();
548544 result = program .getResult ();
549545 if (Objects .isNull (result .getException ())) {
550- logger .error (e .getMessage (), e );
546+ logger .info (e .getMessage (), e );
551547 result .setException (new RuntimeException ("Unknown Throwable" ));
552548 }
553549 if (StringUtils .isEmpty (runtimeError )) {
554550 runtimeError = result .getException ().getMessage ();
555551 }
556- logger .error ("runtime error is :{}" , result .getException ().getMessage ());
552+ logger .info ("runtime error is :{}" , result .getException ().getMessage ());
557553 }
558554 trace .setBill (result .getEnergyUsed ());
559555 }
@@ -576,7 +572,7 @@ public boolean isCallConstant() throws ContractValidateException {
576572 ContractCapsule contract = deposit
577573 .getContract (triggerContractFromTransaction .getContractAddress ().toByteArray ());
578574 if (contract == null ) {
579- logger .error ("contract: {} is not in contract store" , Wallet
575+ logger .info ("contract: {} is not in contract store" , Wallet
580576 .encode58Check (triggerContractFromTransaction .getContractAddress ().toByteArray ()));
581577 throw new ContractValidateException ("contract: " + Wallet
582578 .encode58Check (triggerContractFromTransaction .getContractAddress ().toByteArray ())
0 commit comments