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

DELEGATECALL should receive only 63/64 of the remaining gas (and msg.gas should reflect that) #255

Closed
benjamincburns opened this issue Jan 30, 2018 · 5 comments

Comments

@benjamincburns
Copy link
Contributor

benjamincburns commented Jan 30, 2018

Passing this one along. See trufflesuite/ganache#367 for more detail.

I suspect the fix is simple, just change this line to something like gasLimit: gas.sub(runState.gasLeft.sub(runState.gasLeft.div(64))

I haven't read the yellow paper too carefully on this subject - it's possible that similar gas reductions should apply for other *CALL opcodes.

@axic
Copy link
Member

axic commented Jan 30, 2018

It applies to all of them, including create.

@axic
Copy link
Member

axic commented Jan 30, 2018

@carver
Copy link

carver commented Jan 31, 2018

I think the GAS opcode should reflect the reduced gas.

@axic
Copy link
Member

axic commented Jul 24, 2018

@benjamincburns @holgerd77 Apparently ethereumjs-vm passes all the state tests. Is this really a bug in ethereumjs-vm or the consumer of ethereumjs-vm?

@holgerd77
Copy link
Member

I've scanned through the ganache-core release notes linked by @davidmurdoch in this comment. As far as I understand them I would assume this a) has been solved and b) is not an issue where there is still some underlying problem within the VM.

Will close this for now, feel free to reopen if my understanding of this was not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants