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

Yaci-Store not working and gets stuck on the mainnet reply from genesis with account module enabled #435

Open
matiwinnetou opened this issue Feb 5, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@matiwinnetou
Copy link
Collaborator

matiwinnetou commented Feb 5, 2025

We experience serious troubles with Yaci-Store and it gets stuck on full main-net reply from the genesis block but only with accounts enabled.

On Rosetta, we are experimenting with accounts module in order to actually return withdrawable rewards as per rosetta specification.

We needed to not only add dependency to account module but also configure it:

# enable account store as it seems to be disabled by default in yaci-store
store.account.enabled=true
# enable account api
store.account.api-enabled=true
# disable balance aggregation as this is way too heavy
store.account.balance-aggregation-enabled=false
store.account.stake-address-balance-enabled=true

logs as it gets stuck:

2025-02-05T15:52:40.300Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=5058)
2025-02-05T15:52:50.298Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 820019cccc
2025-02-05T15:52:50.305Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=52428)
2025-02-05T15:53:00.298Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 8200193496
2025-02-05T15:53:00.300Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=13462)
2025-02-05T15:53:10.300Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 820019a456
2025-02-05T15:53:10.300Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=42070)
2025-02-05T15:53:20.301Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 820019de17
2025-02-05T15:53:20.301Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=56855)
2025-02-05T15:53:25.723Z  INFO 1 --- [   scheduling-1] c.b.c.y.s.e.p.LocalEpochParamsScheduler  : Fetching protocol params ....
2025-02-05T15:53:25.837Z  WARN 1 --- [tLoopGroup-23-1] i.netty.channel.DefaultChannelPipeline   : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.

java.lang.NullPointerException: null

2025-02-05T15:53:30.301Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 820019985a
2025-02-05T15:53:30.309Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=39002)
2025-02-05T15:53:36.049Z  WARN 1 --- [ntLoopGroup-5-8] i.netty.channel.DefaultChannelPipeline   : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.

java.net.SocketException: Connection reset
        at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:401) ~[na:na]
        at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:434) ~[na:na]
        at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255) ~[netty-buffer-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[netty-buffer-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2025-02-05T15:53:36.050Z  INFO 1 --- [ntLoopGroup-5-8] c.b.c.yaci.core.network.NodeClient       : Connection closed !!!
2025-02-05T15:53:36.050Z  INFO 1 --- [ntLoopGroup-5-8] c.b.cardano.yaci.core.network.Session    : Disposing the session !!!
2025-02-05T15:53:36.050Z  WARN 1 --- [ntLoopGroup-5-8] c.b.c.yaci.core.network.NodeClient       : Trying to reconnect !!!
2025-02-05T15:53:36.051Z  INFO 1 --- [ntLoopGroup-5-9] c.b.cardano.yaci.core.network.Session    : Connection established
2025-02-05T15:53:36.051Z  INFO 1 --- [ntLoopGroup-5-9] c.b.c.yaci.core.network.NodeClient       : Connected !!!
2025-02-05T15:53:36.054Z  INFO 1 --- [ntLoopGroup-5-9] c.b.c.y.c.p.handshake.HandshakeAgent     : Handshake Ok!!! AcceptVersion(versionNumber=14, versionData=N2NVersionData(initiatorOnlyDiffusionMode=true, peerSharing=0, query=false))
2025-02-05T15:53:36.054Z DEBUG 1 --- [ntLoopGroup-5-9] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 82001904d2
2025-02-05T15:53:36.054Z DEBUG 1 --- [ntLoopGroup-5-9] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=1234)
2025-02-05T15:53:40.302Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 82001935ed
2025-02-05T15:53:40.308Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=13805)
2025-02-05T15:53:50.302Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 8200195475
2025-02-05T15:53:50.303Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=21621)
2025-02-05T15:54:00.302Z DEBUG 1 --- [               ] c.b.c.y.c.p.k.s.KeepAliveSerializers     : MsgKeepAlive (serialized) : 82001965b2
2025-02-05T15:54:00.304Z DEBUG 1 --- [tLoopGroup-10-1] c.b.c.y.c.p.keepalive.KeepAliveAgent     : MsgKeepAliveResponse: MsgKeepAliveResponse(cookie=26034)

@matiwinnetou matiwinnetou added the bug Something isn't working label Feb 5, 2025
@matiwinnetou
Copy link
Collaborator Author

Here is a PR in rosetta where we running into this problem: cardano-foundation/cardano-rosetta-java#273

@satran004
Copy link
Member

@matiwinnetou

I would suggest not to use account module in rosetta-java, although we are using it in aggregation-app without any issues.

But, for rosetta, as I suggested earlier, you can directly copy the AccountService class below into the rosetta-java codebase and use it. This class uses a local query to fetch the stake address balance and reward info required by rosetta directly from node.

https://github.com/bloxbean/yaci-store/blob/main/aggregates/account/src/main/java/com/bloxbean/cardano/yaci/store/api/account/service/AccountService.java

In future release of yaci-store, we will try to move this service class to a common module so that it can be directly used from yaci-store without duplicating the class or using account module.

Hope that makes sense.

fyi. @Kammerlo

@matiwinnetou
Copy link
Collaborator Author

@satran004 should we keep this "bug" or close it, your decision here

@satran004
Copy link
Member

@matiwinnetou

Let’s keep it open for now. Although it’s no longer valid for rosetta, we will verify it with a custom app and close later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants