-
Notifications
You must be signed in to change notification settings - Fork 130
[PAN-2989] EIP-1884 - Repricing for trie-size-dependent opcodes #1795
Conversation
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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
?
There was a problem hiding this 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
Just one little NPE, what's the worst that can happen? ;) fixed. |
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. |
That optimization wasn't as easy as expected. We will roll it back for now - #1875 |
PR description
Add the new gas costs and new operation to the EVM for Istanbul.