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

chore(amino): improve error readability #1179

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

albttx
Copy link
Member

@albttx albttx commented Sep 28, 2023

Following #1178

This fix change the error from being a stack overflow to a simple error message

BEFORE (from #1178 )

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020780390 stack=[0xc020780000, 0xc040780000]
fatal error: stack overflow

runtime stack:
runtime.throw({0x9842fa?, 0xd4dea0?})
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/runtime/panic.go:1047 +0x5d fp=0x7f681368cc18 sp=0x7f681368cbe8 pc=0x43907d
runtime.newstack()
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/runtime/stack.go:1103 +0x5cc fp=0x7f681368cdd0 sp=0x7f681368cc18 pc=0x452d0c
runtime.morestack()
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/runtime/asm_amd64.s:570 +0x8b fp=0x7f681368cdd8 sp=0x7f681368cdd0 pc=0x46a32b

goroutine 1 [running]:
fmt.(*fmt).padString(0xc00de1ff20?, {0x8961be, 0x7})
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/fmt/format.go:108 +0x299 fp=0xc0207803a0 sp=0xc020780398 pc=0x4dac39
fmt.(*fmt).fmtS(0xc0207803f8?, {0x8961be?, 0x8961bd?})
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/fmt/format.go:359 +0x3f fp=0xc0207803d8 sp=0xc0207803a0 pc=0x4db75f
fmt.(*pp).fmtString(0x8ca000?, {0x8961be?, 0x8ca000?}, 0x0?)
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/fmt/print.go:474 +0x86 fp=0xc020780428 sp=0xc0207803d8 pc=0x4de566
fmt.(*pp).handleMethods(0xc00de1fee0, 0x100800?)
        /nix/store/akhjsmrrsakcnj8x3xgygvizhccbyn0v-go-1.19.3/share/go/src/fmt/print.go:65

[....] It's a stack overflow due to recursion

AFTER

amino: unrecognized concrete type full name tm.PubKeySecp256k1
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Sep 28, 2023
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (d865095) 47.79% compared to head (09f0aaf) 47.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1179   +/-   ##
=======================================
  Coverage   47.79%   47.79%           
=======================================
  Files         369      369           
  Lines       62710    62710           
=======================================
  Hits        29970    29970           
  Misses      30315    30315           
  Partials     2425     2425           
Files Coverage Δ
tm2/pkg/amino/codec.go 62.21% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@moul moul changed the title fix: remove print of typeinfo chore(amino): improve error readability Sep 29, 2023
@moul
Copy link
Member

moul commented Sep 29, 2023

Kindly refer to this section on our contributing guidelines. We adopt the conventional commits approach. Here, the term fix: should represent the solution your PR offers to the community. Typically, a 'fix' implies an urgent change to address a production-related concern.

@albttx
Copy link
Member Author

albttx commented Sep 29, 2023

@moul Sure, commit have been updated to a chore:

@moul
Copy link
Member

moul commented Sep 29, 2023

Thank you, however, for commits it's just a suggestion, the real important location is the PR title; it was more a message for later since you're contributing frequently on the repo :)

@gfanton
Copy link
Member

gfanton commented Oct 5, 2023

@albttx can we have an after vs before ?

@albttx
Copy link
Member Author

albttx commented Oct 6, 2023

@gfanton updated, see 🆙

@gfanton gfanton merged commit fa8eb77 into gnolang:master Oct 6, 2023
176 checks passed
gfanton pushed a commit to gfanton/gno that referenced this pull request Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Status: 🔵 Not Needed for Launch
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants