mirror of https://github.com/hyperledger/besu
Evmtool graalvm support (#5192)
Changes and config to support using GraalVM AOT to compile and execute evmTool as an alternate configuration. While not as long-term performant the startup time makes filling reference tests with Besu reasonable. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>pull/5252/head
parent
8ab19bfff8
commit
0f973373f3
@ -0,0 +1,104 @@ |
||||
[ |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.PSMW", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.PSW", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.PSWMS", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.SSLA", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.SSLMSW", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.SSMSW", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "com.github.benmanes.caffeine.cache.SSMW", |
||||
"allDeclaredConstructors": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi$ECDSA", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.asymmetric.ec.KeyPairGeneratorSpi", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.asymmetric.ec.KeyPairGeneratorSpi$ECDSA", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.digest.Keccak$Mappings", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.digest.Keccak$Digest256", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.bouncycastle.jcajce.provider.digest.Keccak", |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.hyperledger.besu.ethereum.referencetests.ReferenceTestEnv", |
||||
"queryAllPublicConstructors" : true, |
||||
"queryAllPublicMethods" : true, |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.hyperledger.besu.ethereum.referencetests.ReferenceTestEnv$EnvWithdrawal", |
||||
"queryAllPublicConstructors" : true, |
||||
"queryAllPublicMethods" : true, |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.hyperledger.besu.ethereum.referencetests.ReferenceTestWorldState", |
||||
"queryAllPublicConstructors" : true, |
||||
"queryAllPublicMethods" : true, |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.hyperledger.besu.ethereum.referencetests.ReferenceTestWorldState$AccountMock", |
||||
"queryAllPublicConstructors" : true, |
||||
"queryAllPublicMethods" : true, |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.hyperledger.besu.ethereum.referencetests.BlockchainReferenceTestCaseSpec$ReferenceTestBlockHeader", |
||||
"queryAllPublicConstructors" : true, |
||||
"queryAllPublicMethods" : true, |
||||
"allDeclaredConstructors": true, |
||||
"allPublicMethods": true |
||||
}, |
||||
{ |
||||
"name": "org.hyperledger.besu.evm.internal.ReturnStack$ReturnStackItem[]", |
||||
"unsafeAllocated": true |
||||
} |
||||
] |
@ -1,55 +0,0 @@ |
||||
/* |
||||
* Copyright 2018 ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
* |
||||
*/ |
||||
package org.hyperledger.besu.evmtool; |
||||
|
||||
import org.hyperledger.besu.config.GenesisConfigOptions; |
||||
import org.hyperledger.besu.consensus.clique.CliqueBlockHeaderFunctions; |
||||
import org.hyperledger.besu.consensus.clique.CliqueProtocolSchedule; |
||||
import org.hyperledger.besu.crypto.KeyPairSecurityModule; |
||||
import org.hyperledger.besu.crypto.NodeKey; |
||||
import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; |
||||
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; |
||||
import org.hyperledger.besu.ethereum.mainnet.HeaderBasedProtocolSchedule; |
||||
import org.hyperledger.besu.evm.internal.EvmConfiguration; |
||||
|
||||
import java.util.Optional; |
||||
import javax.inject.Named; |
||||
|
||||
class CliqueGenesisFileModule extends GenesisFileModule { |
||||
|
||||
private final NodeKey nodeKey = |
||||
new NodeKey( |
||||
new KeyPairSecurityModule(SignatureAlgorithmFactory.getInstance().generateKeyPair())); |
||||
|
||||
CliqueGenesisFileModule(final String genesisConfig) { |
||||
super(genesisConfig); |
||||
} |
||||
|
||||
@Override |
||||
HeaderBasedProtocolSchedule provideProtocolSchedule( |
||||
final GenesisConfigOptions configOptions, |
||||
@Named("Fork") final Optional<String> fork, |
||||
@Named("RevertReasonEnabled") final boolean revertReasonEnabled) { |
||||
// dagger can handle this magic one day
|
||||
return CliqueProtocolSchedule.create( |
||||
configOptions, nodeKey, revertReasonEnabled, EvmConfiguration.DEFAULT); |
||||
} |
||||
|
||||
@Override |
||||
BlockHeaderFunctions blockHashFunction() { |
||||
return new CliqueBlockHeaderFunctions(); |
||||
} |
||||
} |
@ -1,54 +0,0 @@ |
||||
/* |
||||
* Copyright ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
* |
||||
*/ |
||||
package org.hyperledger.besu.evmtool; |
||||
|
||||
import org.hyperledger.besu.config.BftConfigOptions; |
||||
import org.hyperledger.besu.config.GenesisConfigOptions; |
||||
import org.hyperledger.besu.consensus.common.ForksSchedule; |
||||
import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; |
||||
import org.hyperledger.besu.consensus.ibft.IbftExtraDataCodec; |
||||
import org.hyperledger.besu.consensus.ibft.IbftForksSchedulesFactory; |
||||
import org.hyperledger.besu.consensus.ibft.IbftProtocolSchedule; |
||||
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; |
||||
import org.hyperledger.besu.ethereum.mainnet.HeaderBasedProtocolSchedule; |
||||
import org.hyperledger.besu.evm.internal.EvmConfiguration; |
||||
|
||||
import java.util.Optional; |
||||
import javax.inject.Named; |
||||
|
||||
class IBFTGenesisFileModule extends GenesisFileModule { |
||||
final IbftExtraDataCodec bftExtraDataEncoder = new IbftExtraDataCodec(); |
||||
|
||||
IBFTGenesisFileModule(final String genesisConfig) { |
||||
super(genesisConfig); |
||||
} |
||||
|
||||
@Override |
||||
HeaderBasedProtocolSchedule provideProtocolSchedule( |
||||
final GenesisConfigOptions configOptions, |
||||
@Named("Fork") final Optional<String> fork, |
||||
@Named("RevertReasonEnabled") final boolean revertReasonEnabled) { |
||||
final ForksSchedule<BftConfigOptions> forksSchedule = |
||||
IbftForksSchedulesFactory.create(configOptions); |
||||
return IbftProtocolSchedule.create( |
||||
configOptions, forksSchedule, bftExtraDataEncoder, EvmConfiguration.DEFAULT); |
||||
} |
||||
|
||||
@Override |
||||
BlockHeaderFunctions blockHashFunction() { |
||||
return BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataEncoder); |
||||
} |
||||
} |
@ -1,53 +0,0 @@ |
||||
/* |
||||
* Copyright Hyperledger Besu Contributors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.evmtool; |
||||
|
||||
import org.hyperledger.besu.config.GenesisConfigOptions; |
||||
import org.hyperledger.besu.config.QbftConfigOptions; |
||||
import org.hyperledger.besu.consensus.common.ForksSchedule; |
||||
import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; |
||||
import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; |
||||
import org.hyperledger.besu.consensus.qbft.QbftForksSchedulesFactory; |
||||
import org.hyperledger.besu.consensus.qbft.QbftProtocolSchedule; |
||||
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; |
||||
import org.hyperledger.besu.ethereum.mainnet.HeaderBasedProtocolSchedule; |
||||
|
||||
import java.util.Optional; |
||||
import javax.inject.Named; |
||||
|
||||
class QBFTGenesisFileModule extends GenesisFileModule { |
||||
final QbftExtraDataCodec bftExtraDataEncoder; |
||||
|
||||
QBFTGenesisFileModule(final String genesisConfig) { |
||||
super(genesisConfig); |
||||
bftExtraDataEncoder = new QbftExtraDataCodec(); |
||||
} |
||||
|
||||
@Override |
||||
HeaderBasedProtocolSchedule provideProtocolSchedule( |
||||
final GenesisConfigOptions configOptions, |
||||
@Named("Fork") final Optional<String> fork, |
||||
@Named("RevertReasonEnabled") final boolean revertReasonEnabled) { |
||||
final ForksSchedule<QbftConfigOptions> forksSchedule = |
||||
QbftForksSchedulesFactory.create(configOptions); |
||||
return QbftProtocolSchedule.create( |
||||
configOptions, forksSchedule, revertReasonEnabled, bftExtraDataEncoder); |
||||
} |
||||
|
||||
@Override |
||||
BlockHeaderFunctions blockHashFunction() { |
||||
return BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataEncoder); |
||||
} |
||||
} |
Loading…
Reference in new issue