Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KZG point eval precompile #4860

Merged
merged 29 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a0aabbd
KZG implementation
jflo Jan 5, 2023
541365d
corrects test that fail if hostname is set to something unresolvable
jflo Jan 6, 2023
685cb10
adds precompile error handling
jflo Jan 15, 2023
86212c8
KZG implementation
jflo Jan 5, 2023
6c9102d
adds precompile error handling
jflo Jan 15, 2023
113e083
checks output in happy path test
jflo Jan 17, 2023
883d7d0
spotless
jflo Jan 17, 2023
ebaacd6
KZG implementation
jflo Jan 5, 2023
95b3b6c
adds precompile error handling
jflo Jan 15, 2023
2bad3ed
Merge branch 'KZGpointEvalPrecompile' of github.com:jflo/besu into KZ…
jflo Jan 19, 2023
5a802e0
KZG implementation
jflo Jan 5, 2023
7d2b70a
adds precompile error handling
jflo Jan 15, 2023
0e2dd0e
checks output in happy path test
jflo Jan 17, 2023
8c5c848
spotless
jflo Jan 17, 2023
8cb5003
KZG implementation
jflo Jan 5, 2023
92a70af
adds precompile error handling
jflo Jan 15, 2023
96fe0e3
KZG implementation
jflo Jan 5, 2023
9a9a51e
adds precompile error handling
jflo Jan 15, 2023
c4b9ece
corrects CHANGELOG
jflo Jan 20, 2023
8942c87
Merge branch 'KZGpointEvalPrecompile' of github.com:jflo/besu into KZ…
jflo Jan 20, 2023
c324a45
Merge branch 'main' into KZGpointEvalPrecompile
jflo Jan 20, 2023
8a5e696
updates from main
jflo Jan 20, 2023
8f5a80d
put humpty dumpty back together again
jflo Jan 20, 2023
ae8523f
expected val needed padding
jflo Jan 20, 2023
4bb9c9c
uses paths when possible
jflo Jan 20, 2023
8f9c1e9
removes kzg setup configurability, adjusts dependencies
jflo Jan 21, 2023
904d463
use a second constructor, since bit length needs to be known at libra…
jflo Jan 21, 2023
e1dd9c1
Merge branch 'main' into KZGpointEvalPrecompile
jflo Jan 23, 2023
3f87644
Merge branch 'main' into KZGpointEvalPrecompile
jflo Jan 23, 2023
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
Prev Previous commit
Next Next commit
removes kzg setup configurability, adjusts dependencies
Signed-off-by: Justin Florentine <justin+github@florentine.us>
  • Loading branch information
jflo committed Jan 21, 2023
commit 8f9c1e96387bd71bfeb46b20c2f55ddd38a3f2c5
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
import org.hyperledger.besu.cli.options.CLIOptions;
import org.hyperledger.besu.evm.internal.EvmConfiguration;

import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;

import picocli.CommandLine;

Expand All @@ -31,8 +29,6 @@ public class EvmOptions implements CLIOptions<EvmConfiguration> {
/** The constant JUMPDEST_CACHE_WEIGHT. */
public static final String JUMPDEST_CACHE_WEIGHT = "--Xevm-jumpdest-cache-weight-kb";

public static final String KZG_TRUSTED_SETUP_FILE_PATH = "--evm-kzg-trusted-setup-path";

/**
* Create evm options.
*
Expand All @@ -55,21 +51,9 @@ public static EvmOptions create() {
private Long jumpDestCacheWeightKilobytes =
32_000L; // 10k contracts, (25k max contract size / 8 bit) + 32byte hash

@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"})
@CommandLine.Option(
names = {KZG_TRUSTED_SETUP_FILE_PATH},
description =
"absolute file path on the host system which points to the trusted KZG setup file to use",
arity = "1")
private String kzgTrustedSetupFilePath = null;

@Override
public EvmConfiguration toDomainObject() {
return new EvmConfiguration(
jumpDestCacheWeightKilobytes,
kzgTrustedSetupFilePath != null
? Optional.ofNullable(Path.of(kzgTrustedSetupFilePath))
: Optional.empty());
return new EvmConfiguration(jumpDestCacheWeightKilobytes);
}

@Override
Expand Down
1 change: 0 additions & 1 deletion besu/src/test/resources/everything_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,3 @@ Xp2p-tls-crl-file="none.file"

#contracts
Xevm-jumpdest-cache-weight-kb=32000
evm-kzg-trusted-setup-path="/tmp/trusted_setup.txt"
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ allprojects {
}
maven {
url 'https://artifacts.consensys.net/public/maven/maven/'
content { includeGroupByRegex('tech\\.pegasys.*') }
content { includeGroupByRegex('tech\\.pegasys(\\..*)?') }
}
maven {
url 'https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/'
Expand Down
5 changes: 0 additions & 5 deletions ethereum/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

apply plugin: 'java-library'

repositories {
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}

jar {
archiveBaseName = 'besu-core'
manifest {
Expand Down Expand Up @@ -58,7 +54,6 @@ dependencies {
implementation 'org.apache.tuweni:tuweni-concurrent'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'org.apache.tuweni:tuweni-rlp'
implementation 'tech.pegasys:jc-kzg-4844:0.1.0'
implementation 'org.hyperledger.besu:bls12-381'
implementation 'org.immutables:value-annotations'

Expand Down
6 changes: 1 addition & 5 deletions evm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jar {
}
}

repositories {
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}
dependencies {
api 'org.slf4j:slf4j-api'

Expand All @@ -46,10 +43,9 @@ dependencies {
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.hyperledger.besu:arithmetic'
implementation 'org.hyperledger.besu:bls12-381'
implementation 'tech.pegasys:jc-kzg-4844:0.1.0'
implementation 'net.java.dev.jna:jna'
implementation 'com.github.ben-manes.caffeine:caffeine'

implementation 'tech.pegasys:jc-kzg-4844'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'info.picocli:picocli'
testImplementation 'junit:junit'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@

package org.hyperledger.besu.evm.internal;

import java.nio.file.Path;
import java.util.Optional;

public class EvmConfiguration {
public static final EvmConfiguration DEFAULT = new EvmConfiguration(32_000L, Optional.empty());
public static final EvmConfiguration DEFAULT = new EvmConfiguration(32_000L);
private final long jumpDestCacheWeightKB;

private final Optional<Path> kzgTrustedSetupPath;

public EvmConfiguration(
final long jumpDestCacheWeightKB, final Optional<Path> pathToKZGTrustedSetup) {
public EvmConfiguration(final long jumpDestCacheWeightKB) {
this.jumpDestCacheWeightKB = jumpDestCacheWeightKB;
this.kzgTrustedSetupPath = pathToKZGTrustedSetup;
}

/**
Expand All @@ -38,8 +31,4 @@ public EvmConfiguration(
public long getJumpDestCacheWeightBytes() {
return jumpDestCacheWeightKB * 1024L;
}

public Optional<Path> getKzgTrustedSetupPath() {
return this.kzgTrustedSetupPath;
}
}