walnuthq / starkflare

This tool monitors the resource usage of the StarkNet Mainnet rollup in real time, such as calldata, storage, and gas consumption. Its aim is to help take steps to further optimize the rollup.
https://starkflare.pages.dev
Apache License 2.0
5 stars 11 forks source link

Data tile BE: Transactions burning most steps #7

Closed mazurroman closed 4 months ago

mazurroman commented 5 months ago

Feel free to join our telegram to get latest updates: https://t.me/+DYI4FMia43I1NDI8

Update the get_common_data function in the https://github.com/walnuthq/starkflare-indexer backend repo to include a new field in the response called top_transactions_by_steps. This field should contain a list of the top 10 transactions that consumed the highest amount of steps over the last 7 days.

For each transaction in the top_transactions_by_steps list, include the following data:

Implement a new function to retrieve this data and call it from within the get_common_data function.

Note: The top_transactions_by_steps field should be added to the existing response format of get_common_data without modifying the other fields.

The exact data format as well as more instructions defined in: https://github.com/walnuthq/starkflare/issues/8

khayss commented 5 months ago

Can I work on this issue?

princeibs commented 5 months ago

Can I hop on this?

mazurroman commented 5 months ago

None of the comments contains any specifics on how to resolve the issue. We are keeping it open for anyone to grab

fishonamos commented 5 months ago

I am Backend dev. To solve this, I will create a new function to query the database for the top 10 transactions consuming the highest steps over the last 7 days. I will also update the get_common_data function to call this new function and include the retrieved data in the response. @mazurroman

adrianvrj commented 5 months ago

Hello, my name is Adrián Vargas, I am a passionate developer introducing himself to the web3 world, I am currently a machine learning developer for HPE and I really enjoy coding. I would approach this issue as following:

Understand Requirements: Carefully read and understand the requirements outlined in the issue #8. Understand what needs to be achieved and how the new field should be added to the response format.

Review Existing Code: Go through the existing codebase, specifically the get_common_data function in the starkflare-indexer backend repository. Understand how the function is structured and how it currently generates the response.

Identify Data Source: Determine where the data for the new field, top_transactions_by_steps, will be sourced from. This may involve querying transaction data from the blockchain or accessing a database where transaction information is stored.

Implement New Function: Create a new function, let's call it get_top_transactions_by_steps, to retrieve the required data. This function should fetch the top 10 transactions that consumed the highest amount of steps over the last 7 days. Each transaction should include the transaction hash, number of steps consumed, timestamp, and block number.

Modify Response Format: Update the get_common_data function to include the new field top_transactions_by_steps in its response format. Ensure that this modification does not affect the existing response format or other fields returned by the function.

Integrate New Function: Call the get_top_transactions_by_steps function from within the get_common_data function. Populate the top_transactions_by_steps field with the data retrieved from this function.

Test: Test the modified get_common_data function to ensure that it returns the expected response format with the new field included. Verify that the top_transactions_by_steps field contains accurate data for the top 10 transactions consuming the highest amount of steps over the last 7 days.

barabanovro commented 5 months ago

Hi everyone! Thank you for your interest and comments. We have assigned this issue to @adrianvrj, who provided the most detailed response.

adrianvrj commented 5 months ago

Hi, I just created a pr in the indexer repo.

https://github.com/walnuthq/starkflare-indexer/pull/2