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

Contract validator throws an error after London hard fork #3883

Closed
rymuff opened this issue May 23, 2022 · 2 comments
Closed

Contract validator throws an error after London hard fork #3883

rymuff opened this issue May 23, 2022 · 2 comments
Assignees
Labels
TeamGroot GH issues worked on by Groot Team

Comments

@rymuff
Copy link

rymuff commented May 23, 2022

Description

Contract validator throw error after London hard fork

Steps to Reproduce (Bug)

  1. Generate genesis.json from example: https://besu.hyperledger.org/en/stable/HowTo/Configure/Consensus-Protocols/QBFT/#genesis-file
  2. Add London block config
{
  "config": {
    "chainid": 1337,
    ...
    "byzantiumBlock": 0,
    "londonBlock": 0,
    ...
  1. Run node

Actual behavior:

2022-05-23 10:34:50.677+09:00 | main | ERROR | Runner | unable to start main loop
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Failed validator smart contract call
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2055)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3966)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4863)
	at org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider.getValidatorsFromContract(TransactionValidatorProvider.java:78)
	at org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider.getValidatorsAfterBlock(TransactionValidatorProvider.java:63)
	at org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider.getValidatorsAfterBlock(ForkingValidatorProvider.java:58)
	at org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider.getValidatorsAtHead(ForkingValidatorProvider.java:52)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState.getValidators(BftFinalState.java:69)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState.isLocalNodeValidator(BftFinalState.java:85)
	at org.hyperledger.besu.consensus.qbft.statemachine.QbftBlockHeightManagerFactory.create(QbftBlockHeightManagerFactory.java:48)
	at org.hyperledger.besu.consensus.qbft.statemachine.QbftController.createNewHeightManager(QbftController.java:105)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BaseBftController.startNewHeightManager(BaseBftController.java:176)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BaseBftController.start(BaseBftController.java:68)
	at org.hyperledger.besu.consensus.common.bft.blockcreation.BftMiningCoordinator.start(BftMiningCoordinator.java:81)
	at org.hyperledger.besu.Runner.startEthereumMainLoop(Runner.java:143)
	at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:1420)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172)
	at picocli.CommandLine.parseWithHandlers(CommandLine.java:2559)
	at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:54)
	at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31)
	at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172)
	at picocli.CommandLine.parseWithHandlers(CommandLine.java:2559)
	at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1576)
	at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1384)
	at org.hyperledger.besu.Besu.main(Besu.java:49)
Caused by: java.lang.IllegalStateException: Failed validator smart contract call
	at org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController.decodeResult(ValidatorContractController.java:94)
	at org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController.parseGetValidatorsResult(ValidatorContractController.java:63)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController.getValidators(ValidatorContractController.java:57)
	at org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider.lambda$getValidatorsFromContract$0(TransactionValidatorProvider.java:81)
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4868)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
	... 29 more
Startup failed

Versions (Add all that apply)

  • Software version: besu/v22.4.1/osx-aarch_64/openjdk-java-18
  • Java version: openjdk version "18.0.1" 2022-04-19
  • OS Name & Version: macOs Monterey 12.4
  • Kernel Version: Darwin MBP 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
  • Virtual Machine software & version: N/A
  • Docker Version: N/A
  • Cloud VM, type, size: N/A

Smart contract information

From example: https://besu.hyperledger.org/en/stable/HowTo/Configure/Consensus-Protocols/QBFT/#genesis-file

Additional Information

