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

Repricing for trie-size-dependent opcodes (EIP1884) #1884

Merged
merged 9 commits into from
Apr 4, 2019

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Mar 29, 2019

This EIP proposes repricing certain opcodes, to obtain a good balance between gas expenditure and resource consumption.

holiman and others added 6 commits March 29, 2019 09:31
I've started removing trailing whitespace, but soon stopped, seeing how it would touch too many lines.
Typos, styling, trailing whitespace, link EIP-150.
EIPS/eip-draft_reprice_opcodes.md Outdated Show resolved Hide resolved
EIPS/eip-draft_reprice_opcodes.md Outdated Show resolved Hide resolved
@nicksavers
Copy link
Contributor

Assets can be placed in the /assets directory. They'll need to be put into another directory with the name of the EIP. You can use #1884 for this.

@holiman
Copy link
Contributor Author

holiman commented Mar 29, 2019

Thanks, I moved the assets now


## Implementation

Both these opcodes have been repriced before, and the client internals for managing reprices are already in place.
Copy link
Contributor

Choose a reason for hiding this comment

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

Apart from a technical specification, it is the place to link to clients that have implemented the change.

EIPS/eip-1884.md Outdated Show resolved Hide resolved
EIPS/eip-1884.md Outdated Show resolved Hide resolved
EIPS/eip-1884.md Outdated Show resolved Hide resolved
EIPS/eip-1884.md Outdated
@@ -0,0 +1,146 @@
---
eip: 1884
title: Opcode repricing for trie-size-dependent opcodes
Copy link
Contributor

Choose a reason for hiding this comment

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

The first 'Opcode' seems redundant here.

@nicksavers nicksavers merged commit d702fe8 into ethereum:master Apr 4, 2019
@k06a
Copy link
Contributor

k06a commented May 20, 2019

I afraid increasing SLOAD opcode gas cost may break some existing deployed smart contracts. They can perform limited gas subcalls, which will not fit after this change.

@axic
Copy link
Member

axic commented May 20, 2019

Please leave this comment on the discussion-to URL.

@k06a
Copy link
Contributor

k06a commented May 20, 2019

@cupOJoseph
Copy link

The reentrancy attacks are going to be crazy when this launches. I can't believe there wasnt more discussion on this.

@holiman
Copy link
Contributor Author

holiman commented Nov 12, 2019

The reentrancy attacks are going to be crazy when this launches. I can't believe there wasnt more discussion on this.

Why would this trigger reentrancy attacks?

@cupOJoseph
Copy link

The gas price increase will effect fallback functions called when a contract receives ether.

https://gist.github.com/ritzdorf/1c6bd72955391e831f8a397d3152b4e0

The current execution of the fallback function in case of a send/transfer consumes 1759 gas. It contains one SLOAD due to isDepositable(). Therefore, it will break with EIP-1884.

https://etherscan.io/tx/0x14a4a43b4e9759aac86bb0ae7e5926850406ff1c43ea571239563ff781474ae0

Based on this research I believe the gas price changes effecting previously deployed contracts is a mistake.

@axic axic changed the title Reprice Repricing for trie-size-dependent opcodes (EIP1884) Nov 12, 2019
@holiman
Copy link
Contributor Author

holiman commented Nov 12, 2019

But how does that relate to reentrancy attacks?

ilanolkies pushed a commit to ilanolkies/EIPs that referenced this pull request Nov 12, 2019
@jdetychey
Copy link

Hello @holiman
I believe @jschiarizzi is pointing out that while fallback function execution breaks due to repricing it might create reentrancy in a context where for example Alice calls contract A, contract A sends Eth to contract B, contract B fallback execute code and break, Alice now reenters by calling contract A again.

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.

7 participants