From c267570c51336d45dbd0e2d79eec5b7f54e50662 Mon Sep 17 00:00:00 2001 From: Fausto Spoto Date: Thu, 2 May 2024 13:11:54 +0200 Subject: [PATCH] Removed the NodeInternal --- .../local/AbstractInitialResponseBuilder.java | 4 +- .../AbstractNonInitialResponseBuilder.java | 4 +- .../local/internal/AbstractLocalNodeImpl.java | 158 ++++----------- .../local/internal/EngineClassLoaderImpl.java | 10 +- .../internal/InitialResponseBuilderImpl.java | 2 +- .../node/local/internal/NodeCachesImpl.java | 12 +- .../node/local/internal/NodeInternal.java | 186 ------------------ .../NonInitialResponseBuilderImpl.java | 12 +- .../node/local/internal/Reverification.java | 6 +- .../node/local/internal/StoreUtilityImpl.java | 26 +-- .../transactions/AbstractResponseBuilder.java | 8 +- .../transactions/CodeCallResponseBuilder.java | 4 +- .../ConstructorCallResponseBuilder.java | 4 +- .../GameteCreationResponseBuilder.java | 6 +- .../InitializationResponseBuilder.java | 6 +- .../InstanceMethodCallResponseBuilder.java | 6 +- ...InstanceViewMethodCallResponseBuilder.java | 4 +- .../JarStoreInitialResponseBuilder.java | 4 +- .../transactions/JarStoreResponseBuilder.java | 4 +- .../MethodCallResponseBuilder.java | 4 +- .../StaticMethodCallResponseBuilder.java | 4 +- .../StaticViewMethodCallResponseBuilder.java | 4 +- .../internal/TendermintNodeImpl.java | 5 - 23 files changed, 104 insertions(+), 379 deletions(-) delete mode 100644 io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeInternal.java diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractInitialResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractInitialResponseBuilder.java index 1db0a66fd..794ca571b 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractInitialResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractInitialResponseBuilder.java @@ -20,8 +20,8 @@ import io.hotmoka.node.api.requests.InitialTransactionRequest; import io.hotmoka.node.api.responses.InitialTransactionResponse; import io.hotmoka.node.api.transactions.TransactionReference; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.node.local.internal.InitialResponseBuilderImpl; -import io.hotmoka.node.local.internal.NodeInternal; import io.hotmoka.stores.StoreTransaction; /** @@ -41,7 +41,7 @@ public abstract class AbstractInitialResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + protected AbstractInitialResponseBuilder(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractNonInitialResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractNonInitialResponseBuilder.java index 223d150b3..c4d329324 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractNonInitialResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/AbstractNonInitialResponseBuilder.java @@ -20,7 +20,7 @@ import io.hotmoka.node.api.requests.NonInitialTransactionRequest; import io.hotmoka.node.api.responses.NonInitialTransactionResponse; import io.hotmoka.node.api.transactions.TransactionReference; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.node.local.internal.NonInitialResponseBuilderImpl; import io.hotmoka.stores.StoreTransaction; @@ -43,7 +43,7 @@ public abstract class AbstractNonInitialResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + protected AbstractNonInitialResponseBuilder(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/AbstractLocalNodeImpl.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/AbstractLocalNodeImpl.java index 26b6cb71d..52a58dd8f 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/AbstractLocalNodeImpl.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/AbstractLocalNodeImpl.java @@ -186,7 +186,7 @@ protected final void notifyEvent(StorageReference creator, StorageReference even /** * The caches of the node. */ - protected final NodeCache caches; + public final NodeCache caches; /** * The store of the node. @@ -252,11 +252,6 @@ protected final void notifyEvent(StorageReference creator, StorageReference even */ private volatile BigInteger numberOfTransactionsSinceLastReward; - /** - * The view of this node with methods used by the implementation of this module. - */ - final NodeInternal internal = new NodeInternalImpl(); - /** * The amount of gas allowed for the execution of the reward method of the validators * at each committed block. @@ -297,8 +292,8 @@ private AbstractLocalNodeImpl(C config, ConsensusConfig consensus, boolean throw new RuntimeException("Unexpected exception", e); } - this.storeUtilities = new StoreUtilityImpl(internal); - this.caches = new NodeCachesImpl(internal, consensus); + this.storeUtilities = new StoreUtilityImpl(this); + this.caches = new NodeCachesImpl(this, consensus, config.getRequestCacheSize(), config.getResponseCacheSize()); this.recentCheckTransactionErrors = new LRUCache<>(100, 1000); this.gasConsumedSinceLastReward = ZERO; this.coinsSinceLastReward = ZERO; @@ -382,6 +377,14 @@ public final ConsensusConfig getConfig() throws NodeException { } } + public LocalNodeConfig getLocalNodeConfig() { + return config; + } + + public GasCostModel getGasCostModel() { + return gasCostModel; + } + @Override public final TransactionReference getTakamakaCode() throws NodeException { try (var scope = mkScope()) { @@ -567,7 +570,7 @@ public final Optional runInstanceMethodCallTransaction(InstanceMet var transaction = store.beginTransaction(System.currentTimeMillis()); synchronized (deliverTransactionLock) { - result = getOutcome(new InstanceViewMethodCallResponseBuilder(reference, request, transaction, internal).getResponse()); + result = getOutcome(new InstanceViewMethodCallResponseBuilder(reference, request, transaction, this).getResponse()); } transaction.abort(); @@ -587,7 +590,7 @@ public final Optional runStaticMethodCallTransaction(StaticMethodC var transaction = store.beginTransaction(System.currentTimeMillis()); synchronized (deliverTransactionLock) { - result = getOutcome(new StaticViewMethodCallResponseBuilder(reference, request, transaction, internal).getResponse()); + result = getOutcome(new StaticViewMethodCallResponseBuilder(reference, request, transaction, this).getResponse()); } transaction.abort(); @@ -798,13 +801,11 @@ else if (minted.signum() < 0) { // if there is only one update, it is the update of the nonce of the manifest: we prefer not to expand // the store with the transaction, so that the state stabilizes, which might give // to the node the chance of suspending the generation of new blocks - if (!(response instanceof TransactionResponseWithUpdates) || ((TransactionResponseWithUpdates) response).getUpdates().count() > 1L) + if (!(response instanceof TransactionResponseWithUpdates trwu) || trwu.getUpdates().count() > 1L) response = deliverTransaction(request); - if (response instanceof MethodCallTransactionFailedResponse) { - MethodCallTransactionFailedResponse responseAsFailed = (MethodCallTransactionFailedResponse) response; + if (response instanceof MethodCallTransactionFailedResponse responseAsFailed) LOGGER.log(Level.WARNING, "could not reward the validators: " + responseAsFailed.getWhere() + ": " + responseAsFailed.getClassNameOfCause() + ": " + responseAsFailed.getMessageOfCause()); - } else { LOGGER.info("units of gas consumed for CPU, RAM or storage since the previous reward: " + gasConsumedSinceLastReward); LOGGER.info("units of coin rewarded to the validators for their work since the previous reward: " + coinsSinceLastReward); @@ -903,19 +904,19 @@ protected void invalidateCachesIfNeeded(TransactionResponse response, EngineClas */ protected ResponseBuilder responseBuilderFor(TransactionReference reference, TransactionRequest request, StoreTransaction transaction) throws TransactionRejectedException { if (request instanceof JarStoreInitialTransactionRequest jsitr) - return new JarStoreInitialResponseBuilder(reference, jsitr, transaction, internal); + return new JarStoreInitialResponseBuilder(reference, jsitr, transaction, this); else if (request instanceof GameteCreationTransactionRequest gctr) - return new GameteCreationResponseBuilder(reference, gctr, transaction, internal); + return new GameteCreationResponseBuilder(reference, gctr, transaction, this); else if (request instanceof JarStoreTransactionRequest jstr) - return new JarStoreResponseBuilder(reference, jstr, transaction, internal); + return new JarStoreResponseBuilder(reference, jstr, transaction, this); else if (request instanceof ConstructorCallTransactionRequest cctr) - return new ConstructorCallResponseBuilder(reference, cctr, transaction, internal); + return new ConstructorCallResponseBuilder(reference, cctr, transaction, this); else if (request instanceof AbstractInstanceMethodCallTransactionRequest aimctr) - return new InstanceMethodCallResponseBuilder(reference, aimctr, transaction, internal); + return new InstanceMethodCallResponseBuilder(reference, aimctr, transaction, this); else if (request instanceof StaticMethodCallTransactionRequest smctr) - return new StaticMethodCallResponseBuilder(reference, smctr, transaction, internal); + return new StaticMethodCallResponseBuilder(reference, smctr, transaction, this); else if (request instanceof InitializationTransactionRequest itr) - return new InitializationResponseBuilder(reference, itr, transaction, internal); + return new InitializationResponseBuilder(reference, itr, transaction, this); else throw new TransactionRejectedException("Unexpected transaction request of class " + request.getClass().getName()); } @@ -949,7 +950,7 @@ protected void setStore(Store store) { * @param reference the reference of the transaction * @return the response, if any */ - private Optional getResponseUncommitted(TransactionReference reference) throws StoreException { + Optional getResponseUncommitted(TransactionReference reference) throws StoreException { var transaction = getTransaction(); if (transaction != null) return transaction.getResponseUncommitted(reference); @@ -966,7 +967,7 @@ private Optional getResponseUncommitted(TransactionReferenc * @return the history. Yields an empty stream if there is no history for {@code object} * @throws StoreException if the store is not able to perform the operation */ - private Stream getHistoryUncommitted(StorageReference object) throws StoreException { + Stream getHistoryUncommitted(StorageReference object) throws StoreException { var transaction = getTransaction(); if (transaction != null) return transaction.getHistoryUncommitted(object); @@ -981,7 +982,7 @@ private Stream getHistoryUncommitted(StorageReference obje * @return the manifest * @throws StoreException if the store is not able to complete the operation correctly */ - private Optional getManifestUncommitted() throws StoreException { + Optional getManifestUncommitted() throws StoreException { var transaction = getTransaction(); if (transaction != null) return transaction.getManifestUncommitted(); @@ -989,6 +990,18 @@ private Optional getManifestUncommitted() throws StoreExceptio return store.getManifest(); } + public StoreUtility getStoreUtilities() { + return storeUtilities; + } + + public Future submit(Callable task) { + return executors.submit(task); + } + + S getStore() { + return store; + } + /** * Runs a callable and wraps any exception into an {@link TransactionRejectedException}, * if it is not a {@link TransactionException} nor a {@link CodeExecutionException}. @@ -1188,101 +1201,4 @@ private void addShutdownHook() { } })); } - - /** - * The view of the node with the methods that are useful inside this module. - * This avoids to export such methods as public elsewhere. - */ - private class NodeInternalImpl implements NodeInternal { - - @Override - public LocalNodeConfig getConfig() { - return config; - } - - @Override - public NodeCache getCaches() { - return caches; - } - - @Override - public GasCostModel getGasCostModel() { - return gasCostModel; - } - - @Override - public Store getStore() { - return store; - } - - @Override - public StoreUtility getStoreUtilities() { - return storeUtilities; - } - - /** - * Yields the response of the transaction having the given reference. - * This considers also updates inside this transaction, that have not yet been committed. - * - * @param reference the reference of the transaction - * @return the response, if any - */ - public Optional getResponseUncommitted(TransactionReference reference) throws StoreException { - return AbstractLocalNodeImpl.this.getResponseUncommitted(reference); - } - - /** - * Yields the history of the given object, that is, the references to the transactions - * that can be used to reconstruct the current values of its fields. - * This considers also updates inside this transaction, that have not yet been committed. - * - * @param object the reference of the object - * @return the history. Yields an empty stream if there is no history for {@code object} - * @throws StoreException if the store is not able to perform the operation - */ - public Stream getHistoryUncommitted(StorageReference object) throws StoreException { - return AbstractLocalNodeImpl.this.getHistoryUncommitted(object); - } - - /** - * Yields the manifest installed when the node is initialized. - * This considers also updates inside this transaction, that have not yet been committed. - * - * @return the manifest - * @throws StoreException if the store is not able to complete the operation correctly - */ - public Optional getManifestUncommitted() throws StoreException { - return AbstractLocalNodeImpl.this.getManifestUncommitted(); - } - - @Override - public TransactionRequest getRequest(TransactionReference reference) throws UnknownReferenceException, NodeException { - return AbstractLocalNodeImpl.this.getRequest(reference); - } - - @Override - public TransactionResponse getResponse(TransactionReference reference) throws TransactionRejectedException, UnknownReferenceException, NodeException { - return AbstractLocalNodeImpl.this.getResponse(reference); - } - - @Override - public ClassTag getClassTag(StorageReference object) throws NodeException, UnknownReferenceException { - return AbstractLocalNodeImpl.this.getClassTag(object); - } - - @Override - public Optional runInstanceMethodCallTransaction(InstanceMethodCallTransactionRequest request) throws TransactionRejectedException, TransactionException, CodeExecutionException { - return AbstractLocalNodeImpl.this.runInstanceMethodCallTransaction(request); - } - - @Override - public Future submit(Callable task) { - return executors.submit(task); - } - - @Override - public void submit(Runnable task) { - executors.submit(task); - } - } } \ No newline at end of file diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/EngineClassLoaderImpl.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/EngineClassLoaderImpl.java index c9de52bd3..8bd0bb99c 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/EngineClassLoaderImpl.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/EngineClassLoaderImpl.java @@ -169,7 +169,7 @@ public final class EngineClassLoaderImpl implements EngineClassLoader { * @throws NodeException * @throws NoSuchElementException */ - public EngineClassLoaderImpl(byte[] jar, Stream dependencies, NodeInternal node, boolean reverify, ConsensusConfig consensus) throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { + public EngineClassLoaderImpl(byte[] jar, Stream dependencies, AbstractLocalNodeImpl node, boolean reverify, ConsensusConfig consensus) throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { try { List dependenciesAsList = dependencies.collect(Collectors.toList()); @@ -234,7 +234,7 @@ public EngineClassLoaderImpl(byte[] jar, Stream dependenci * @return the class loader * @throws ClassNotFoundException if some class of the Takamaka runtime cannot be loaded */ - private TakamakaClassLoader mkTakamakaClassLoader(Stream dependencies, ConsensusConfig consensus, byte[] start, NodeInternal node, List jars, ArrayList transactionsOfJars) throws ClassNotFoundException { + private TakamakaClassLoader mkTakamakaClassLoader(Stream dependencies, ConsensusConfig consensus, byte[] start, AbstractLocalNodeImpl node, List jars, ArrayList transactionsOfJars) throws ClassNotFoundException { var counter = new AtomicInteger(); if (start != null) { @@ -312,7 +312,7 @@ else if (previously != pos) * @param node the node for which the class loader is created * @param counter the number of jars that have been encountered up to now, during the recursive descent */ - private void addJars(TransactionReference classpath, ConsensusConfig consensus, List jars, List jarTransactions, NodeInternal node, AtomicInteger counter) { + private void addJars(TransactionReference classpath, ConsensusConfig consensus, List jars, List jarTransactions, AbstractLocalNodeImpl node, AtomicInteger counter) { // consensus might be null if the node is restarting, during the recomputation of its consensus itself if (consensus != null && counter.incrementAndGet() > consensus.getMaxDependencies()) throw new IllegalArgumentException("too many dependencies in classpath: max is " + consensus.getMaxDependencies()); @@ -340,11 +340,11 @@ private void addJars(TransactionReference classpath, ConsensusConfig consen * @return the response * @throws IllegalArgumentException if the transaction does not exist in the store, or did not generate a response with instrumented jar */ - private TransactionResponseWithInstrumentedJar getResponseWithInstrumentedJarAtUncommitted(TransactionReference reference, NodeInternal node) { + private TransactionResponseWithInstrumentedJar getResponseWithInstrumentedJarAtUncommitted(TransactionReference reference, AbstractLocalNodeImpl node) { // first we check if the response has been reverified and we use the reverified version TransactionResponse response = reverification.getReverifiedResponse(reference) // otherwise the response has not been reverified - .or(() -> node.getCaches().getResponseUncommitted(reference)) + .or(() -> node.caches.getResponseUncommitted(reference)) .orElseThrow(() -> new IllegalArgumentException("unknown transaction reference " + reference)); if (!(response instanceof TransactionResponseWithInstrumentedJar)) diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/InitialResponseBuilderImpl.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/InitialResponseBuilderImpl.java index af3477722..668e892f1 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/InitialResponseBuilderImpl.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/InitialResponseBuilderImpl.java @@ -42,7 +42,7 @@ public abstract class InitialResponseBuilderImpl transaction, NodeInternal node) throws TransactionRejectedException { + protected InitialResponseBuilderImpl(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); try { diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeCachesImpl.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeCachesImpl.java index 032148560..fe70eb5f5 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeCachesImpl.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeCachesImpl.java @@ -75,7 +75,7 @@ public class NodeCachesImpl implements NodeCache { protected final static Logger logger = Logger.getLogger(NodeCachesImpl.class.getName()); - private final NodeInternal node; + private final AbstractLocalNodeImpl node; /** * The cache for the requests. @@ -147,10 +147,10 @@ public class NodeCachesImpl implements NodeCache { * @param node the node * @param consensus the consensus parameters of the node */ - public NodeCachesImpl(NodeInternal node, ConsensusConfig consensus) { + public NodeCachesImpl(AbstractLocalNodeImpl node, ConsensusConfig consensus, int requestCacheSize, int responseCacheSize) { this.node = node; - this.requests = new LRUCache<>(100, node.getConfig().getRequestCacheSize()); - this.responses = new LRUCache<>(100, node.getConfig().getResponseCacheSize()); + this.requests = new LRUCache<>(100, requestCacheSize); + this.responses = new LRUCache<>(100, responseCacheSize); this.checkedSignatures = new LRUCache<>(100, 1000); this.validators = Optional.empty(); this.versions = Optional.empty(); @@ -503,8 +503,8 @@ private boolean consensusParametersMightHaveChanged(TransactionResponse response // we check if there are events of type ConsensusUpdate triggered by the manifest, validators, gas station or versions try { - if (isInitializedUncommitted() && response instanceof TransactionResponseWithEvents) { - Stream events = ((TransactionResponseWithEvents) response).getEvents(); + if (isInitializedUncommitted() && response instanceof TransactionResponseWithEvents trwe) { + Stream events = trwe.getEvents(); StorageReference manifest = node.getManifestUncommitted().get(); StorageReference gasStation = getGasStation().get(); StorageReference versions = getVersions().get(); diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeInternal.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeInternal.java deleted file mode 100644 index 4caa32675..000000000 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NodeInternal.java +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2021 Fausto Spoto - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package io.hotmoka.node.local.internal; - -import java.util.Optional; -import java.util.concurrent.Callable; -import java.util.concurrent.Future; -import java.util.stream.Stream; - -import io.hotmoka.instrumentation.api.GasCostModel; -import io.hotmoka.node.api.CodeExecutionException; -import io.hotmoka.node.api.NodeException; -import io.hotmoka.node.api.TransactionException; -import io.hotmoka.node.api.TransactionRejectedException; -import io.hotmoka.node.api.UnknownReferenceException; -import io.hotmoka.node.api.requests.InstanceMethodCallTransactionRequest; -import io.hotmoka.node.api.requests.TransactionRequest; -import io.hotmoka.node.api.responses.TransactionResponse; -import io.hotmoka.node.api.transactions.TransactionReference; -import io.hotmoka.node.api.updates.ClassTag; -import io.hotmoka.node.api.values.StorageReference; -import io.hotmoka.node.api.values.StorageValue; -import io.hotmoka.node.local.api.LocalNodeConfig; -import io.hotmoka.node.local.api.NodeCache; -import io.hotmoka.node.local.api.StoreUtility; -import io.hotmoka.stores.Store; -import io.hotmoka.stores.StoreException; - -/** - * The methods of a Hotmoka node that are used inside the internal - * implementation of this module. This interface allows to enlarge - * the visibility of some methods, only for the classes the implement - * the module. - */ -public interface NodeInternal { - - /** - * Yields the configuration of this node. - * - * @return the configuration - */ - LocalNodeConfig getConfig(); - - /** - * Yields the caches of this node. - * - * @return the caches - */ - NodeCache getCaches(); - - /** - * Yields the gas cost model of this node. - * - * @return the gas model - */ - GasCostModel getGasCostModel(); - - /** - * Yields the store of this node. - * - * @return the store of this node - */ - Store getStore(); - - /** - * Yields an object that provides methods for reconstructing data from the store of this node. - * - * @return the store utilities - */ - StoreUtility getStoreUtilities(); - - /** - * Yields the request that generated the transaction with the given reference. - * If this node has some form of commit, then this method can only succeed - * when the transaction has been definitely committed in this node. - * Nodes are allowed to keep in store all, some or none of the requests - * that they received during their lifetime. - * - * @param reference the reference of the transaction - * @return the request - * @throws UnknownReferenceException if {@code reference} cannot be found in the node - */ - TransactionRequest getRequest(TransactionReference reference) throws UnknownReferenceException, NodeException; - - /** - * Yields the response generated for the request for the given transaction. - * If this node has some form of commit, then this method can only succeed - * or yield a {@linkplain TransactionRejectedException} only - * when the transaction has been definitely committed in this node. - * Nodes are allowed to keep in store all, some or none of the responses - * that they computed during their lifetime. - * - * @param reference the reference of the transaction - * @return the response - * @throws TransactionRejectedException if there is a request for that transaction but it failed with this exception - * @throws UnknownReferenceException if the response for {@code reference} cannot be found in the node - */ - TransactionResponse getResponse(TransactionReference reference) throws TransactionRejectedException, UnknownReferenceException, NodeException; - - /** - * Yields the class tag of the object with the given storage reference. - * If this method succeeds and this node has some form of commit, then the transaction - * of the storage reference has been definitely committed in this node. - * A node is allowed to keep in store all, some or none of the objects. - * Hence, this method might fail to find the class tag although the object previously - * existed in store. - * - * @param object the storage reference of the object - * @return the class tag, if any - * @throws UnknownReferenceException if there is no object with that reference - * @throws NodeException if the node is not able to perform the operation - */ - ClassTag getClassTag(StorageReference object) throws UnknownReferenceException, NodeException; - - /** - * Yields the response of the transaction having the given reference. - * This considers also updates inside this transaction, that have not yet been committed. - * - * @param reference the reference of the transaction - * @return the response, if any - */ - Optional getResponseUncommitted(TransactionReference reference) throws StoreException; - - /** - * Yields the history of the given object, that is, the references to the transactions - * that can be used to reconstruct the current values of its fields. - * This considers also updates inside this transaction, that have not yet been committed. - * - * @param object the reference of the object - * @return the history. Yields an empty stream if there is no history for {@code object} - * @throws StoreException if the store is not able to perform the operation - */ - Stream getHistoryUncommitted(StorageReference object) throws StoreException; - - /** - * Yields the manifest installed when the node is initialized. - * This considers also updates inside this transaction, that have not yet been committed. - * - * @return the manifest - * @throws StoreException if the store is not able to complete the operation correctly - */ - Optional getManifestUncommitted() throws StoreException; - /** - * Runs an instance {@code @@View} method of an object already in this node's store. - * The node's store is not expanded, since the execution of the method has no side-effects. - * - * @param request the transaction request - * @return the result of the call, if the method was successfully executed, without exception - * @throws TransactionRejectedException if the transaction could not be executed - * @throws CodeExecutionException if the transaction could be executed but led to an exception in the user code in blockchain, - * that is allowed to be thrown by the method - * @throws TransactionException if the transaction could be executed but led to an exception outside the user code in blockchain, - * or that is not allowed to be thrown by the method - */ - Optional runInstanceMethodCallTransaction(InstanceMethodCallTransactionRequest request) throws TransactionRejectedException, TransactionException, CodeExecutionException; - - /** - * Runs the given task with the executor service of this node. - * - * @param the type of the result of the task - * @param task the task - * @return the value computed by the task - */ - Future submit(Callable task); - - /** - * Runs the given task with the executor service of this node. - * - * @param task the task - */ - void submit(Runnable task); -} \ No newline at end of file diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NonInitialResponseBuilderImpl.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NonInitialResponseBuilderImpl.java index 2b0c94ead..bdb47659d 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NonInitialResponseBuilderImpl.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/NonInitialResponseBuilderImpl.java @@ -75,7 +75,7 @@ public abstract class NonInitialResponseBuilderImpl transaction, NodeInternal node) throws TransactionRejectedException { + protected NonInitialResponseBuilderImpl(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); try { @@ -106,7 +106,7 @@ protected boolean transactionIsSigned() { @Override protected EngineClassLoader mkClassLoader() throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { - return node.getCaches().getClassLoader(request.getClasspath()); + return node.caches.getClassLoader(request.getClasspath()); } /** @@ -240,7 +240,7 @@ private void payerMustBeContract() throws TransactionRejectedException, ClassNot private void signatureMustBeValid() throws Exception { // if the node is not initialized yet, the signature is not checked if (transactionIsSigned() && node.getStoreUtilities().nodeIsInitializedUncommitted() - && !node.getCaches().signatureIsValid((SignedTransactionRequest) request, determineSignatureAlgorithm())) + && !node.caches.signatureIsValid((SignedTransactionRequest) request, determineSignatureAlgorithm())) throw new TransactionRejectedException("invalid request signature"); } @@ -305,7 +305,7 @@ private void gasLimitIsInsideBounds() throws TransactionRejectedException { // view requests have a fixed maximum gas, overriding what is specified in the consensus parameters if (isView()) - maxGas = node.getConfig().getMaxGasPerViewTransaction(); + maxGas = node.getLocalNodeConfig().getMaxGasPerViewTransaction(); else maxGas = consensus.getMaxGasPerTransaction(); @@ -322,7 +322,7 @@ private void gasPriceIsLargeEnough() throws TransactionRejectedException { // before initialization, the gas price is not yet available try { if (transactionIsSigned() && node.getStoreUtilities().nodeIsInitializedUncommitted() && !ignoreGasPrice()) { - BigInteger currentGasPrice = node.getCaches().getGasPrice().get(); + BigInteger currentGasPrice = node.caches.getGasPrice().get(); if (request.getGasPrice().compareTo(currentGasPrice) < 0) throw new TransactionRejectedException("the gas price of the request is smaller than the current gas price (" + request.getGasPrice() + " < " + currentGasPrice + ")"); } @@ -431,7 +431,7 @@ protected ResponseCreator() throws TransactionRejectedException { protected final void init() throws NodeException { this.deserializedCaller = deserializer.deserialize(request.getCaller()); this.deserializedPayer = deserializedPayer(); - this.deserializedValidators = node.getCaches().getValidators().map(deserializer::deserialize); + this.deserializedValidators = node.caches.getValidators().map(deserializer::deserialize); increaseNonceOfCaller(); chargeGasForCPU(gasCostModel.cpuBaseTransactionCost()); diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/Reverification.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/Reverification.java index 2c4ce7ec9..2a97cb6f0 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/Reverification.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/Reverification.java @@ -64,7 +64,7 @@ public class Reverification { /** * The node whose responses are reverified. */ - private final NodeInternal node; + private final AbstractLocalNodeImpl node; /** * The consensus parameters to use for reverification. This might be {@code null} if the node is restarting, @@ -85,7 +85,7 @@ public class Reverification { * @throws NodeException * @throws NoSuchElementException */ - public Reverification(Stream transactions, NodeInternal node, ConsensusConfig consensus) throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { + public Reverification(Stream transactions, AbstractLocalNodeImpl node, ConsensusConfig consensus) throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { this.node = node; this.consensus = consensus; @@ -263,7 +263,7 @@ private GenericJarStoreTransactionResponse updateVersion(TransactionResponseWith * @throws NoSuchElementException if the transaction does not exist in the store, or did not generate a response with instrumented jar */ private TransactionResponseWithInstrumentedJar getResponseWithInstrumentedJarAtUncommitted(TransactionReference reference) throws NoSuchElementException { - TransactionResponse response = node.getCaches().getResponseUncommitted(reference) + TransactionResponse response = node.caches.getResponseUncommitted(reference) .orElseThrow(() -> new RuntimeException("Unknown transaction reference " + reference)); if (response instanceof TransactionResponseWithInstrumentedJar trwij) diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/StoreUtilityImpl.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/StoreUtilityImpl.java index 79d174bf8..54b5dbc36 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/StoreUtilityImpl.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/StoreUtilityImpl.java @@ -54,7 +54,7 @@ public class StoreUtilityImpl implements StoreUtility { /** * The node whose store is accessed. */ - private final NodeInternal node; + private final AbstractLocalNodeImpl node; /** * The store that is accessed. @@ -66,7 +66,7 @@ public class StoreUtilityImpl implements StoreUtility { * * @param node the node whose store is accessed */ - public StoreUtilityImpl(NodeInternal node) { + public StoreUtilityImpl(AbstractLocalNodeImpl node) { this.node = node; } @@ -80,7 +80,7 @@ private Store getStore() { * @param node the node for which the store utilities are being built * @param store the store accessed by the store utilities */ - public StoreUtilityImpl(NodeInternal node, Store store) { + public StoreUtilityImpl(AbstractLocalNodeImpl node, Store store) { this.node = node; this.store = store; } @@ -165,7 +165,7 @@ public String getClassNameUncommitted(StorageReference reference) { @Override public ClassTag getClassTagUncommitted(StorageReference reference) throws NoSuchElementException { // we go straight to the transaction that created the object - return node.getCaches().getResponseUncommitted(reference.getTransaction()) + return node.caches.getResponseUncommitted(reference.getTransaction()) .filter(response -> response instanceof TransactionResponseWithUpdates) .flatMap(response -> ((TransactionResponseWithUpdates) response).getUpdates() .filter(update -> update instanceof ClassTag && update.getObject().equals(reference)) @@ -185,7 +185,7 @@ public Stream getStateCommitted(StorageReference object) throws StoreExc @Override public Stream getEagerFieldsUncommitted(StorageReference object) throws StoreException { Set fieldsAlreadySeen = new HashSet<>(); - NodeCache caches = node.getCaches(); + NodeCache caches = node.caches; return node.getHistoryUncommitted(object) .flatMap(transaction -> enforceHasUpdates(caches.getResponseUncommitted(transaction).get()).getUpdates()) @@ -277,16 +277,16 @@ private String getStringFieldUncommitted(StorageReference object, FieldSignature * the {@code transaction}, this method returns an empty optional */ private Optional getLastUpdateUncommitted(StorageReference object, FieldSignature field, TransactionReference transaction) { - TransactionResponse response = node.getCaches().getResponseUncommitted(transaction) + TransactionResponse response = node.caches.getResponseUncommitted(transaction) .orElseThrow(() -> new RuntimeException("Unknown transaction reference " + transaction)); - if (!(response instanceof TransactionResponseWithUpdates)) + if (response instanceof TransactionResponseWithUpdates trwu) + return trwu.getUpdates() + .filter(update -> update instanceof UpdateOfField) + .map(update -> (UpdateOfField) update) + .filter(update -> update.getObject().equals(object) && update.getField().equals(field)) + .findFirst(); + else throw new RuntimeException("Transaction reference " + transaction + " does not contain updates"); - - return ((TransactionResponseWithUpdates) response).getUpdates() - .filter(update -> update instanceof UpdateOfField) - .map(update -> (UpdateOfField) update) - .filter(update -> update.getObject().equals(object) && update.getField().equals(field)) - .findFirst(); } } \ No newline at end of file diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/AbstractResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/AbstractResponseBuilder.java index b7b1fb5ab..5ac57796e 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/AbstractResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/AbstractResponseBuilder.java @@ -43,9 +43,9 @@ import io.hotmoka.node.local.api.EngineClassLoader; import io.hotmoka.node.local.api.ResponseBuilder; import io.hotmoka.node.local.api.UnsupportedVerificationVersionException; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.node.local.internal.Deserializer; import io.hotmoka.node.local.internal.EngineClassLoaderImpl; -import io.hotmoka.node.local.internal.NodeInternal; import io.hotmoka.node.local.internal.StorageTypeToClass; import io.hotmoka.node.local.internal.UpdatesExtractorFromRAM; import io.hotmoka.stores.StoreException; @@ -63,7 +63,7 @@ public abstract class AbstractResponseBuilder node; public final StoreTransaction transaction; @@ -101,13 +101,13 @@ public abstract class AbstractResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + protected AbstractResponseBuilder(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { try { this.transaction = transaction; this.request = request; this.reference = reference; this.node = node; - this.consensus = node.getCaches().getConsensusParams(); + this.consensus = node.caches.getConsensusParams(); this.classLoader = mkClassLoader(); this.storageTypeToClass = new StorageTypeToClass(this); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/CodeCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/CodeCallResponseBuilder.java index ccf0e1889..15feaf212 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/CodeCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/CodeCallResponseBuilder.java @@ -38,7 +38,7 @@ import io.hotmoka.node.api.updates.Update; import io.hotmoka.node.api.values.StorageReference; import io.hotmoka.node.local.AbstractNonInitialResponseBuilder; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.node.local.internal.Serializer; import io.hotmoka.stores.StoreTransaction; import io.hotmoka.whitelisting.Dummy; @@ -65,7 +65,7 @@ public abstract class CodeCallResponseBuilder * @param node the node that is creating the response * @throws TransactionRejectedException if the builder cannot be created */ - protected CodeCallResponseBuilder(TransactionReference reference, Request request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + protected CodeCallResponseBuilder(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); try { diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/ConstructorCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/ConstructorCallResponseBuilder.java index 77bb73443..6d1e0e1a0 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/ConstructorCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/ConstructorCallResponseBuilder.java @@ -33,7 +33,7 @@ import io.hotmoka.node.api.signatures.ConstructorSignature; import io.hotmoka.node.api.transactions.TransactionReference; import io.hotmoka.node.api.values.StorageReference; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; /** @@ -50,7 +50,7 @@ public class ConstructorCallResponseBuilder extends CodeCallResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + public ConstructorCallResponseBuilder(TransactionReference reference, ConstructorCallTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/GameteCreationResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/GameteCreationResponseBuilder.java index ef3926eb7..6836f8098 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/GameteCreationResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/GameteCreationResponseBuilder.java @@ -31,7 +31,7 @@ import io.hotmoka.node.local.AbstractInitialResponseBuilder; import io.hotmoka.node.local.api.EngineClassLoader; import io.hotmoka.node.local.api.UnsupportedVerificationVersionException; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; /** @@ -47,13 +47,13 @@ public class GameteCreationResponseBuilder extends AbstractInitialResponseBuilde * @param node the node that is running the transaction * @throws TransactionRejectedException if the builder cannot be created */ - public GameteCreationResponseBuilder(TransactionReference reference, GameteCreationTransactionRequest request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + public GameteCreationResponseBuilder(TransactionReference reference, GameteCreationTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } @Override protected EngineClassLoader mkClassLoader() throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { - return node.getCaches().getClassLoader(request.getClasspath()); + return node.caches.getClassLoader(request.getClasspath()); } @Override diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InitializationResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InitializationResponseBuilder.java index 15064ec0c..7c202ea91 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InitializationResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InitializationResponseBuilder.java @@ -29,7 +29,7 @@ import io.hotmoka.node.local.AbstractInitialResponseBuilder; import io.hotmoka.node.local.api.EngineClassLoader; import io.hotmoka.node.local.api.UnsupportedVerificationVersionException; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; /** @@ -45,7 +45,7 @@ public class InitializationResponseBuilder extends AbstractInitialResponseBuilde * @param node the node that is running the transaction * @throws TransactionRejectedException if the builder cannot be created */ - public InitializationResponseBuilder(TransactionReference reference, InitializationTransactionRequest request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + public InitializationResponseBuilder(TransactionReference reference, InitializationTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } @@ -63,6 +63,6 @@ protected InitializationTransactionResponse body() { @Override protected EngineClassLoader mkClassLoader() throws ClassNotFoundException, UnsupportedVerificationVersionException, IOException, NoSuchElementException, UnknownReferenceException, NodeException { - return node.getCaches().getClassLoader(request.getClasspath()); // currently not used for this transaction + return node.caches.getClassLoader(request.getClasspath()); // currently not used for this transaction } } \ No newline at end of file diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceMethodCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceMethodCallResponseBuilder.java index 648ec6b8e..630c807fc 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceMethodCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceMethodCallResponseBuilder.java @@ -40,7 +40,7 @@ import io.hotmoka.node.api.values.BigIntegerValue; import io.hotmoka.node.api.values.StorageReference; import io.hotmoka.node.api.values.StorageValue; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreException; import io.hotmoka.stores.StoreTransaction; import io.takamaka.code.constants.Constants; @@ -59,7 +59,7 @@ public class InstanceMethodCallResponseBuilder extends MethodCallResponseBuilder * @param node the node that is running the transaction * @throws TransactionRejectedException if the builder cannot be created */ - public InstanceMethodCallResponseBuilder(TransactionReference reference, AbstractInstanceMethodCallTransactionRequest request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + public InstanceMethodCallResponseBuilder(TransactionReference reference, AbstractInstanceMethodCallTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); try { @@ -94,7 +94,7 @@ protected boolean transactionIsSigned() { private boolean callerIsGameteOfTheNode() { try { - return node.getCaches().getGamete().filter(request.getCaller()::equals).isPresent(); + return node.caches.getGamete().filter(request.getCaller()::equals).isPresent(); } catch (NodeException e) { LOGGER.log(Level.SEVERE, "", e); diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceViewMethodCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceViewMethodCallResponseBuilder.java index 65bbb9453..4410ae6a8 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceViewMethodCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/InstanceViewMethodCallResponseBuilder.java @@ -19,7 +19,7 @@ import io.hotmoka.node.api.TransactionRejectedException; import io.hotmoka.node.api.requests.InstanceMethodCallTransactionRequest; import io.hotmoka.node.api.transactions.TransactionReference; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; /** @@ -36,7 +36,7 @@ public class InstanceViewMethodCallResponseBuilder extends InstanceMethodCallRes * @param node the node that is running the transaction * @throws TransactionRejectedException if the builder cannot be created */ - public InstanceViewMethodCallResponseBuilder(TransactionReference reference, InstanceMethodCallTransactionRequest request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + public InstanceViewMethodCallResponseBuilder(TransactionReference reference, InstanceMethodCallTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreInitialResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreInitialResponseBuilder.java index 9529a2566..a973bbacf 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreInitialResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreInitialResponseBuilder.java @@ -30,8 +30,8 @@ import io.hotmoka.node.local.AbstractInitialResponseBuilder; import io.hotmoka.node.local.api.EngineClassLoader; import io.hotmoka.node.local.api.UnsupportedVerificationVersionException; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.node.local.internal.EngineClassLoaderImpl; -import io.hotmoka.node.local.internal.NodeInternal; import io.hotmoka.stores.StoreTransaction; import io.hotmoka.verification.VerificationException; import io.hotmoka.verification.VerifiedJars; @@ -49,7 +49,7 @@ public class JarStoreInitialResponseBuilder extends AbstractInitialResponseBuild * @param node the node that is running the transaction * @throws TransactionRejectedException if the builder cannot be created */ - public JarStoreInitialResponseBuilder(TransactionReference reference, JarStoreInitialTransactionRequest request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + public JarStoreInitialResponseBuilder(TransactionReference reference, JarStoreInitialTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreResponseBuilder.java index 25626bcd0..03a02be3f 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/JarStoreResponseBuilder.java @@ -34,8 +34,8 @@ import io.hotmoka.node.local.AbstractNonInitialResponseBuilder; import io.hotmoka.node.local.api.EngineClassLoader; import io.hotmoka.node.local.api.UnsupportedVerificationVersionException; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.node.local.internal.EngineClassLoaderImpl; -import io.hotmoka.node.local.internal.NodeInternal; import io.hotmoka.stores.StoreTransaction; import io.hotmoka.verification.VerifiedJars; @@ -53,7 +53,7 @@ public class JarStoreResponseBuilder extends AbstractNonInitialResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + public JarStoreResponseBuilder(TransactionReference reference, JarStoreTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/MethodCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/MethodCallResponseBuilder.java index a2a330354..1ead84a6e 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/MethodCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/MethodCallResponseBuilder.java @@ -31,7 +31,7 @@ import io.hotmoka.node.api.signatures.MethodSignature; import io.hotmoka.node.api.signatures.NonVoidMethodSignature; import io.hotmoka.node.api.transactions.TransactionReference; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; /** @@ -49,7 +49,7 @@ public abstract class MethodCallResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + protected MethodCallResponseBuilder(TransactionReference reference, Request request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticMethodCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticMethodCallResponseBuilder.java index 933973ca9..9e0aeca9a 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticMethodCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticMethodCallResponseBuilder.java @@ -26,7 +26,7 @@ import io.hotmoka.node.api.requests.StaticMethodCallTransactionRequest; import io.hotmoka.node.api.responses.MethodCallTransactionResponse; import io.hotmoka.node.api.transactions.TransactionReference; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; import io.takamaka.code.constants.Constants; @@ -43,7 +43,7 @@ public class StaticMethodCallResponseBuilder extends MethodCallResponseBuilder transaction, NodeInternal node) throws TransactionRejectedException { + public StaticMethodCallResponseBuilder(TransactionReference reference, StaticMethodCallTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticViewMethodCallResponseBuilder.java b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticViewMethodCallResponseBuilder.java index 251f46900..6ca792028 100644 --- a/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticViewMethodCallResponseBuilder.java +++ b/io-hotmoka-node-local/src/main/java/io/hotmoka/node/local/internal/transactions/StaticViewMethodCallResponseBuilder.java @@ -19,7 +19,7 @@ import io.hotmoka.node.api.TransactionRejectedException; import io.hotmoka.node.api.requests.StaticMethodCallTransactionRequest; import io.hotmoka.node.api.transactions.TransactionReference; -import io.hotmoka.node.local.internal.NodeInternal; +import io.hotmoka.node.local.internal.AbstractLocalNodeImpl; import io.hotmoka.stores.StoreTransaction; /** @@ -36,7 +36,7 @@ public class StaticViewMethodCallResponseBuilder extends StaticMethodCallRespons * @param node the node that is running the transaction * @throws TransactionRejectedException if the builder cannot be created */ - public StaticViewMethodCallResponseBuilder(TransactionReference reference, StaticMethodCallTransactionRequest request, StoreTransaction transaction, NodeInternal node) throws TransactionRejectedException { + public StaticViewMethodCallResponseBuilder(TransactionReference reference, StaticMethodCallTransactionRequest request, StoreTransaction transaction, AbstractLocalNodeImpl node) throws TransactionRejectedException { super(reference, request, transaction, node); } diff --git a/io-hotmoka-node-tendermint/src/main/java/io/hotmoka/node/tendermint/internal/TendermintNodeImpl.java b/io-hotmoka-node-tendermint/src/main/java/io/hotmoka/node/tendermint/internal/TendermintNodeImpl.java index 488ecc082..1a0896538 100644 --- a/io-hotmoka-node-tendermint/src/main/java/io/hotmoka/node/tendermint/internal/TendermintNodeImpl.java +++ b/io-hotmoka-node-tendermint/src/main/java/io/hotmoka/node/tendermint/internal/TendermintNodeImpl.java @@ -103,11 +103,6 @@ public class TendermintNodeImpl extends AbstractLocalNode