Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Apr 27, 2024
1 parent 4be2f9d commit 20db522
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
Expand Up @@ -207,7 +207,7 @@ public long extCodeCopyOperationGasCost(
gasCost,
frame.getAccessWitness().touchCodeChunks(address, codeOffset, readSize, codeSize));
}
System.out.println("ext copy gas cost " + gasCost);

return gasCost;
}

Expand All @@ -219,16 +219,6 @@ public long codeCopyOperationGasCost(
final long readSize,
final long codeSize) {
long gasCost = super.dataCopyOperationGasCost(frame, memOffset, readSize);
System.out.println(
frame.getContractAddress()
+ " "
+ codeOffset
+ " "
+ readSize
+ " "
+ codeSize
+ " "
+ gasCost);
if (!frame.wasCreatedInTransaction(frame.getContractAddress())) {
gasCost =
clampedAdd(
Expand All @@ -237,7 +227,6 @@ public long codeCopyOperationGasCost(
.getAccessWitness()
.touchCodeChunks(frame.getContractAddress(), codeOffset, readSize, codeSize));
}
System.out.println(" 4762 codeCopyOperationGasCost: " + gasCost);
return gasCost;
}

Expand All @@ -264,15 +253,6 @@ public long pushOperationGasCost(
.getAccessWitness()
.touchCodeChunks(frame.getContractAddress(), codeOffset, readSize, codeSize));
}
System.out.println(
String.format(
"push%d %s isPre? %b offset %d codeSize %d gas: %d",
readSize,
frame.getContractAddress(),
isPrecompile(frame.getContractAddress()),
codeOffset,
codeSize,
gasCost));
}
return gasCost;
}
Expand Down
Expand Up @@ -64,7 +64,6 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) {
final Account account = frame.getWorldUpdater().get(address);
frame.pushStackItem(
account == null ? Bytes.EMPTY : Words.intBytes(account.getCode().size()));
System.out.println("code size "+gasCalculator().isPrecompile(address));
return new OperationResult(cost, null);
}
} catch (final UnderflowException ufe) {
Expand Down
Expand Up @@ -84,7 +84,6 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) {
.calculateStorageCost(
frame, key, newValue, currentValueSupplier, originalValueSupplier)
+ (slotIsWarm ? 0L : gasCalculator().getColdSloadCost());
System.out.println("=> sstore gas cost: " + cost);
final long remainingGas = frame.getRemainingGas();
if (frame.isStatic()) {
return new OperationResult(remainingGas, ExceptionalHaltReason.ILLEGAL_STATE_CHANGE);
Expand Down
Expand Up @@ -107,7 +107,6 @@ public void start(final MessageFrame frame, final OperationTracer operationTrace
LOG.trace("Executing contract-creation");
}
try {
System.out.println("start contract creation ");
final MutableAccount sender = frame.getWorldUpdater().getSenderAccount(frame);
sender.decrementBalance(frame.getValue());

Expand Down Expand Up @@ -140,10 +139,6 @@ public void start(final MessageFrame frame, final OperationTracer operationTrace
public void codeSuccess(final MessageFrame frame, final OperationTracer operationTracer) {
final Bytes contractCode = frame.getOutputData();
final long depositFee = gasCalculator.codeDepositGasCost(frame, contractCode.size());
System.out.println(
String.format(
"opcode CREATE deposit fee %d codeSize %d frame codeSize %d pc %d",
depositFee, contractCode.size(), frame.getCode().getSize(), frame.getPC()));
if (frame.getRemainingGas() < depositFee) {
LOG.trace(
"Not enough gas to pay the code deposit fee for {}: "
Expand Down Expand Up @@ -171,7 +166,6 @@ public void codeSuccess(final MessageFrame frame, final OperationTracer operatio

final long statelessContractCompletionFee =
gasCalculator.completedCreateContractGasCost(frame);
System.out.println("opcode CREATE completion " + statelessContractCompletionFee);
if (frame.getRemainingGas() < statelessContractCompletionFee) {
LOG.trace(
"Not enough gas to pay the contract creation completion fee for {}: "
Expand Down

0 comments on commit 20db522

Please sign in to comment.