2022-05-23 11:03:49.032+09:00 | EthScheduler-Workers-0 | INFO  | PersistBlockTask | Imported #1 / 0 tx / 0 om / 0 (0.0%) gas / (0x5235ab9188cd4c7adc0be96fcf9d3516c7b1452e9b6ba758ecdf21ade5f041cf) in 0.004s. Peers: 3
2022-05-23 11:03:53.046+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #2 / 0 tx / 0 pending / 0 (0.0%) gas / (0xe51009b465d7108fed3d1cc6d73acddadf5f43d217cfbfc1f7e2ee2bbdba344d)
2022-05-23 11:03:58.039+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #3 / 0 tx / 0 pending / 0 (0.0%) gas / (0x7fc11dbc152f64b48bc88333c5be2f6106d58fd9a72932f3c293f4601f64aa5b)
2022-05-23 11:04:03.045+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Produced #4 / 0 tx / 0 pending / 0 (0.0%) gas / (0x60cc86db6c6a25bee67740d40ad458a1957afc84e6155d406ac04b4364829aeb)
2022-05-23 11:04:08.026+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #5 / 0 tx / 0 pending / 0 (0.0%) gas / (0xa1e33a360d0a7e0eb77bef2fb070a6a0ea62bb18bdebb50a772376161703dc26)
2022-05-23 11:04:13.030+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #6 / 0 tx / 0 pending / 0 (0.0%) gas / (0x656851cf0eadf6afae8c0739e90fd6d3ba6057d3008c4d244da3924e579c6a57)
2022-05-23 11:04:18.032+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #7 / 0 tx / 0 pending / 0 (0.0%) gas / (0xde19806c39268653bedd5f4a6d48ed784b8d6832efcd35ae7cb66d4d2e318ccf)
2022-05-23 11:04:18.032+09:00 | EthScheduler-Workers-2 | INFO  | PersistBlockTask | Imported #7 / 0 tx / 0 om / 0 (0.0%) gas / (0xde19806c39268653bedd5f4a6d48ed784b8d6832efcd35ae7cb66d4d2e318ccf) in 0.000s. Peers: 3
2022-05-23 11:04:23.027+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Produced #8 / 0 tx / 0 pending / 0 (0.0%) gas / (0x03d1d90406038718d9f1993676096745a361295466815ee4cdd2f928f9736d8a)
2022-05-23 11:04:28.026+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #9 / 0 tx / 0 pending / 0 (0.0%) gas / (0x4e2d36b8e9ceb1ce6acc704c6de0ff4d61fc5d91e0a254761d6ecbd77df0301c)

When block number reach 10, it crushed with below error.

