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
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public static Address fromHexStringStrict(final String str) {
*/
public static Address precompiled(final int value) {
// Allow values up to 0x01FF (511) to encompass layer2 precompile address space
checkArgument(value < 0x01FF, "Precompiled value must be <= 0x01FF");
checkArgument(value <= 0x01FF, "Precompiled value must be <= 0x01FF");
final byte[] address = new byte[SIZE];
address[SIZE - 2] = (byte) (value >>> 8); // High byte
address[SIZE - 1] = (byte) (value & 0xFF); // Low byte
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.hyperledger.besu.evm.operation.SelfDestructOperation;
import org.hyperledger.besu.evm.precompile.ECRECPrecompiledContract;
import org.hyperledger.besu.evm.precompile.IDPrecompiledContract;
import org.hyperledger.besu.evm.precompile.P256VerifyPrecompiledContract;
import org.hyperledger.besu.evm.precompile.RIPEMD160PrecompiledContract;
import org.hyperledger.besu.evm.precompile.SHA256PrecompiledContract;
import org.hyperledger.besu.evm.processor.AbstractMessageProcessor;
Expand Down Expand Up @@ -77,7 +78,7 @@ public interface GasCalculator {
long getEcrecPrecompiledContractGasCost();

/**
* Returns the gas cost to execute the {@link ECRECPrecompiledContract}.
* Returns the gas cost to execute the {@link P256VerifyPrecompiledContract}.
*
* @return the gas cost to execute the P256Verify precompiled contract
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class OsakaGasCalculatorTest {
@Test
void testPrecompileSize() {
OsakaGasCalculator subject = new OsakaGasCalculator();
assertThat(subject.isPrecompile(Address.precompiled(0x14))).isFalse();
assertThat(subject.isPrecompile(Address.precompiled(0x14))).isTrue();
assertThat(subject.isPrecompile(Address.precompiled(0x01FF))).isTrue();
assertThat(subject.isPrecompile(Address.P256_VERIFY)).isTrue();
assertThat(subject.isPrecompile(Address.BLS12_MAP_FP2_TO_G2)).isTrue();
}
}
Loading