lightningj-org/lightningj

grpc: trying to send message larger than max (5380006 vs. 4194304)

Closed this issue · 4 comments

Subject of the issue

When using LightningGrpc.LightningBlockingStub and calling describeGraph() I get an exception from grpc:
io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: grpc: trying to send message larger than max (5380006 vs. 4194304)
This used not to be a problem and worked nicely say a month ago, but now that the lightning network has grown the return value is larger than 4 MB, 4194304 bytes.

I have tried to call withMaxInboundMessageSize() and withMaxOutboundMessageSize() with values that would allow 104857600 bytes (100 MB), but this has no effect, the exception remains the same.
I have also called maxInboundMessageSize() on the ManagedChannel that LightningGrpc.newBlockingStub() is based on with no effect.

Your environment

  • version of lightningj: org.lightningj:lightningj:0.5.1-Beta
  • version and vendor of JDK: openjdk version "1.8.0_191"
  • your operationg systems. CentOs

Steps to reproduce

Create an instance of LightningBlockingStub and call describeGraph() while connected to a lnd node connected to the lightning network

Expected behaviour

I expect a ChannelGraph reflecting the lightning network as seen by the lnd node

Actual behaviour

I get an exception: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: grpc: trying to send message larger than max (5379814 vs. 4194304)

Hi

I think the problem is in the LND node, see PR lightningnetwork/lnd#2374 by roasbeef. LND have increased the limit to 50 mb in latest master.

If it is a big problem for you I could try to generate a new pre-release of lightningJ built from latest master.

Regards
Philip

Can confirm that I had to both:

  1. upgrade lnd (to master, no release tagged after the fix), otherwise it wouldn't send messages larger than 4MB (for descibegraph)
  2. configure maxInboundMessageSize() in my code, so LightningGrpc.LightningBlockingStub would accept messages larger then 4MB
    Now it works.
    Thanks a lot.

Great to hear it works for you now.

I will probably create helper methods so it is easy to configure maxInboundMessageSize in the next version for 0.5.2 when released by LND. There seems to be alot of new GRPC apis coming up shortly in LND so there will be quite a lot to fix in lightningj library for to support 0.5.2.

Hi again

Just wanted to inform you that I've release 0.5.2-beta-rc3 where maxInboundMessageSize is by default increased to 50Mb (same as LND in 0.5.2). Should be in maven central shortly.