ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 49 forks source link

Limit grpc response to 4 mb #2055

Closed kilrau closed 3 years ago

kilrau commented 3 years ago

Background

As our friends from Boltz had to discover a critical issue in their backend because: 8 RESOURCE_EXHAUSTED: Received message larger than max (4199453 vs. 4194304), which was caused because a call to lnd returned more data than 4 mb which is the default limit of grpc (but lnd uses 200 mb as limit right now).

How to fix it:

new LightningClient(this.uri, this.credentials, {
    'grpc.max_receive_message_length': 1024 * 1024 * 100,
})

Cheers to @michael1011 for pointing us at this critical issue.