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

test(oogx): CALL different scenarios #1515

Draft
wants to merge 8 commits into
base: arith-dev
Choose a base branch
from

Conversation

lorenzogentile404
Copy link
Collaborator

No description provided.

@lorenzogentile404 lorenzogentile404 linked an issue Nov 19, 2024 that may be closed by this pull request
@lorenzogentile404 lorenzogentile404 changed the title test(oogx): add draft for CALL test(oogx): CALL different scenarios Nov 19, 2024
@OlivierBBB
Copy link
Collaborator

OlivierBBB commented Dec 2, 2024

WRT


The method can definitely be simplified (e.g. there is no need for nested if .. else ...) Also it is missing memory expansion costs. Maybe we could use the static Hub.GAS_PROJECTOR's methods ?

@lorenzogentile404 lorenzogentile404 force-pushed the 1514-call-exceptions-testing branch from 1e0286c to 503455c Compare December 18, 2024 17:45
@lorenzogentile404
Copy link
Collaborator Author

@OlivierBBB using GasProjector requires passing the frame, so executing the program. In this case, we need to know the cost before execution. That is the reason why I used that approach. For memory expansion, during execution we end up using a method of FrontierGasCalculator.class:

  public long memoryExpansionGasCost(MessageFrame frame, long offset, long length) {
    long pre = memoryCost((long)frame.memoryWordSize());
    long post = memoryCost(frame.calculateMemoryExpansion(offset, length));
    return post == Long.MAX_VALUE ? Long.MAX_VALUE : post - pre;
  }

that also requires the frame. Let's have a chat about it.

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.

CALL exceptions testing
2 participants