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

take snapshot after gas transfer so its not reverted on method failure #1417

Merged
merged 2 commits into from
Mar 20, 2020

Conversation

whyrusleeping
Copy link
Member

Should supercede #1410

@arajasek
Copy link
Contributor

Yup, this looks good, and is better than #1410. Looking at the spec, though, I think there might be more nuance to some of the gas calculations, so we might still not be spec-compliant after this PR.

We can either merge this and do a review of compliance later, or hold off on this until we're confident...I don't have a preference.

@whyrusleeping
Copy link
Member Author

chain validation tests failing now... hrm. Need to investigate

@whyrusleeping
Copy link
Member Author

now the propose and approve multisig test is failing with invalid nonce, instead of failing with a multisig specific error. Odd...

@arajasek
Copy link
Contributor

now the propose and approve multisig test is failing with invalid nonce, instead of failing with a multisig specific error. Odd...

This is failing because the test sends 2 failed messages from the same address, both with nonce 0, and expects them to fail as ErrForbidden. This was working because the sender's nonce wasn't being incremented on the first failed message, so we were ErrForbiddening both of them.

With your change, we do increment the nonce after the first failed message, and so we reject #2 as an invalid nonce, which isn't what the test expects.

@Kubuxu
Copy link
Contributor

Kubuxu commented Mar 18, 2020

I think incrementing nonce is the correct thing to do if we charge gas for failed execution.
If we don't increment nonce and charge gas, I can drain your account by including the same invalid message over and over.

@arajasek
Copy link
Contributor

I think incrementing nonce is the correct thing to do if we charge gas for failed execution.
If we don't increment nonce and charge gas, I can drain your account by including the same invalid message over and over.

That's definitely right. I don't know if gasUsed should be the entire gasLimit, though, I don't think that's what the spec says.

@Kubuxu
Copy link
Contributor

Kubuxu commented Mar 18, 2020

AFAIK, for failures we were going to charge everything up to gas limit. If it is different in spec, can you link it?

@whyrusleeping whyrusleeping merged commit 8775fb4 into testnet/3 Mar 20, 2020
@whyrusleeping whyrusleeping deleted the fix/sshot-after-gas branch March 20, 2020 21:17
Kubuxu pushed a commit that referenced this pull request May 12, 2020
take snapshot after gas transfer so its not reverted on method failure
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.

3 participants