Only output size when debugging output if Any.value is huge #135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
lcp/modules/enclave-api/src/api/primitive.rs
Line 15 in 6743a16
UpdateClient, which receives pre-image data such as optimism, will log several hundred MB of data.
This PR outputs the size when the data size exceeds the specified size.
We initially considered outputting the first N bytes, but decided to output only the size, as that is simply missing data and not useful.
After applying this PR logs are output as bellow.
eg) prepare command
[2025-07-07T01:43:31Z DEBUG enclave_api::api::primitive] prepare command: inner=LightClient(Execute(UpdateClient(UpdateClientInput { client_id: ClientId("optimism-1"), any_header: Any { type_url: "/ibc.lightclients.optimism.v1.Header",
value_size: 27501264}, include_state: true, signer: Address([69, 27, 218, 64, 105, 204, 136, 7, 226, 43, 50, 56, 198, 118, 80, 89, 95, 230, 79, 201]) }))) update_key=Some("optimism-1")eg) try to execute command
[2025-07-07T01:43:31Z DEBUG enclave_api::api::primitive] try to execute command: ECallCommand { ctx: CommandContext { current_timestamp: Time(2025-07-07 1:43:31.312794553), sealed_ek: Some(SealedEnclaveKey([4, 0, 1, 0, 0, 0, 0, 0, 72, 32, 243, 55, 106, 230, 178, 242, 3, 77, 59, 122, 75, 72, 167, 120, 243, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 232, 86, 130, 114, 21, 196, 58, 121, 157, 26, 58, 47, 44, 10, 171, 128, 4, 192, 15, 151, 228, 70, 75, 144, 198, 223, 155, 17, 166, 206, 223, 57, 0, 0, 0, 240, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 130, 242, 2, 61, 134, 151, 81, 31, 162, 66, 180, 167, 169, 144, 131, 77, 58, 188, 155, 179, 200, 35, 198, 33, 96, 155, 173, 220, 80, 61, 178, 59, 214, 117, 54, 239, 167, 211, 63, 14, 55, 142, 87, 62, 102, 161, 48])), tx_id: TxId(32) }, cmd: LightClient(Execute(UpdateClient(UpdateClientInput { client_id: ClientId("optimism-1"), any_header: Any { type_url: "/ibc.lightclients.optimism.v1.Header",
value_size: 27501264}, include_state: true, signer: Address([69, 27, 218, 64, 105, 204, 136, 7, 226, 43, 50, 56, 198, 118, 80, 89, 95, 230, 79, 201]) }))) }