use of org.aion.zero.impl.config.CfgFork in project aion by aionnetwork.
the class BulkExecutor method executeNextBatchOfPrecompiledTransactions.
/**
* Returns the execution summaries of the next batch of precompiled contract call transactions
* to be run. This batch of transactions begins with the transaction at index {@code
* currentIndex} in the provided list of transactions and includes all subsequent transactions
* that are precompiled-bound.
*/
private static List<AionTxExecSummary> executeNextBatchOfPrecompiledTransactions(RepositoryCache repository, List<AionTransaction> transactions, int currentIndex, long blockNumber, AionAddress blockCoinbase, PostExecutionWork postExecutionWork, Logger logger, boolean checkBlockEnergyLimit, boolean incrementSenderNonce, boolean isLocalCall, long blockRemainingEnergy) {
// Grab the next batch of precompiled contract call transactions to execute.
List<AionTransaction> precompiledTransactionsToExecute = fetchNextBatchOfPrecompiledContractCallTransactions(transactions, currentIndex);
AionTransaction[] precompiledTransactions = new AionTransaction[precompiledTransactionsToExecute.size()];
precompiledTransactionsToExecute.toArray(precompiledTransactions);
CfgFork cfg = new CfgFork();
String forkProperty = cfg.getProperties().getProperty("fork0.3.2");
boolean fork032Enabled = (forkProperty != null) && (blockNumber >= Long.valueOf(forkProperty));
// Execute the precompiled contract call transactions.
return PrecompiledTransactionExecutor.executeTransactions(repository, blockNumber, blockCoinbase, precompiledTransactions, postExecutionWork, logger, checkBlockEnergyLimit, incrementSenderNonce, isLocalCall, fork032Enabled, blockRemainingEnergy);
}
use of org.aion.zero.impl.config.CfgFork in project aion by aionnetwork.
the class ExternalStateForFvm method runInternalPrecompiledContractCall.
/**
* Executes an internal precompiled contract call and returns the result.
*
* @param context The context of the internal transaction.
* @return the execution result.
*/
@Override
public FastVmTransactionResult runInternalPrecompiledContractCall(ExecutionContext context) {
PrecompiledTransactionContext precompiledContext = toPrecompiledTransactionContext(context);
CfgFork cfg = new CfgFork();
String forkProperty = cfg.getProperties().getProperty("fork0.3.2");
boolean fork032Enabled = (forkProperty != null) && (blockNumber >= Long.valueOf(forkProperty));
IExternalStateForPrecompiled precompiledWorldState = new ExternalStateForPrecompiled(this.repository, this.blockNumber, this.isLocalCall, fork032Enabled, this.allowNonceIncrement);
PrecompiledTransactionResult result = ContractExecutor.executeInternalCall(new ExternalCapabilitiesForPrecompiled(), precompiledWorldState, precompiledContext, context.getTransactionData(), context.getTransactionEnergy());
return precompiledToFvmResult(result);
}
Aggregations