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

Configurable function input size #792

Merged
merged 5 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ MIRROR_NODE_RETRIES =
MIRROR_NODE_RETRY_DELAY =
GAS_PRICE_TINY_BAR_BUFFER =
MIRROR_NODE_LIMIT_PARAM =
CLIENT_TRANSPORT_SECURITY=
CLIENT_TRANSPORT_SECURITY=
INPUT_SIZE_LIMIT=
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ GAS_PRICE_TINY_BAR_BUFFER = 10000000000
MIRROR_NODE_RETRIES = 3
MIRROR_NODE_RETRY_DELAY = 500
MIRROR_NODE_LIMIT_PARAM = 100
INPUT_SIZE_LIMIT = 1
````

Note: Read more about `DEV_MODE` [here](docs/dev-mode.md)
Expand Down
1 change: 1 addition & 0 deletions helm-chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ data:
MIRROR_NODE_RETRIES: {{ .Values.config.MIRROR_NODE_RETRIES | quote }}
MIRROR_NODE_RETRY_DELAY: {{ .Values.config.MIRROR_NODE_RETRY_DELAY | quote }}
MIRROR_NODE_LIMIT_PARAM: {{ .Values.config.MIRROR_NODE_LIMIT_PARAM | quote }}
INPUT_SIZE_LIMIT: {{ .Values.config.INPUT_SIZE_LIMIT | quote }}
1 change: 1 addition & 0 deletions helm-chart/value-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ config:
MIRROR_NODE_RETRIES: 3
MIRROR_NODE_RETRY_DELAY: 500
MIRROR_NODE_LIMIT_PARAM: 100
INPUT_SIZE_LIMIT: 1

# Enable rolling_restarts if SDK calls fail this is usually due to stale connections that get cycled on restart
rolling_restart:
Expand Down
1 change: 1 addition & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ config:
MIRROR_NODE_RETRY_DELAY: 500
MIRROR_NODE_LIMIT_PARAM: 100
CLIENT_TRANSPORT_SECURITY: false
INPUT_SIZE_LIMIT: 1

# Enable rolling_restarts if SDK calls fail this is usually due to stale connections that get cycled on restart
rolling_restart:
Expand Down
4 changes: 3 additions & 1 deletion packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const cors = require('koa-cors');
const logger = mainLogger.child({ name: 'rpc-server' });
const register = new Registry();
const relay: Relay = new RelayImpl(logger, register);
const app = new KoaJsonRpc(logger, register);
const app = new KoaJsonRpc(logger, register, {
limit: process.env.INPUT_SIZE_LIMIT ? process.env.INPUT_SIZE_LIMIT + 'mb' : null
});

const REQUEST_ID_STRING = `Request ID: `;
const responseSuccessStatusCode = '200';
Expand Down
1 change: 1 addition & 0 deletions packages/server/tests/localAcceptance.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ MIRROR_NODE_RETRIES = 3
MIRROR_NODE_RETRY_DELAY = 500
GAS_PRICE_TINY_BAR_BUFFER = 10000000000
MIRROR_NODE_LIMIT_PARAM = 2
INPUT_SIZE_LIMIT=1