From 8bb6f9cc5b1c1788f3ea11030bfb3c39c133ea63 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Tue, 14 Jan 2025 13:09:24 +0100 Subject: [PATCH] chore: Address review change requests --- config.yml | 11 ++++++++++- pkg/client/tx/context.go | 11 ++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 63efee887..5be451816 100644 --- a/config.yml +++ b/config.yml @@ -104,10 +104,19 @@ validators: instrumentation: prometheus: true log_level: "info" - # Increase the rpc and mempool max bytes to support larger proof transactions. + # Increase the rpc and mempool max bytes to support large transactions. + # DEV_NOTE: These values were selected arbitrarily, but chosen to be large, + # as a result of load testing and seeing large proof messages during the + # Claim & Proof lifecycle. rpc: + # Controls how large any single RPC request accepted by the CometBFT + # server (offchain) can be. max_body_bytes: "100000000" mempool: + # Control how big any single transaction accepted by the CometBFT server + # (offchain) can be. + # Since multiple messages are bundled into a single transaction, + # max_tx_bytes needs to be increased alongside max_txs_bytes as well. max_tx_bytes: "100000000" client: chain-id: poktroll diff --git a/pkg/client/tx/context.go b/pkg/client/tx/context.go index 061553439..2c1d8fcde 100644 --- a/pkg/client/tx/context.go +++ b/pkg/client/tx/context.go @@ -18,11 +18,12 @@ import ( ) // maxGRPCMsgSize is the maximum message size the gRPC client can send and receive. -// The current value has been arbitrarily set to a large value after observing -// proof messages bundled within transactions exceeding the default 4MB limit. -// TODO_TECHDEBT: Adjust the max message size to a more sensible value. -// DEV_NOTE: This value should adjusted in concert with the CometBFT's rpc max_body_bytes, -// mempool max_tx_bytes and max_txs_bytes. +// The current value has been set arbitrarily to a large value after empirically +// observing multiple Proof messages bundled within a single transaction exceeding +// the default 4MB limit. +// TODO_MAINNET: Adjust the max message size to a more sensible value. +// DEV_NOTE: This value should adjusted in concert with the CometBFT's rpc +// max_body_bytes, mempool max_tx_bytes and max_txs_bytes. const maxGRPCMsgSize = 100 * 1024 * 1024 // 100MB var _ client.TxContext = (*cosmosTxContext)(nil)