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

fix: Don't emit events from failed transactions #2806

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

deelawn
Copy link
Contributor

@deelawn deelawn commented Sep 17, 2024

I noticed that we emit events from the VM even when a transaction fails. This is very difficult to write tests for because we don't display events when a transaction fails, but I was able to verify the following behavior BEFORE this fix:

  1. Events emitted for failing transactions are stored in the block results
  2. Events emitted by r/sys/validators will be processed and the state updated as normal, even if the transaction that emitted them fails

Correct me if I'm wrong, but I don't think we want to persist or take any other actions on events sourced from failing transactions.

I'm open to suggestions on how to write tests for this, but the fix should be self-explanatory.

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.

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.78%. Comparing base (68b8f54) to head (8fed41f).
Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2806      +/-   ##
==========================================
+ Coverage   60.44%   60.78%   +0.34%     
==========================================
  Files         563      563              
  Lines       75157    75729     +572     
==========================================
+ Hits        45426    46032     +606     
+ Misses      26341    26298      -43     
- Partials     3390     3399       +9     
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (-0.86%) ⬇️
gno.land 67.17% <ø> (-0.05%) ⬇️
gnovm 65.63% <ø> (+1.17%) ⬆️
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (-0.36%) ⬇️
tm2 62.00% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@moul moul added the 🐞 bug Something isn't working label Sep 17, 2024
Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

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

except for my comment where I'm not sure. LGTM.

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

Good to go if concerns are addressed.

tm2/pkg/sdk/baseapp.go Show resolved Hide resolved
@deelawn deelawn merged commit 5450f64 into gnolang:master Sep 19, 2024
117 of 119 checks passed
@deelawn deelawn deleted the fix/discard-aborted-tx-events branch September 19, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants