Nullpointer during snapsync "because taskElement is null" #6113
Open
Description
Description
There is an issue when we receive data but the proof is invalid. We still try to retrieve the child tasks even though the stacktrie has not been modified due to the invalid proof. We should not only verify that we have retrieved data, but also check that the data is valid before trying to retrieve child request.
2023-11-01 18:39:01.848+00:00 | EthScheduler-Services-43 (importBlock) | INFO | FastImportBlocksStep | Block import progress: 12158784 of 18477974 (65%)
2023-11-01 18:39:34.237+00:00 | EthScheduler-Services-13 (batchPersistLargeStorageData) | INFO | Pipeline | Unexpected exception in pipeline. Aborting.
java.lang.NullPointerException: Cannot invoke "org.hyperledger.besu.ethereum.eth.sync.snapsync.StackTrie$TaskElement.proofs()" because "taskElement" is null
at org.hyperledger.besu.ethereum.eth.sync.snapsync.request.StorageRangeDataRequest.getChildRequests(StorageRangeDataRequest.java:166)
at org.hyperledger.besu.ethereum.eth.sync.snapsync.PersistDataStep.persist(PersistDataStep.java:51)
at org.hyperledger.besu.ethereum.eth.sync.snapsync.SnapWorldStateDownloadProcess$Builder.lambda$build$13(SnapWorldStateDownloadProcess.java:314)
at org.hyperledger.besu.services.pipeline.MapProcessor.processNextInput(MapProcessor.java:31)
at org.hyperledger.besu.services.pipeline.ProcessingStage.run(ProcessingStage.java:38)
at org.hyperledger.besu.services.pipeline.Pipeline.lambda$runWithErrorHandling$3(Pipeline.java:169)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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)
2023-11-01 18:39:45.599+00:00 | EthScheduler-Services-43 (importBlock) | INFO | FastImportBlocksStep | Block import progress: 12159184 of 18477974 (65%)