2022-05-23 11:04:33.026+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | PeerDiscoveryAgent | Writing node record to disk. NodeRecord{seq=2, publicKey=0x030ae14a8d89da070cd4e6e24e6e9b6e01aca1f7c7a01a8d2db4bc943980103892, udpAddress=Optional[/127.0.0.1:30303], tcpAddress=Optional[/127.0.0.1:30303], asBase64=-Je4QNo2rhcUoQ_JWWCucWELW3lAB2fK5-q9OOPIsmGODXNsXob_dPPBuCHttoYPD9xaAfUBSosZeQNrhOJkGjCPYEoCg2V0aMfGhHohrNGAgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQMK4UqNidoHDNTm4k5um24BrKH3x6AajS20vJQ5gBA4koN0Y3CCdl-DdWRwgnZf, nodeId=0x38a267d40301bad175041df81849c3ccc003b242adb0f3f34fed6edb2952d484, customFields={tcp=30303, udp=30303, ip=0x7f000001, eth=[[0x7a21acd1, 0x]], id=V4, secp256k1=0x030ae14a8d89da070cd4e6e24e6e9b6e01aca1f7c7a01a8d2db4bc943980103892}}
2022-05-23 11:04:33.027+09:00 | BftProcessorExecutor-QBFT-0 | INFO  | QbftBesuControllerBuilder | Imported #10 / 0 tx / 0 pending / 0 (0.0%) gas / (0x83aa182e51b6e3e21dd26ff0cbfd55707a8f650143a31d54ce1a95417dc5fd09)
2022-05-23 11:04:33.031+09:00 | BftProcessorExecutor-QBFT-0 | ERROR | EventMultiplexer | State machine threw exception while processing event \{NewChainHead{New Chain Head Header=BlockHeader{hash=0x83aa182e51b6e3e21dd26ff0cbfd55707a8f650143a31d54ce1a95417dc5fd09, parentHash=0x4e2d36b8e9ceb1ce6acc704c6de0ff4d61fc5d91e0a254761d6ecbd77df0301c, ommersHash=0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347, coinbase=0xbb533b9305d14c838e203c309d34a4f8985e133c, stateRoot=0x2b74479b6c28ca5734f16e8a3bba687e2a77dab93c6dca0e3462262a60c72e49, transactionsRoot=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, receiptsRoot=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, logsBloom=0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, difficulty=0x0000000000000000000000000000000000000000000000000000000000000001, number=10, gasLimit=1400000000, gasUsed=0, timestamp=1653271473, extraData=0xf8efa00000000000000000000000000000000000000000000000000000000000000000c0c080f8c9b8419b2b4d64defaebb161717865b5fe1be19b7ecb7a12e3fa6ea54fff1ae7cd1f010a2f7f726d68493f20403a18f41420cc2b0a47f53c9f1a943506aa81cca1e7f100b841747354ece2c981968ea866db6010ffd7272333a46dda83685bcacfd16fd46378026be070d9d7db6db9e9981d48d7c64339a32c164dfc113845cea60f3350c33c01b841e378ff0b44f4e9cccea958108cdfdefed7dc33772dac02bfab47c2031a22ee900667cae2d9868a77e5b237aa9b0481b94bab7c613f503cf6bd9c0c04eaf0b30a00, baseFee=0x000000000000000000000000000000000000000000000000000000003b9aca00, mixHashOrPrevRandao=0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365, nonce=0}}\}
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Failed validator smart contract call
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2055)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3966)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4863)
	at org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider.getValidatorsFromContract(TransactionValidatorProvider.java:78)
	at org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider.getValidatorsAfterBlock(TransactionValidatorProvider.java:63)
	at org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider.getValidatorsAfterBlock(ForkingValidatorProvider.java:58)
	at org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider.getValidatorsAtHead(ForkingValidatorProvider.java:52)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState.getValidators(BftFinalState.java:69)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState.isLocalNodeValidator(BftFinalState.java:85)
	at org.hyperledger.besu.consensus.qbft.statemachine.QbftBlockHeightManagerFactory.create(QbftBlockHeightManagerFactory.java:48)
	at org.hyperledger.besu.consensus.qbft.statemachine.QbftController.createNewHeightManager(QbftController.java:105)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BaseBftController.startNewHeightManager(BaseBftController.java:176)
	at org.hyperledger.besu.consensus.common.bft.statemachine.BaseBftController.handleNewBlockEvent(BaseBftController.java:136)
	at org.hyperledger.besu.consensus.common.bft.EventMultiplexer.handleBftEvent(EventMultiplexer.java:50)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at org.hyperledger.besu.consensus.common.bft.BftProcessor.run(BftProcessor.java:60)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: Failed validator smart contract call
	at org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController.decodeResult(ValidatorContractController.java:94)
	at org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController.parseGetValidatorsResult(ValidatorContractController.java:63)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController.getValidators(ValidatorContractController.java:57)
	at org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider.lambda$getValidatorsFromContract$0(TransactionValidatorProvider.java:81)
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4868)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
	... 18 more
@jframe jframe added the TeamGroot GH issues worked on by Groot Team label May 23, 2022
@rymuff rymuff changed the title Contract validator throw error after London hard fork Contract validator throws an error after London hard fork May 23, 2022
@siladu siladu self-assigned this Jun 14, 2022
@siladu
Copy link
Contributor

siladu commented Jun 22, 2022

Hi @rymuff, apologies for the slow response.
Assuming you are running a free gas network, can you please try adding "baseFeePerGas": "0x0" at the top level of the genesis file, for example:

{
  "config": {
    ...
    "londonBlock": 0,
    ...
  },
  "baseFeePerGas": "0x0",
  "nonce": "0x0",
  ...
}

@rymuff
Copy link
Author

rymuff commented Jun 22, 2022

@siladu, Problem solved! Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TeamGroot GH issues worked on by Groot Team
Projects
None yet
Development

No branches or pull requests

3 participants