Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- `BesuContext` is removed, since deprecated in favor of `ServiceManager` since `24.12.0`
- Remove the deprecated `--Xbonsai-limit-trie-logs-enabled`, use `--bonsai-limit-trie-logs-enabled` instead. [#8704](https://github.com/hyperledger/besu/issues/8704)
- Remove the deprecated `--Xbonsai-trie-log-pruning-enabled`, use `--bonsai-limit-trie-logs-enabled` instead. [#8704](https://github.com/hyperledger/besu/issues/8704)
- Remove methods from gas calculator deprecated since 24.4 `create2OperationGasCost`, `callOperationGasCost`, `createOperationGasCost`, and `cost` [#8817](https://github.com/hyperledger/besu/pull/8817)
- Sunsetting features - for more context on the reasoning behind the deprecation of these features, including alternative options, read [this blog post](https://www.lfdecentralizedtrust.org/blog/sunsetting-tessera-and-simplifying-hyperledger-besu)
- Stratum mining has been removed (part of PoW) [#8802](https://github.com/hyperledger/besu/pull/8802)
- PoW RPCs removed: `eth_getWork`, `eth_submitWork`, `eth_getHashrate`, `eth_submitHashrate`, `eth_hashrate`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,32 +143,6 @@ public long getSloadOperationGasCost() {
return 0L;
}

// Redefined costs from EIP-2929
@Override
@SuppressWarnings("java:S5738")
public long callOperationGasCost(
final MessageFrame frame,
final long stipend,
final long inputDataOffset,
final long inputDataLength,
final long outputDataOffset,
final long outputDataLength,
final Wei transferValue,
final Account recipient,
final Address to) {
return callOperationGasCost(
frame,
stipend,
inputDataOffset,
inputDataLength,
outputDataOffset,
outputDataLength,
transferValue,
recipient,
to,
frame.warmUpAddress(to) || isPrecompile(to));
}

// Redefined costs from EIP-2929
@Override
public long callOperationGasCost(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
*/
package org.hyperledger.besu.evm.gascalculator;

import static org.hyperledger.besu.evm.internal.Words.clampedAdd;
import static org.hyperledger.besu.evm.internal.Words.clampedToInt;

import org.hyperledger.besu.evm.frame.MessageFrame;

import java.util.function.Supplier;

import org.apache.tuweni.units.bigints.UInt256;
Expand All @@ -40,27 +35,6 @@ public class ConstantinopleGasCalculator extends ByzantiumGasCalculator {
/** Default constructor. */
public ConstantinopleGasCalculator() {}

/**
* Returns the amount of gas the CREATE2 operation will consume.
*
* @param frame The current frame
* @return the amount of gas the CREATE2 operation will consume
* @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link
* #memoryExpansionGasCost(MessageFrame, long, long)}, {@link #createKeccakCost(int)}, and
* {@link #initcodeCost(int)}. As done in {@link
* org.hyperledger.besu.evm.operation.Create2Operation#cost(MessageFrame, Supplier)}
*/
@SuppressWarnings("removal")
@Override
@Deprecated(since = "24.4.1", forRemoval = true)
public long create2OperationGasCost(final MessageFrame frame) {
final int inputOffset = clampedToInt(frame.getStackItem(1));
final int inputSize = clampedToInt(frame.getStackItem(2));
return clampedAdd(
clampedAdd(txCreateCost(), memoryExpansionGasCost(frame, inputOffset, inputSize)),
clampedAdd(createKeccakCost(inputSize), initcodeCost(inputSize)));
}

@Override
// As per https://eips.ethereum.org/EIPS/eip-1283
public long calculateStorageCost(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import static org.hyperledger.besu.evm.internal.Words.clampedAdd;
import static org.hyperledger.besu.evm.internal.Words.clampedMultiply;
import static org.hyperledger.besu.evm.internal.Words.clampedToInt;
import static org.hyperledger.besu.evm.internal.Words.clampedToLong;
import static org.hyperledger.besu.evm.internal.Words.numWords;

import org.hyperledger.besu.datatypes.Address;
Expand Down Expand Up @@ -280,31 +279,6 @@ public long newAccountGasCost() {
return NEW_ACCOUNT_GAS_COST;
}

@SuppressWarnings("removal")
@Override
public long callOperationGasCost(
final MessageFrame frame,
final long stipend,
final long inputDataOffset,
final long inputDataLength,
final long outputDataOffset,
final long outputDataLength,
final Wei transferValue,
final Account recipient,
final Address to) {
return callOperationGasCost(
frame,
stipend,
inputDataOffset,
inputDataLength,
outputDataOffset,
outputDataLength,
transferValue,
recipient,
to,
true);
}

@Override
public long callOperationGasCost(
final MessageFrame frame,
Expand Down Expand Up @@ -367,44 +341,6 @@ public long getMinCalleeGas() {
return 0;
}

/**
* Returns the amount of gas the CREATE operation will consume.
*
* @param frame The current frame
* @return the amount of gas the CREATE operation will consume
* @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link
* #memoryExpansionGasCost(MessageFrame, long, long)}, and {@link #initcodeCost(int)} As done
* in {@link org.hyperledger.besu.evm.operation.CreateOperation#cost(MessageFrame, Supplier)}
*/
@SuppressWarnings("removal")
@Override
@Deprecated(since = "24.4.1", forRemoval = true)
public long createOperationGasCost(final MessageFrame frame) {
final long initCodeOffset = clampedToLong(frame.getStackItem(1));
final int initCodeLength = clampedToInt(frame.getStackItem(2));

return clampedAdd(
clampedAdd(txCreateCost(), memoryExpansionGasCost(frame, initCodeOffset, initCodeLength)),
initcodeCost(initCodeLength));
}

/**
* Returns the amount of gas the CREATE2 operation will consume.
*
* @param frame The current frame
* @return the amount of gas the CREATE2 operation will consume
* @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link
* #memoryExpansionGasCost(MessageFrame, long, long)}, {@link #createKeccakCost(int)}, and
* {@link #initcodeCost(int)}
*/
@SuppressWarnings("removal")
@Override
@Deprecated(since = "24.4.1", forRemoval = true)
public long create2OperationGasCost(final MessageFrame frame) {
throw new UnsupportedOperationException(
"CREATE2 operation not supported by " + getClass().getSimpleName());
}

@Override
public long txCreateCost() {
return CREATE_OPERATION_GAS_COST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,45 +159,6 @@ public interface GasCalculator {
*/
long newAccountGasCost();

/**
* Returns the gas cost for one of the various CALL operations.
*
* @param frame The current frame
* @param stipend The gas stipend being provided by the CALL caller
* @param inputDataOffset The offset in memory to retrieve the CALL input data
* @param inputDataLength The CALL input data length
* @param outputDataOffset The offset in memory to place the CALL output data
* @param outputDataLength The CALL output data length
* @param transferValue The wei being transferred
* @param recipient The CALL recipient (may be null if self destructed or new)
* @param contract The address of the recipient (never null)
* @return The gas cost for the CALL operation
* @deprecated use the variant with the `accountIsWarm` parameter.
*/
@Deprecated(since = "24.2.0", forRemoval = true)
default long callOperationGasCost(
final MessageFrame frame,
final long stipend,
final long inputDataOffset,
final long inputDataLength,
final long outputDataOffset,
final long outputDataLength,
final Wei transferValue,
final Account recipient,
final Address contract) {
return callOperationGasCost(
frame,
stipend,
inputDataOffset,
inputDataLength,
outputDataOffset,
outputDataLength,
transferValue,
recipient,
contract,
true);
}

/**
* Returns the gas cost for one of the various CALL operations.
*
Expand Down Expand Up @@ -256,29 +217,6 @@ long callOperationGasCost(
*/
long getMinCalleeGas();

/**
* Returns the amount of gas the CREATE operation will consume.
*
* @param frame The current frame
* @return the amount of gas the CREATE operation will consume
* @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link
* #memoryExpansionGasCost(MessageFrame, long, long)}, and {@link #initcodeCost(int)}
*/
@Deprecated(since = "24.4.1", forRemoval = true)
long createOperationGasCost(MessageFrame frame);

/**
* Returns the amount of gas the CREATE2 operation will consume.
*
* @param frame The current frame
* @return the amount of gas the CREATE2 operation will consume
* @deprecated Compose the operation cost from {@link #txCreateCost()}, {@link
* #memoryExpansionGasCost(MessageFrame, long, long)}, {@link #createKeccakCost(int)}, and
* {@link #initcodeCost(int)}
*/
@Deprecated(since = "24.4.1", forRemoval = true)
long create2OperationGasCost(MessageFrame frame);

/**
* Returns the base create cost, or TX_CREATE_COST as defined in the execution specs
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,6 @@ public OperationResult execute(final MessageFrame frame, final EVM evm) {
return new OperationResult(cost, null, 0);
}

/**
* Calculates Cost.
*
* @param frame the frame
* @return the long
* @deprecated use the form with the `accountIsWarm` boolean
*/
@Deprecated(since = "24.2.0", forRemoval = true)
@SuppressWarnings("InlineMeSuggester") // downstream users override, so @InlineMe is inappropriate
public long cost(final MessageFrame frame) {
return cost(frame, true);
}

/**
* Calculates Cost.
*
Expand Down
Loading