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

Web3j 4.9.6 fails to deserialize 'v' field when calling eth_getBlockByNumber or eth_getTransactionByHash #916

Closed
sergioaiobuilders opened this issue Feb 17, 2023 · 2 comments · Fixed by #917
Assignees
Labels
bug Something isn't working good first issue Good for newcomers P2
Milestone

Comments

@sergioaiobuilders
Copy link
Contributor

sergioaiobuilders commented Feb 17, 2023

Description

When making a call to the RPC relay to eth_getBlockByNumber or eth_getTransactionByHash, Web3J fails to serialize the Transaction class due to the 'v' legacy field being a non-nullable Long.
This may also apply in all cases looking at the JSON-RPC Ethereum docs

I've opened a PR changing this to '0x0' instead of null when mapping.
#917

Steps to reproduce

  1. Create a basic repo that uses web3j
  2. Run:
EthBlock ethBlock = web3j.ethGetBlockByNumber(
                DefaultBlockParameter.valueOf(blockNumber), true).send();
  1. It will throw a JsonMappingException (see below)

Additional context

ERROR net.consensys.eventeum.chain.service.strategy.AbstractBlockSubscriptionStrategy: onError - There was an error when processing a block, disposing blocksubscription (will be reinitialised)
com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"]) (through reference chain: org.web3j.protocol.core.methods.response.EthBlock["result"]->org.web3j.protocol.core.methods.response.EthBlock$Block["transactions"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:392)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:351)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1821)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:315)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:2025)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1175)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1193)
	at org.web3j.protocol.core.methods.response.EthBlock$ResponseDeserialiser.deserialize(EthBlock.java:714)
	at org.web3j.protocol.core.methods.response.EthBlock$ResponseDeserialiser.deserialize(EthBlock.java:705)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3666)
	at org.web3j.protocol.Service.send(Service.java:50)
	at org.web3j.protocol.core.Request.send(Request.java:87)
	at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:42)
	at io.reactivex.internal.operators.flowable.FlowableFromCallable.call(FlowableFromCallable.java:55)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:143)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:68)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:68)
	at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.drain(FlowableCreate.java:547)
	at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.onNext(FlowableCreate.java:471)
	at org.web3j.utils.Flowables.lambda$range$0(Flowables.java:51)
	at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:71)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap.subscribeActual(FlowableFlatMap.java:53)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray$ConcatArraySubscriber.onComplete(FlowableConcatArray.java:140)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray.subscribeActual(FlowableConcatArray.java:40)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:288)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:253)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.fasterxml.jackson.databind.RuntimeJsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"])
	at com.fasterxml.jackson.databind.MappingIterator._handleMappingException(MappingIterator.java:416)
	at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:201)
	at org.web3j.protocol.core.methods.response.EthBlock$ResultTransactionDeserialiser.deserialize(EthBlock.java:689)
	at org.web3j.protocol.core.methods.response.EthBlock$ResultTransactionDeserialiser.deserialize(EthBlock.java:672)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	... 45 common frames omitted
Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:276)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:623)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.MappingIterator.nextValue(MappingIterator.java:283)
	at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:199)
	... 49 common frames omitted
Caused by: java.lang.NullPointerException: null
	at org.web3j.protocol.core.methods.response.Transaction.setV(Transaction.java:313)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141)
	... 53 common frames omitted
io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"]) (through reference chain: org.web3j.protocol.core.methods.response.EthBlock["result"]->org.web3j.protocol.core.methods.response.EthBlock$Block["transactions"])
	at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
	at io.reactivex.internal.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:85)
	at io.reactivex.internal.operators.flowable.FlowableDoOnEach$DoOnEachSubscriber.onError(FlowableDoOnEach.java:111)
	at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.onError(FlowableSubscribeOn.java:102)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray$ConcatArraySubscriber.onError(FlowableConcatArray.java:91)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.checkTerminate(FlowableFlatMap.java:572)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.drainLoop(FlowableFlatMap.java:379)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.drain(FlowableFlatMap.java:371)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:147)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:68)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:68)
	at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.drain(FlowableCreate.java:547)
	at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.onNext(FlowableCreate.java:471)
	at org.web3j.utils.Flowables.lambda$range$0(Flowables.java:51)
	at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:71)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap.subscribeActual(FlowableFlatMap.java:53)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray$ConcatArraySubscriber.onComplete(FlowableConcatArray.java:140)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray.subscribeActual(FlowableConcatArray.java:40)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:288)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:253)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"]) (through reference chain: org.web3j.protocol.core.methods.response.EthBlock["result"]->org.web3j.protocol.core.methods.response.EthBlock$Block["transactions"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:392)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:351)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1821)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:315)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:2025)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1175)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1193)
	at org.web3j.protocol.core.methods.response.EthBlock$ResponseDeserialiser.deserialize(EthBlock.java:714)
	at org.web3j.protocol.core.methods.response.EthBlock$ResponseDeserialiser.deserialize(EthBlock.java:705)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3666)
	at org.web3j.protocol.Service.send(Service.java:50)
	at org.web3j.protocol.core.Request.send(Request.java:87)
	at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:42)
	at io.reactivex.internal.operators.flowable.FlowableFromCallable.call(FlowableFromCallable.java:55)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:143)
	... 27 more
