Skip to content

Conversation

@yoshidan
Copy link
Contributor

@yoshidan yoshidan commented Jul 6, 2025

"prepare command: inner={:?} update_key={:?}",

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, 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, 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, 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]) }))) }

@yoshidan yoshidan force-pushed the feature/limit_for_debug_msg branch 3 times, most recently from d52678f to 26b12b8 Compare July 7, 2025 00:56
@yoshidan yoshidan changed the title Restrict debug output size for the Any type Only output size when debugging output if Any.value is huge. Jul 8, 2025
@yoshidan yoshidan marked this pull request as ready for review July 8, 2025 05:54
@yoshidan yoshidan changed the title Only output size when debugging output if Any.value is huge. Only output size when debugging output if Any.value is huge Jul 8, 2025
@yoshidan yoshidan requested a review from bluele July 9, 2025 03:19
@bluele bluele added the enclave-update PRs/issues that modify the enclave in a way that changes its measurement (MRENCLAVE). label Jul 16, 2025
@yoshidan yoshidan force-pushed the feature/limit_for_debug_msg branch from 26b12b8 to 75ff322 Compare July 16, 2025 12:03
@bluele bluele merged commit f37415b into datachainlab:main Jul 17, 2025
2 checks passed
@yoshidan yoshidan deleted the feature/limit_for_debug_msg branch July 17, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enclave-update PRs/issues that modify the enclave in a way that changes its measurement (MRENCLAVE).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants