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

Test VM exceptionError bug #1168

Merged
merged 5 commits into from Apr 27, 2021
Merged

Test VM exceptionError bug #1168

merged 5 commits into from Apr 27, 2021

Conversation

holgerd77
Copy link
Member

This is testing behavior along a potential bug fix for #1157, do not merge.

@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #1168 (d40475f) into master (88823f3) will increase coverage by 1.87%.
The diff coverage is 100.00%.

Impacted file tree graph

Flag Coverage Δ
block 79.77% <ø> (-0.40%) ⬇️
blockchain 84.16% <ø> (-0.07%) ⬇️
client 84.00% <ø> (ø)
common 87.39% <ø> (ø)
devp2p 84.20% <ø> (-0.08%) ⬇️
ethash 82.08% <ø> (ø)
tx 82.26% <ø> (-0.22%) ⬇️
vm 86.57% <100.00%> (+5.71%) ⬆️

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

@holgerd77
Copy link
Member Author

@alcuadrado ok, this doesn't affect VM test run behavior at all. I would cautiously say we could eventually merge this. From my understanding of the whole coherences I would assume that the effect of this would essentially be that if you guys or we directly in the VM have a bug in the code (e.g. in a custom state manager), this would directly break and trickle up and not be disguised any more and so the effect from this would be that it will get easier to have these kind of failures fixed? Is this correct?

@ryanio
Copy link
Contributor

ryanio commented Apr 20, 2021

What's the status of this PR? I'm thinking we can add a test to ensure that non-VmErrors propagate through as expected, then it can be ready to merge in?

Codecov didn't give any coverage warning on the newly added lines in this PR so I'm wondering if the code path is already being covered, I'd be interested to see.

@holgerd77
Copy link
Member Author

@ryanio I think this can be merged.

The suggestion on setting up a test is great 😄 , what would be good setup here?

I was thinking about subclassing Interpreter and add some fitting function which just throws, but it is impressively complex (or rather: laborious) to get this setup going respectively do an instantiation with all this message setup, I think we should really simplify here at some point as far as possible and generally make it easier to instantiate an independent EVM separate from all this outer environmental processing logic stuff brought in in runTx(), runBlock() and the like.

The other way for adding a test here might be the usage of the testdouble library which we already use in the client.

Any preference here respectively suggestion?

@holgerd77
Copy link
Member Author

@ryanio short ping (see last question) 😄 (also feel free to add a test yourself if you have an easy idea here)

@ryanio
Copy link
Contributor

ryanio commented Apr 26, 2021

rebased this, ok let me know what you think of the added tests. tried to keep it as simple as possible and used @alcuadrado's original suggestion in the issue to throw an error from stateManager.putContractStorage()

Copy link
Member Author

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Yeah, nice, this looks really good, will merge. 😄 👍

Also a somewhat really core-centered change (like the recent and discussed StateManager changes) with some potential to cause some reactions once released, but I guess very much net-positive since either a) people will discover own bugs in their customizations which were previously hidden or b) people might report bugs we still have in the VM.

So really excited about this change, long overdue! 🎉

(will merge by admin-merge since technically reviewed by @ryanio by continuing the work)

}
st.end()
})
})
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yeah, really nice test cases! 😄

@holgerd77 holgerd77 merged commit 64fbffc into master Apr 27, 2021
@holgerd77 holgerd77 deleted the vm-exceptionError-bug branch April 27, 2021 07:56
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.

None yet

2 participants