-
Notifications
You must be signed in to change notification settings - Fork 839
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
Initialize KZG native lib at startup if Cancun is enabled #5084
Conversation
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
# Conflicts: # evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java # evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
… kzg-trusted-setup-param # Conflicts: # CHANGELOG.md # besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java # evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java # evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java
… kzg-trusted-setup-param # Conflicts: # CHANGELOG.md # besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java # evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java # evm/src/test/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompileContractTest.java
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
… kzg-trusted-setup-param
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static class initialization of the mainnet KZG is a hard stop for me. It should be loaded lazily or on-demand.
private static final Bytes successResult; | ||
|
||
static { | ||
CKZG4844JNI.loadNativeLibrary(CKZG4844JNI.Preset.MAINNET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this initialization to a lazy or on-demand initialization.
This will incur a large startup penalty on every CLI call that touches the EVM. This imposes a debilitating penalty on the EVM Tool and will make using Besu in reference tests impractical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense, will move it in the init
methods
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this eliminates the ~2s startup hit I've seen.
…r#5084) Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
…r#5084) Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
…r#5084) Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio fabio.difabio@consensys.net
PR description
Move c-kzg native lib initialization at startup, when all the other native lib are configured, and also because it is not only used by the precompile, but also for transaction validation.
Added the option
--kzg-trusted-setup
to pass a custom setup file for custom networks or to override the default one for named networksFixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Acceptance Tests (Non Mainnet)
./gradlew acceptanceTestNonMainnet
locally if my PR affects non-mainnet modules.Changelog