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

ChaincodeServer grpc.max_receive_message_length and grpc.max_send_message_length arguments #318

Closed
alexanderlamb opened this issue Apr 4, 2022 · 4 comments · Fixed by #401

Comments

@alexanderlamb
Copy link

alexanderlamb commented Apr 4, 2022

I'm having trouble passing grpc.max_receive_message_length and grpc.max_send_message_length arguments into a chaincode instance running as a server.

I've tried adding them to the cli command but haven't had any luck:
./src/chaincode.js --peer.address=0.0.0.0:9999 --grpc.max_receive_message_length=104857600 --grpc.max_send_message_length=104857600

I was wonder if someone could confirm that this functionality has been implemented yet, or if there's an alternative way to pass these values.

@jcastrence
Copy link

Assuming this isn't a fabric-samples chaincode, is there anywhere else in the chaincode that might overwrite the grpc message length variables?

@mbwhite
Copy link
Member

mbwhite commented Apr 19, 2022

Hello @alexanderlamb

Firstly - could briefly describe what problem you ran into that means you need to up this limit? Where you sending a transaction function with a large payload?

Java Chaincode does seem to have these options available - it defaults to 100Mb for max-message-size.
This does need setting both sides I believe (based on grpc documentation).

Node chaincode has this missing I believe.

@alexanderlamb
Copy link
Author

alexanderlamb commented Apr 19, 2022

Hello @alexanderlamb

Firstly - could briefly describe what problem you ran into that means you need to up this limit? Where you sending a transaction function with a large payload?

Java Chaincode does seem to have these options available - it defaults to 100Mb for max-message-size. This does need setting both sides I believe (based on grpc documentation).

Node chaincode has this missing I believe.

Hi @mbwhite,

Our payload size can become quite large yes. We're easily bumping up against the limit as it currently stands. As a temporary fix, we've forked this repo and bumped up the limit to 100Mb and can confirm its working.

Also, this may be a separate conversation, but this issue was discovered when stream.cancel() was being called when it no longer existed.

2022-03-29T18:50:25.937Z error [c-api:_]                                          uncaughtException: stream.cancel is not a function
TypeError: stream.cancel is not a function
    at ServerDuplexStreamImpl.<anonymous> (/home/node/app/node_modules/@arise-travel/fabric-shim/lib/handler.js:372:20)
    at ServerDuplexStreamImpl.emit (node:events:394:28)
    at ServerDuplexStreamImpl.emit (node:domain:475:12)
    at endReadableNT (node:internal/streams/readable:1331:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) 

delaooliveira pushed a commit to delaooliveira/fabric-chaincode-node that referenced this issue Jun 5, 2023
in external mode (hyperledger#318)

When utilizing the chaincode as a service, it is possible to pass some
gRPC options as an argument, such as grpc.max_send_message_length.
However, these server options were not utilized when declaring the
server.
Resolves hyperledger#318

Signed-off-by: André João Pedro de Oliveira <andre@ibm.com>
@denyeart
Copy link
Contributor

Fixed in node chaincode v2.5.4, the grpc parameters passed at chaincode startup will now be honored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants