Skip to content

[Neo VM Optimization]Print stack exception#3326

Merged
NGDAdmin merged 3 commits intoneo-project:masterfrom
Jim8y:print-stack-exception
Jun 18, 2024
Merged

[Neo VM Optimization]Print stack exception#3326
NGDAdmin merged 3 commits intoneo-project:masterfrom
Jim8y:print-stack-exception

Conversation

@Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Jun 11, 2024

Description

Its not clear what probem happens while testing it, thus we have VMPerf flag to show the executed opcode, but we still cant see the exception message, thus having this pr to print the exception message to the console as well.

Fixes # For debugging the UT fail issue in #3325

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Jim8y Jim8y requested a review from a team June 11, 2024 07:23
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jim8y take a look to my changes please

@Jim8y Jim8y requested a review from a team June 11, 2024 10:36
#if VMPERF
if (ex != null)
{
Console.Error.WriteLine(ex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite a useful one. Just for the record, in NeoGo we always log FAULT exceptions with WARN severity level:

2024-06-11T20:13:18.476+0300	WARN	contract invocation failed	{"tx": "3d82c9a5da51d2163895c67672380e5a4ba26cba1d400098d75ae82475e6a712", "block": 5782, "error": "at instruction 0 (PUSH1): gas limit is exceeded"}

So may be it's worth to consider add some more additional info to the message (like transaction hash, block number and etc). But it's just a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this is only used for debugging purpose. But i get your point, we can have more logs like what you mentioned.

@NGDAdmin NGDAdmin merged commit 12c3b89 into neo-project:master Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants