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

Index out of Bounds on Yolo #1122

Closed
MariusVanDerWijden opened this issue Jun 22, 2020 · 1 comment · Fixed by #1125
Closed

Index out of Bounds on Yolo #1122

MariusVanDerWijden opened this issue Jun 22, 2020 · 1 comment · Fixed by #1125
Assignees
Labels
bug Something isn't working P1 Very High (ex: Security issues, unplanned backward incompatibility preventing network participation)

Comments

@MariusVanDerWijden
Copy link

Hey,
I've been fuzzing yolo with interesting test vectors and came across the following crasher.
The problem is, that the index of the discount table is too long, so an index out of bounds exception is thrown when you call BLS12_G1MULTIEXP (probably the same with BLS12_G2MULTIEXP).

Steps to Reproduce (Bug)

  1. ./bin/besu --network=YOLO_V1 --Xberlin-enabled=true

Additional Information

2020-06-22 13:33:29.851+02:00 | nioEventLoopGroup-3-7 | INFO  | SyncTargetManager | Found common ancestor with peer 0x5184686aff39fac76a... at block 45119
2020-06-22 13:33:29.926+02:00 | EthScheduler-Services-30 (importBlock) | ERROR | PipelineChainDownloader | Chain download failed. Restarting after short delay.
java.util.concurrent.CompletionException: java.lang.ArrayIndexOutOfBoundsException: Index 129 out of bounds for length 129
	at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:367) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:376) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:1093) ~[?:?]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2152) ~[?:?]
	at org.hyperledger.besu.services.pipeline.Pipeline.abort(Pipeline.java:152) ~[besu-pipeline-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.services.pipeline.Pipeline.lambda$runWithErrorHandling$3(Pipeline.java:134) ~[besu-pipeline-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 129 out of bounds for length 129
	at org.hyperledger.besu.ethereum.mainnet.precompiles.BLS12G1MultiExpPrecompiledContract.gasRequirement(BLS12G1MultiExpPrecompiledContract.java:35) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.MainnetMessageCallProcessor.executePrecompile(MainnetMessageCallProcessor.java:122) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.MainnetMessageCallProcessor.start(MainnetMessageCallProcessor.java:61) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.AbstractMessageProcessor.process(AbstractMessageProcessor.java:167) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor.process(MainnetTransactionProcessor.java:407) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor.processTransaction(MainnetTransactionProcessor.java:330) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor.processTransaction(MainnetTransactionProcessor.java:47) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.TransactionProcessor.processTransaction(TransactionProcessor.java:143) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.AbstractBlockProcessor.processBlock(AbstractBlockProcessor.java:137) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.AbstractBlockProcessor.processBlock(AbstractBlockProcessor.java:37) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.BlockProcessor.processBlock(BlockProcessor.java:60) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.MainnetBlockValidator.validateAndProcessBlock(MainnetBlockValidator.java:88) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.mainnet.MainnetBlockImporter.importBlock(MainnetBlockImporter.java:45) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.core.BlockImporter.importBlock(BlockImporter.java:44) ~[besu-core-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.eth.sync.fullsync.FullImportBlockStep.accept(FullImportBlockStep.java:56) ~[besu-eth-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.ethereum.eth.sync.fullsync.FullImportBlockStep.accept(FullImportBlockStep.java:30) ~[besu-eth-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.services.pipeline.CompleterStage.run(CompleterStage.java:37) ~[besu-pipeline-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	at org.hyperledger.besu.services.pipeline.Pipeline.lambda$runWithErrorHandling$3(Pipeline.java:130) ~[besu-pipeline-1.4.7-SNAPSHOT.jar:1.4.7-dev-4523d591]
	... 5 more
@matkt matkt self-assigned this Jun 22, 2020
@timbeiko timbeiko added bug Something isn't working P1 Very High (ex: Security issues, unplanned backward incompatibility preventing network participation) labels Jun 22, 2020
@matkt matkt linked a pull request Jun 22, 2020 that will close this issue
@matkt
Copy link
Contributor

matkt commented Jun 22, 2020

Thank you for your analysis. The bug is fixed and you can now launch besu with this command to start a fullsunc --network=YOLO_V1 --Xberlin-enabled=true --sync-mode=FULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Very High (ex: Security issues, unplanned backward incompatibility preventing network participation)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants