Skip to content

Conversation

bilyana-gospodinova
Copy link
Contributor

@bilyana-gospodinova bilyana-gospodinova commented Jun 20, 2025

Description:
When a MirrorEvmTransactionException is thrown, currently there are 2 log entries for 1 transaction and this makes the investigation harder as you need to find both entries and match them. The first entry contained the request body input and the second entry contained the resulting error output.

With this PR both log entries are now merged into one. If the length of the log gets bigger than the maxPayloadLogSize property, it gets encoded as it did before for the input data. Also, the empty components in the error message are now removed and added to the log only if they are not empty.

Fixes #11054

Notes for reviewer:
Before:

2025-06-20T13:49:45.735Z  WARN Test worker o.h.m.w.c.GenericControllerAdvice Mirror EVM transaction error: CONTRACT_REVERT_EXECUTED, detail: Custom revert message, data: 0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015437573746f6d20726576657274206d6573736167650000000000000000000000, isModularized: null, childTransactionErrors: [] 
2025-06-20T13:49:45.769Z  INFO Test worker o.h.m.w.c.LoggingFilter 127.0.0.1 POST /api/v1/contracts/call in 128 ms (mod=false): 400 CONTRACT_REVERT_EXECUTED - {"block":"latest","data":"0xa26388bb","estimate":false,"from":"0x00000000000000000000000000000000000004e2","gas":10000000,"gasPrice":78282329,"to":"0x00000000000000000000000000000000000004e4","value":23} 

After:

2025-06-26T08:07:53.022Z  INFO Test worker o.h.m.w.c.LoggingFilter 127.0.0.1 POST /api/v1/contracts/call in 137 ms (mod=true): 400 Mirror EVM transaction error: CONTRACT_REVERT_EXECUTED, detail: Custom revert message, data: 0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015437573746f6d20726576657274206d6573736167650000000000000000000000 - {"block":"latest","data":"0xa26388bb","estimate":false,"from":"0x00000000000000000000000000000000000004e2","gas":10000000,"gasPrice":78282329,"to":"0x00000000000000000000000000000000000004e4","value":23} 

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@bilyana-gospodinova bilyana-gospodinova self-assigned this Jun 20, 2025
@bilyana-gospodinova bilyana-gospodinova added enhancement Type: New feature web3 Area: Web3 API labels Jun 20, 2025
@lfdt-bot
Copy link

lfdt-bot commented Jun 20, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@bilyana-gospodinova bilyana-gospodinova marked this pull request as ready for review June 20, 2025 14:27
@bilyana-gospodinova bilyana-gospodinova requested a review from a team as a code owner June 20, 2025 14:27
@bilyana-gospodinova bilyana-gospodinova changed the title Merge the two log entries into one Merge duplicated error log entries into one Jun 20, 2025
Copy link

codacy-production bot commented Jun 20, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-33.01% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7e65c7d) 35923 33737 93.91%
Head commit (cdfd7b5) 59355 (+23432) 36152 (+2415) 60.91% (-33.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#11434) 10 10 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@bilyana-gospodinova bilyana-gospodinova force-pushed the 11054-prevent-double-logging branch from 666192e to 7267cec Compare June 25, 2025 11:51
@lfdt-bot
Copy link

lfdt-bot commented Jun 25, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@steven-sheehy steven-sheehy added this to the 0.134.0 milestone Jun 25, 2025
steven-sheehy
steven-sheehy previously approved these changes Jun 26, 2025
Signed-off-by: Bilyana Gospodinova <[email protected]>
Signed-off-by: Bilyana Gospodinova <[email protected]>
Signed-off-by: Bilyana Gospodinova <[email protected]>
Signed-off-by: Bilyana Gospodinova <[email protected]>
Signed-off-by: Bilyana Gospodinova <[email protected]>
@steven-sheehy steven-sheehy merged commit 81d74d8 into main Jun 30, 2025
31 of 33 checks passed
@steven-sheehy steven-sheehy deleted the 11054-prevent-double-logging branch June 30, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature web3 Area: Web3 API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double logging of errors does not give us more information
4 participants