Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bcfr 945 improve contract reader logs #14546

Merged
merged 13 commits into from
Oct 10, 2024

Conversation

EasterTheBunny
Copy link
Contributor

@EasterTheBunny EasterTheBunny commented Sep 24, 2024

BCFR-945 improve logs and error handling for contract reader

All errors are structured as a ReadError with extra detail on the contract, method/event, parameters, etc. This data is now provided in the debug log.

@EasterTheBunny EasterTheBunny requested a review from a team as a code owner September 24, 2024 14:56
@EasterTheBunny EasterTheBunny requested review from krehermann and removed request for a team September 24, 2024 14:56
Copy link
Contributor

@ilija42 ilija42 left a comment

Choose a reason for hiding this comment

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

What do you think about wrapping errors with extra detail all the way up to the beginning of the stack, instead of logging them at the origin? So we would get something like this "failed to get latest value for xy at address xy ,err: failed to convert params xy to nativeOnchainTypes, err: failed to create codec type for item type xy"
Then, if it's a user input error, simply return it, but if it's an internal error, log it and return a generic internal error message. The goal is to make debugging this without opening up a debugger possible 😆

cc @jmank88 not sure how we usually do this

@EasterTheBunny
Copy link
Contributor Author

What do you think about wrapping errors with extra detail all the way up to the beginning of the stack, instead of logging them at the origin? So we would get something like this "failed to get latest value for xy at address xy ,err: failed to convert params xy to nativeOnchainTypes, err: failed to create codec type for item type xy" Then, if it's a user input error, simply return it, but if it's an internal error, log it and return a generic internal error message. The goal is to make debugging this without opening up a debugger possible 😆

cc @jmank88 not sure how we usually do this

That is why I tried adding a lot more information about each error to give better hints at where the error occurred in the call stack. Everything is a read error, but each error gets a bit more detail as it moves down the stack and also picks up input parameters as well. My main concern is security of printing some of the call parameters and return values to logs. That is what it is doing right now.

@EasterTheBunny EasterTheBunny force-pushed the BCFR-945-improve-contract-reader-logs branch from 3b0be6b to 928bf11 Compare September 26, 2024 15:31
Copy link
Contributor

github-actions bot commented Sep 26, 2024

WF: CI Core#285b64e

No errors found in this run. 🎉

@EasterTheBunny EasterTheBunny force-pushed the BCFR-945-improve-contract-reader-logs branch from 928bf11 to b054e61 Compare September 26, 2024 19:59
@EasterTheBunny EasterTheBunny force-pushed the BCFR-945-improve-contract-reader-logs branch from 8699cb0 to 0ef90eb Compare September 27, 2024 19:01
silaslenihan
silaslenihan previously approved these changes Sep 30, 2024
@silaslenihan silaslenihan force-pushed the BCFR-945-improve-contract-reader-logs branch from 192c823 to cdfbba7 Compare October 1, 2024 14:44
@silaslenihan silaslenihan force-pushed the BCFR-945-improve-contract-reader-logs branch 3 times, most recently from 6cfe9fb to c6ee63f Compare October 3, 2024 18:50
silaslenihan
silaslenihan previously approved these changes Oct 3, 2024
@silaslenihan silaslenihan force-pushed the BCFR-945-improve-contract-reader-logs branch from c6ee63f to 8b47983 Compare October 3, 2024 19:27
Copy link
Contributor

github-actions bot commented Oct 9, 2024

WF: CI Core#4b320f2

No errors found in this run. 🎉

@silaslenihan silaslenihan force-pushed the BCFR-945-improve-contract-reader-logs branch 2 times, most recently from ce901b9 to 1ab6fe4 Compare October 9, 2024 15:54
Copy link
Contributor

github-actions bot commented Oct 9, 2024

WF: CI Core#1ab6fe4

No errors found in this run. 🎉

@silaslenihan silaslenihan force-pushed the BCFR-945-improve-contract-reader-logs branch from 1ab6fe4 to 58db544 Compare October 9, 2024 16:51
Copy link
Contributor

github-actions bot commented Oct 9, 2024

WF: CI Core#58db544

No errors found in this run. 🎉

Copy link
Contributor

github-actions bot commented Oct 10, 2024

WF: CI Core#4d57495

No errors found in this run. 🎉

Copy link
Contributor

github-actions bot commented Oct 10, 2024

WF: CI Core#9da225c

No errors found in this run. 🎉

Copy link
Contributor

github-actions bot commented Oct 10, 2024

WF: CI Core#b4fdafb

No errors found in this run. 🎉

Copy link
Contributor

github-actions bot commented Oct 10, 2024

WF: CI Core#5bfecd1

No errors found in this run. 🎉

@ilija42 ilija42 added this pull request to the merge queue Oct 10, 2024
Merged via the queue into develop with commit 777349c Oct 10, 2024
129 of 130 checks passed
@ilija42 ilija42 deleted the BCFR-945-improve-contract-reader-logs branch October 10, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants