Rename method (#412)

* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for

Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>

* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for

Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>

* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for

Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
pull/415/head
pinges 5 years ago committed by GitHub
parent 8afd6516e1
commit 1b0dffcb30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java
  2. 14
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/TransactionProcessor.java
  3. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/PrivacyPrecompiledContract.java
  4. 20
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/MessageFrame.java

@ -172,7 +172,7 @@ public class MainnetTransactionProcessor implements TransactionProcessor {
final Address miningBeneficiary, final Address miningBeneficiary,
final OperationTracer operationTracer, final OperationTracer operationTracer,
final BlockHashLookup blockHashLookup, final BlockHashLookup blockHashLookup,
final Boolean isPersistingState, final Boolean isPersistingPrivateState,
final TransactionValidationParams transactionValidationParams) { final TransactionValidationParams transactionValidationParams) {
LOG.trace("Starting execution of {}", transaction); LOG.trace("Starting execution of {}", transaction);
@ -246,7 +246,7 @@ public class MainnetTransactionProcessor implements TransactionProcessor {
.completer(c -> {}) .completer(c -> {})
.miningBeneficiary(miningBeneficiary) .miningBeneficiary(miningBeneficiary)
.blockHashLookup(blockHashLookup) .blockHashLookup(blockHashLookup)
.isPersistingState(isPersistingState) .isPersistingPrivateState(isPersistingPrivateState)
.maxStackSize(maxStackSize) .maxStackSize(maxStackSize)
.transactionHash(transaction.getHash()) .transactionHash(transaction.getHash())
.build(); .build();
@ -279,7 +279,7 @@ public class MainnetTransactionProcessor implements TransactionProcessor {
.miningBeneficiary(miningBeneficiary) .miningBeneficiary(miningBeneficiary)
.blockHashLookup(blockHashLookup) .blockHashLookup(blockHashLookup)
.maxStackSize(maxStackSize) .maxStackSize(maxStackSize)
.isPersistingState(isPersistingState) .isPersistingPrivateState(isPersistingPrivateState)
.transactionHash(transaction.getHash()) .transactionHash(transaction.getHash())
.build(); .build();
} }

@ -116,7 +116,7 @@ public interface TransactionProcessor {
* @param transaction The transaction to process * @param transaction The transaction to process
* @param miningBeneficiary The address which is to receive the transaction fee * @param miningBeneficiary The address which is to receive the transaction fee
* @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations * @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations
* @param isPersistingState Whether the state will be modified by this process * @param isPersistingPrivateState Whether the resulting private state will be persisted
* @param transactionValidationParams Validation parameters that will be used by the {@link * @param transactionValidationParams Validation parameters that will be used by the {@link
* TransactionValidator} * TransactionValidator}
* @return the transaction result * @return the transaction result
@ -130,7 +130,7 @@ public interface TransactionProcessor {
final Transaction transaction, final Transaction transaction,
final Address miningBeneficiary, final Address miningBeneficiary,
final BlockHashLookup blockHashLookup, final BlockHashLookup blockHashLookup,
final Boolean isPersistingState, final Boolean isPersistingPrivateState,
final TransactionValidationParams transactionValidationParams) { final TransactionValidationParams transactionValidationParams) {
return processTransaction( return processTransaction(
blockchain, blockchain,
@ -140,7 +140,7 @@ public interface TransactionProcessor {
miningBeneficiary, miningBeneficiary,
OperationTracer.NO_TRACING, OperationTracer.NO_TRACING,
blockHashLookup, blockHashLookup,
isPersistingState, isPersistingPrivateState,
transactionValidationParams); transactionValidationParams);
} }
@ -154,7 +154,7 @@ public interface TransactionProcessor {
* @param operationTracer The tracer to record results of each EVM operation * @param operationTracer The tracer to record results of each EVM operation
* @param miningBeneficiary The address which is to receive the transaction fee * @param miningBeneficiary The address which is to receive the transaction fee
* @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations * @param blockHashLookup The {@link BlockHashLookup} to use for BLOCKHASH operations
* @param isPersistingState Whether the state will be modified by this process * @param isPersistingPrivateState Whether the resulting private state will be persisted
* @return the transaction result * @return the transaction result
*/ */
default Result processTransaction( default Result processTransaction(
@ -165,7 +165,7 @@ public interface TransactionProcessor {
final Address miningBeneficiary, final Address miningBeneficiary,
final OperationTracer operationTracer, final OperationTracer operationTracer,
final BlockHashLookup blockHashLookup, final BlockHashLookup blockHashLookup,
final Boolean isPersistingState) { final Boolean isPersistingPrivateState) {
return processTransaction( return processTransaction(
blockchain, blockchain,
worldState, worldState,
@ -174,7 +174,7 @@ public interface TransactionProcessor {
miningBeneficiary, miningBeneficiary,
operationTracer, operationTracer,
blockHashLookup, blockHashLookup,
isPersistingState, isPersistingPrivateState,
new TransactionValidationParams.Builder().build()); new TransactionValidationParams.Builder().build());
} }
@ -186,6 +186,6 @@ public interface TransactionProcessor {
Address miningBeneficiary, Address miningBeneficiary,
OperationTracer operationTracer, OperationTracer operationTracer,
BlockHashLookup blockHashLookup, BlockHashLookup blockHashLookup,
Boolean isPersistingState, Boolean isPersistingPrivateState,
TransactionValidationParams transactionValidationParams); TransactionValidationParams transactionValidationParams);
} }

@ -97,7 +97,7 @@ public class PrivacyPrecompiledContract extends AbstractPrecompiledContract {
public Bytes compute(final Bytes input, final MessageFrame messageFrame) { public Bytes compute(final Bytes input, final MessageFrame messageFrame) {
final ProcessableBlockHeader currentBlockHeader = messageFrame.getBlockHeader(); final ProcessableBlockHeader currentBlockHeader = messageFrame.getBlockHeader();
if (!BlockHeader.class.isAssignableFrom(currentBlockHeader.getClass())) { if (!BlockHeader.class.isAssignableFrom(currentBlockHeader.getClass())) {
if (!messageFrame.isPersistingState()) { if (!messageFrame.isPersistingPrivateState()) {
// We get in here from block mining. // We get in here from block mining.
return Bytes.EMPTY; return Bytes.EMPTY;
} else { } else {
@ -168,7 +168,7 @@ public class PrivacyPrecompiledContract extends AbstractPrecompiledContract {
return Bytes.EMPTY; return Bytes.EMPTY;
} }
if (messageFrame.isPersistingState()) { if (messageFrame.isPersistingPrivateState()) {
LOG.trace( LOG.trace(
"Persisting private state {} for privacyGroup {}", "Persisting private state {} for privacyGroup {}",
disposablePrivateState.rootHash(), disposablePrivateState.rootHash(),

@ -227,7 +227,7 @@ public class MessageFrame {
private final int depth; private final int depth;
private final Deque<MessageFrame> messageFrameStack; private final Deque<MessageFrame> messageFrameStack;
private final Address miningBeneficiary; private final Address miningBeneficiary;
private final Boolean isPersistingState; private final Boolean isPersistingPrivateState;
private Optional<Bytes> revertReason; private Optional<Bytes> revertReason;
// Privacy Execution Environment fields. // Privacy Execution Environment fields.
@ -267,7 +267,7 @@ public class MessageFrame {
final Consumer<MessageFrame> completer, final Consumer<MessageFrame> completer,
final Address miningBeneficiary, final Address miningBeneficiary,
final BlockHashLookup blockHashLookup, final BlockHashLookup blockHashLookup,
final Boolean isPersistingState, final Boolean isPersistingPrivateState,
final Hash transactionHash, final Hash transactionHash,
final Optional<Bytes> revertReason, final Optional<Bytes> revertReason,
final int maxStackSize) { final int maxStackSize) {
@ -303,7 +303,7 @@ public class MessageFrame {
this.isStatic = isStatic; this.isStatic = isStatic;
this.completer = completer; this.completer = completer;
this.miningBeneficiary = miningBeneficiary; this.miningBeneficiary = miningBeneficiary;
this.isPersistingState = isPersistingState; this.isPersistingPrivateState = isPersistingPrivateState;
this.transactionHash = transactionHash; this.transactionHash = transactionHash;
this.revertReason = revertReason; this.revertReason = revertReason;
} }
@ -962,8 +962,8 @@ public class MessageFrame {
* *
* @return whether Message calls will be persisted * @return whether Message calls will be persisted
*/ */
public Boolean isPersistingState() { public Boolean isPersistingPrivateState() {
return isPersistingState; return isPersistingPrivateState;
} }
/** /**
@ -1020,7 +1020,7 @@ public class MessageFrame {
private Consumer<MessageFrame> completer; private Consumer<MessageFrame> completer;
private Address miningBeneficiary; private Address miningBeneficiary;
private BlockHashLookup blockHashLookup; private BlockHashLookup blockHashLookup;
private Boolean isPersistingState = false; private Boolean isPersistingPrivateState = false;
private Hash transactionHash; private Hash transactionHash;
private Optional<Bytes> reason = Optional.empty(); private Optional<Bytes> reason = Optional.empty();
@ -1135,8 +1135,8 @@ public class MessageFrame {
return this; return this;
} }
public Builder isPersistingState(final Boolean isPersistingState) { public Builder isPersistingPrivateState(final Boolean isPersistingPrivateState) {
this.isPersistingState = isPersistingState; this.isPersistingPrivateState = isPersistingPrivateState;
return this; return this;
} }
@ -1170,7 +1170,7 @@ public class MessageFrame {
checkState(completer != null, "Missing message frame completer"); checkState(completer != null, "Missing message frame completer");
checkState(miningBeneficiary != null, "Missing mining beneficiary"); checkState(miningBeneficiary != null, "Missing mining beneficiary");
checkState(blockHashLookup != null, "Missing block hash lookup"); checkState(blockHashLookup != null, "Missing block hash lookup");
checkState(isPersistingState != null, "Missing isPersistingState"); checkState(isPersistingPrivateState != null, "Missing isPersistingPrivateState");
checkState(contractAccountVersion != -1, "Missing contractAccountVersion"); checkState(contractAccountVersion != -1, "Missing contractAccountVersion");
} }
@ -1199,7 +1199,7 @@ public class MessageFrame {
completer, completer,
miningBeneficiary, miningBeneficiary,
blockHashLookup, blockHashLookup,
isPersistingState, isPersistingPrivateState,
transactionHash, transactionHash,
reason, reason,
maxStackSize); maxStackSize);

Loading…
Cancel
Save