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 and gas accumulator #1515

Merged
merged 33 commits into from
Feb 6, 2025

Conversation

lorenzogentile404
Copy link
Collaborator

@lorenzogentile404 lorenzogentile404 commented Nov 19, 2024

Addressing this too here #1663.

@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.

Copy link

cla-assistant bot commented Jan 9, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

cla-assistant bot commented Jan 9, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@amkCha
Copy link
Collaborator

amkCha commented Feb 4, 2025

seen with @lorenzogentile404 Extract and merge tests for calls and leave the rest for a separate PR for gas cost in case of memory expansion

@lorenzogentile404 lorenzogentile404 changed the title test(oogx): CALL different scenarios test(oogx): CALL different scenarios and gas accumulator Feb 5, 2025
@lorenzogentile404 lorenzogentile404 marked this pull request as ready for review February 5, 2025 11:37
@lorenzogentile404 lorenzogentile404 changed the title test(oogx): CALL different scenarios and gas accumulator test(oogx): CALL different scenarios Feb 5, 2025
@lorenzogentile404 lorenzogentile404 changed the title test(oogx): CALL different scenarios test(oogx): CALL different scenarios and gas accumulator Feb 5, 2025
@lorenzogentile404 lorenzogentile404 enabled auto-merge (squash) February 5, 2025 20:51
Copy link

sonarqubecloud bot commented Feb 5, 2025

@amkCha amkCha self-requested a review February 6, 2025 08:36
@lorenzogentile404 lorenzogentile404 merged commit bbe1c10 into arith-dev Feb 6, 2025
10 checks passed
@lorenzogentile404 lorenzogentile404 deleted the 1514-call-exceptions-testing branch February 6, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CALL exceptions testing
3 participants