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

Invalid implementation of ToyAccount.isStorageEmpty() #998

Closed
DavePearce opened this issue Aug 27, 2024 · 1 comment
Closed

Invalid implementation of ToyAccount.isStorageEmpty() #998

DavePearce opened this issue Aug 27, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@DavePearce
Copy link
Collaborator

DavePearce commented Aug 27, 2024

(see also #877 and #953)

Currently, the implementation of ToyAccount.isStorageEmpty() is:

@Override
  public boolean isStorageEmpty() {
    return false; // TODO fix NPE triggered by setting it to this.storage.isEmpty();
  }

This is invalid and causes problems whenever a contract creation occurs. Instead, it should be (as the comment suggests):

@Override
  public boolean isStorageEmpty() {
    return storage.isEmpty();
  }
@DavePearce DavePearce added the bug Something isn't working label Aug 27, 2024
@DavePearce DavePearce self-assigned this Aug 27, 2024
@DavePearce
Copy link
Collaborator Author

DavePearce commented Aug 28, 2024

Unfortunately, this is now exposing a secondary problem (similar to that seen in #900). For example, for the block 2250197 we get this:

Exceptions triggered while tracing:
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  - null
  ...


java.lang.IllegalArgumentException
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:129)
	at net.consensys.linea.zktracer.module.romlex.RomLex.resolvePostExecution(RomLex.java:243)
	at net.consensys.linea.zktracer.module.hub.defer.DeferRegistry.resolvePostExecution(DeferRegistry.java:157)
	at net.consensys.linea.zktracer.module.hub.Hub.tracePostExecution(Hub.java:772)
	at net.consensys.linea.zktracer.ZkTracer.tracePostExecution(ZkTracer.java:276)
	at org.hyperledger.besu.evm.EVM.runToHalt(EVM.java:337)
	at org.hyperledger.besu.evm.processor.AbstractMessageProcessor.codeExecute(AbstractMessageProcessor.java:175)
	at org.hyperledger.besu.evm.processor.AbstractMessageProcessor.process(AbstractMessageProcessor.java:198)
	... 

Potentially fixes in #982 might help here --- to investigate.

DavePearce added a commit that referenced this issue Aug 28, 2024
This puts through a straightforward fix for the method
`ToyAccount.isStorageEmpty()`.
DavePearce added a commit that referenced this issue Aug 28, 2024
This puts through a straightforward fix for the method
`ToyAccount.isStorageEmpty()`.
DavePearce added a commit that referenced this issue Aug 28, 2024
This puts through a straightforward fix for the method
`ToyAccount.isStorageEmpty()`.  This unfortunately exposes a problem
with MXP / ROMLEX (#1014).  Two tests have been marked as `@Disabled`
until this problem is resolved.
DavePearce added a commit that referenced this issue Aug 28, 2024
This puts through a straightforward fix for the method
`ToyAccount.isStorageEmpty()`.  This unfortunately exposes a problem
with MXP / ROMLEX (#1014).  Two tests have been marked as `@Disabled`
until this problem is resolved.
DavePearce added a commit that referenced this issue Aug 28, 2024
This puts through a straightforward fix for the method
`ToyAccount.isStorageEmpty()`.  This unfortunately exposes a problem
with MXP / ROMLEX (#1014).  Two tests have been marked as `@Disabled`
until this problem is resolved.
DavePearce added a commit that referenced this issue Aug 28, 2024
This puts through a straightforward fix for the method
`ToyAccount.isStorageEmpty()`.  This unfortunately exposes a problem
with MXP / ROMLEX (#1014).  Two tests have been marked as `@Disabled`
until this problem is resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant