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

Implement Dynamic Gas Cost Calculation for IP Graph Function Calls #231

Open
kingster-will opened this issue Jul 3, 2024 · 3 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@kingster-will
Copy link

Description and context

We propose to implement a dynamic gas cost calculation mechanism for different IP Graph function calls, based on memory usage, storage access, and CPU consumption. This enhancement aims to optimize the gas efficiency of our smart contracts by accurately reflecting the computational resources required for each function call.

Details

The current implementation of the IP Graph functions does not dynamically calculate gas costs based on the actual computational resources used. This can lead to inefficiencies, where some operations may consume more gas than necessary.

Implementation Steps:

  1. Benchmarking: Conduct a comprehensive benchmarking of all IP Graph functions to measure memory usage, storage access patterns, and CPU consumption under various conditions.
  2. Gas Cost Model: Develop a gas cost model that calculates the gas cost dynamically based on the benchmarking data. This model should consider gas pricing mechanisms and adjust for future changes in the protocol.
  3. Integration: Integrate the gas cost model into the IP Graph functions, ensuring that gas costs are calculated dynamically at runtime based on the actual computational resources used.

Acceptance Criteria

  • A dynamic gas cost calculation mechanism is implemented and integrated with the IP Graph functions.
  • The mechanism accurately calculates gas costs based on memory usage, storage access, and CPU consumption.
  • Benchmarking data is collected and used to inform the gas cost model.
  • The system undergoes thorough testing to ensure accuracy and efficiency of gas cost calculations.
  • Documentation is updated to reflect the new dynamic gas cost calculation mechanism.
@kingster-will kingster-will added the enhancement New feature or request label Jul 3, 2024
@kingster-will
Copy link
Author

TODO: Add EIP reference link

@LeoHChen
Copy link
Member

LeoHChen commented Jul 3, 2024

@kingster-will kingster-will self-assigned this Aug 14, 2024
@Ramarti
Copy link

Ramarti commented Sep 4, 2024

Some feedback after talking with auditors scoping, we should have different pricing strategies for read / write. Reads could also be a DDOS vector, but they should be cheaper.

@kingster-will kingster-will transferred this issue from another repository Sep 5, 2024
@kingster-will kingster-will transferred this issue from storyprotocol/protocol-temp Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants