Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2989] EIP-1884 - Repricing for trie-size-dependent opcodes #1795

Merged
merged 4 commits into from
Jul 30, 2019

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Jul 30, 2019

PR description

Add the new gas costs and new operation to the EVM for Istanbul.

Add the new gas costs and new operation to the EVM.
@Override
public void execute(final MessageFrame frame) {
final Address accountAddress = frame.getContractAddress();
final Account account = frame.getWorldState().get(accountAddress);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to cache the contract balance on MessageFrame? Otherwise, the cheaper pricing isn't really justified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we want to.

@@ -69,6 +71,7 @@
@JsonCreator
public EnvironmentInformation(
@JsonProperty("address") final String account,
@JsonProperty("balance") final String balance,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there new reference tests that use this? Or is this speculative?

@@ -81,6 +84,7 @@ public EnvironmentInformation(
code,
0,
account == null ? null : Address.fromHexString(account),
balance == null ? null : Wei.fromHexString(balance),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this default to Wei.ZERO?

Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

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

Whoops - looks like a bunch of test failures, rescinding approval :D

@shemnon
Copy link
Contributor Author

shemnon commented Jul 30, 2019

Just one little NPE, what's the worst that can happen? ;)

fixed.

@shemnon shemnon merged commit ef3efcb into PegaSysEng:master Jul 30, 2019
@holiman
Copy link

holiman commented Aug 21, 2019

I may be totally missing something here, since I'm not all too familiar with how pantheon works under the hood. But it looks to me like you are setting the balance prior to entering the callframe, and then keep it as a context variable for the duration of the call?

I'm just wondering if this implementation works with e.g.
SELFBALANCE; CALL(0, 0,1,0,0,0,0); SELFBALANCE (where the second invocation of SELFBALANCE should be one wei less than before ?

@shemnon
Copy link
Contributor Author

shemnon commented Aug 22, 2019

That optimization wasn't as easy as expected. We will roll it back for now - #1875

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

Successfully merging this pull request may close these issues.

3 participants