0

我正在尝试在 Corda 流中实例化和签署 protobuf 消息;原始交易由 JavaScript 客户端创建,编码为 base64,并提交给 Corda。Corda 节点解码、签名并转发到公共网络。

交易、签名和批准工作正常(它实际上在公共网络中执行),但是在返回结果时它会失败并出现附加错误。

是否有任何机制可以在不破坏 [FiberDeserializationChecker] 的情况下反序列化 protobuf 事务?

先感谢您!

Thu Mar 25 16:43:10 UTC 2021>>> on: java.io.InvalidObjectException: Deserialization via serialization delegate
Serialization trace:
validStart (com.hedera.hashgraph.sdk.TransactionId)
transactionIds (com.hedera.hashgraph.sdk.TokenAssociateTransaction)
associateTxn (net.aochain.corda.nodes.hederaTxn.AssociateTokenFlow)
logic (net.corda.node.services.statemachine.FlowStateMachineImpl)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:144)
        at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:145)
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readClassAndObject(ReplaceableObjectKryo.java:112)
        at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134)
        at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readObject(ReplaceableObjectKryo.java:92)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
        at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:145)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readObject(ReplaceableObjectKryo.java:92)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
        at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:145)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readObject(ReplaceableObjectKryo.java:92)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543)
        at co.paralleluniverse.fibers.Fiber$FiberSerializer.read(Fiber.java:2156)
        at co.paralleluniverse.fibers.Fiber$FiberSerializer.read(Fiber.java:2086)
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readClassAndObject(ReplaceableObjectKryo.java:112)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer$deserialize$1$1.invoke(KryoCheckpointSerializer.kt:92)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer$deserialize$1$1.invoke(KryoCheckpointSerializer.kt:42)
        at net.corda.nodeapi.internal.serialization.kryo.KryoStreams.kryoInput(KryoStreams.kt:20)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer$deserialize$1.invoke(KryoCheckpointSerializer.kt:81)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer$deserialize$1.invoke(KryoCheckpointSerializer.kt:42)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer$kryo$1.execute(KryoCheckpointSerializer.kt:70)
        at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:58)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer.kryo(KryoCheckpointSerializer.kt:66)
        at net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer.deserialize(KryoCheckpointSerializer.kt:80)
        at net.corda.node.services.statemachine.interceptors.FiberDeserializationChecker$start$2.invoke(FiberDeserializationCheckingInterceptor.kt:103)
        at net.corda.node.services.statemachine.interceptors.FiberDeserializationChecker$start$2.invoke(FiberDeserializationCheckingInterceptor.kt:53)
        at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
Caused by: java.lang.RuntimeException: java.io.InvalidObjectException: Deserialization via serialization delegate
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.getReplacement(ReplaceableObjectKryo.java:129)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readReplace(ReplaceableObjectKryo.java:118)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.readObjectOrNull(ReplaceableObjectKryo.java:107)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:132)
        ... 33 more
Caused by: java.io.InvalidObjectException: Deserialization via serialization delegate
        at org.threeten.bp.Instant.readResolve(Instant.java:1176)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at co.paralleluniverse.io.serialization.kryo.ReplaceableObjectKryo.getReplacement(ReplaceableObjectKryo.java:125)
4

2 回答 2

0

来自马特·内斯比特@R3:

他们的流检查点包括不可 kryo (de)serialisable 的对象。很可能他们需要隐藏可能由 CordaService 持有的 SingletonSerialiseAsToken 派生对象后面的任何静态/本机方法。

这可能包括他们的 protobuf 序列化器,但从这个小信息中可以看出任何东西,因为它们似乎也包括 Hedera Hashgraph

如果您可以在 slack.corda.net 上分享更多信息或向我发送信息,我可以帮助您获得更多信息

于 2021-03-29T16:48:14.683 回答
0

马特和大卫的回复让我走上了正确的道路。

您必须按照此处所述创建一个新类。在我们的例子中,反序列化事件被包含在一个 API 中,当(反)序列化发生时,它会阻止从 Kyro 的读取。

谢谢你们俩!

于 2021-03-30T22:19:47.000 回答