Caused by: com.fasterxml.jackson.databind.RuntimeJsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"])
	at com.fasterxml.jackson.databind.MappingIterator._handleMappingException(MappingIterator.java:416)
	at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:201)
	at org.web3j.protocol.core.methods.response.EthBlock$ResultTransactionDeserialiser.deserialize(EthBlock.java:689)
	at org.web3j.protocol.core.methods.response.EthBlock$ResultTransactionDeserialiser.deserialize(EthBlock.java:672)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	... 45 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:276)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:623)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.MappingIterator.nextValue(MappingIterator.java:283)
	at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:199)
	... 49 more
Caused by: java.lang.NullPointerException
	at org.web3j.protocol.core.methods.response.Transaction.setV(Transaction.java:313)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141)
	... 53 more
Exception in thread "pool-2-thread-1" io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"]) (through reference chain: org.web3j.protocol.core.methods.response.EthBlock["result"]->org.web3j.protocol.core.methods.response.EthBlock$Block["transactions"])
	at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
	at io.reactivex.internal.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:85)
	at io.reactivex.internal.operators.flowable.FlowableDoOnEach$DoOnEachSubscriber.onError(FlowableDoOnEach.java:111)
	at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.onError(FlowableSubscribeOn.java:102)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray$ConcatArraySubscriber.onError(FlowableConcatArray.java:91)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.checkTerminate(FlowableFlatMap.java:572)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.drainLoop(FlowableFlatMap.java:379)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.drain(FlowableFlatMap.java:371)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:147)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:68)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:68)
	at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.drain(FlowableCreate.java:547)
	at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.onNext(FlowableCreate.java:471)
	at org.web3j.utils.Flowables.lambda$range$0(Flowables.java:51)
	at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:71)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap.subscribeActual(FlowableFlatMap.java:53)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray$ConcatArraySubscriber.onComplete(FlowableConcatArray.java:140)
	at io.reactivex.internal.operators.flowable.FlowableConcatArray.subscribeActual(FlowableConcatArray.java:40)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:288)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:253)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"]) (through reference chain: org.web3j.protocol.core.methods.response.EthBlock["result"]->org.web3j.protocol.core.methods.response.EthBlock$Block["transactions"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:392)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:351)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1821)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:315)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:2025)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1175)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1193)
	at org.web3j.protocol.core.methods.response.EthBlock$ResponseDeserialiser.deserialize(EthBlock.java:714)
	at org.web3j.protocol.core.methods.response.EthBlock$ResponseDeserialiser.deserialize(EthBlock.java:705)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3666)
	at org.web3j.protocol.Service.send(Service.java:50)
	at org.web3j.protocol.core.Request.send(Request.java:87)
	at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:42)
	at io.reactivex.internal.operators.flowable.FlowableFromCallable.call(FlowableFromCallable.java:55)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:143)
	... 27 more
Caused by: com.fasterxml.jackson.databind.RuntimeJsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"])
	at com.fasterxml.jackson.databind.MappingIterator._handleMappingException(MappingIterator.java:416)
	at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:201)
	at org.web3j.protocol.core.methods.response.EthBlock$ResultTransactionDeserialiser.deserialize(EthBlock.java:689)
	at org.web3j.protocol.core.methods.response.EthBlock$ResultTransactionDeserialiser.deserialize(EthBlock.java:672)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	... 45 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A
 at [Source: (ByteArrayInputStream); line: 1, column: 2832] (through reference chain: org.web3j.protocol.core.methods.response.EthBlock$TransactionObject["v"])
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:276)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:623)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
	at com.fasterxml.jackson.databind.MappingIterator.nextValue(MappingIterator.java:283)
	at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:199)
	... 49 more
Caused by: java.lang.NullPointerException
	at org.web3j.protocol.core.methods.response.Transaction.setV(Transaction.java:313)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141)
	... 53 more

Hedera network

testnet

Version

v0.17.1

Operating system

macOS

@Nana-EC
Copy link
Collaborator

Nana-EC commented Feb 17, 2023

Thanks for opening the issue @sergioaiobuilders
Our goal with the response was to adhere t the execution apis which states that v should be a unit: ^0x([1-9a-f]+[0-9a-f]*|0)$.

Seems like you're right and we missed this.
We'll review the PR which you were kind enough to open. :)

@sergioaiobuilders
Copy link
Contributor Author

Great thanks a lot @Nana-EC!

@github-project-automation github-project-automation bot moved this from In Progress to Done in Smart Contract Sprint Board Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers P2
Projects
Archived in project
2 participants