Hyperledger Besu NullPointerException on permissioning dapp removing a node

37 Views Asked by At

We are using onchain permissioning on a private network with Hyperledger Besu, but when we remove a node, we get a NullPointerException:

ERROR Unhandled exception
java.lang.RuntimeException: Error building payload to call node permissioning smart contract
    at org.hyperledger.besu.ethereum.permissioning.NodeSmartContractV2PermissioningController.createPayload(NodeSmartContractV2PermissioningController.java:110) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.NodeSmartContractV2PermissioningController.getCallResult(NodeSmartContractV2PermissioningController.java:81) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.NodeSmartContractV2PermissioningController.isPermitted(NodeSmartContractV2PermissioningController.java:69) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.NodeSmartContractV2PermissioningController.checkSmartContractRules(NodeSmartContractV2PermissioningController.java:60) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.AbstractNodeSmartContractPermissioningController.isConnectionPermitted(AbstractNodeSmartContractPermissioningController.java:87) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.node.NodePermissioningController.isPermitted(NodePermissioningController.java:98) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.node.PeerPermissionsAdapter.inboundIsPermitted(PeerPermissionsAdapter.java:122) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.permissioning.node.PeerPermissionsAdapter.isPermitted(PeerPermissionsAdapter.java:72) ~[besu-permissioning-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.p2p.permissions.PeerPermissions$CombinedPeerPermissions.isPermitted(PeerPermissions.java:129) ~[besu-p2p-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.p2p.discovery.internal.PeerDiscoveryPermissions.allowInboundNeighborsRequest(PeerDiscoveryPermissions.java:55) ~[besu-p2p-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.p2p.discovery.internal.PeerDiscoveryController.onMessage(PeerDiscoveryController.java:352) ~[besu-p2p-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryAgent.lambda$handleIncomingPacket$5(PeerDiscoveryAgent.java:307) ~[besu-p2p-23.1.2.jar:23.1.2]
    at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
    at org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryAgent.handleIncomingPacket(PeerDiscoveryAgent.java:307) ~[besu-p2p-23.1.2.jar:23.1.2]
    at org.hyperledger.besu.ethereum.p2p.discovery.VertxPeerDiscoveryAgent.lambda$handlePacket$10(VertxPeerDiscoveryAgent.java:297) ~[besu-p2p-23.1.2.jar:23.1.2]
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141) ~[vertx-core-4.2.7.jar:4.2.7]
    at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54) ~[vertx-core-4.2.7.jar:4.2.7]
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) [netty-common-4.1.78.Final.jar:4.1.78.Final]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) [netty-common-4.1.78.Final.jar:4.1.78.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [netty-common-4.1.78.Final.jar:4.1.78.Final]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:391) [netty-transport-classes-epoll-4.1.78.Final.jar:4.1.78.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [netty-common-4.1.78.Final.jar:4.1.78.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.78.Final.jar:4.1.78.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.78.Final.jar:4.1.78.Final]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?]
    at java.util.ImmutableCollections.listFromTrustedArray(ImmutableCollections.java:213) ~[?:?]
    at java.util.List.of(List.java:847) ~[?:?]
    at org.hyperledger.besu.ethereum.permissioning.NodeSmartContractV2PermissioningController.createPayload(NodeSmartContractV2PermissioningController.java:106) ~[besu-permissioning-23.1.2.jar:23.1.2]

The error occurs when the target (removed) node is connected to the other nodes.

We tried 2 different versions of code in the genesis:

https://raw.githubusercontent.com/ConsenSys/permissioning-smart-contracts/e6c2d4d5a728c11cdb8e97a07ddda3c0bfb57b5d/genesis.json

and

https://raw.githubusercontent.com/ConsenSys/permissioning-smart-contracts/main/genesis.json

For the test, we followed the steps from https://besu.hyperledger.org/en/stable/private-networks/tutorials/permissioning/onchain/

0

There are 0 best solutions below