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

clean(rpc): refactor & remove unused code #2639

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

hudem1
Copy link
Contributor

@hudem1 hudem1 commented Mar 12, 2025

a PR to clean / reorganize a bit

  • Removing deadcode concerning Data Availability in rpcv6 & vm/trace.go
  • Moving rpc adapters to dedicated file

@hudem1 hudem1 changed the title Hudem1/clean/transaction trace clean(rpc): refactor & remove unused code Mar 12, 2025
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 76.47059% with 80 lines in your changes missing coverage. Please review.

Project coverage is 75.09%. Comparing base (2ebe3e0) to head (77312a7).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
rpc/v6/adapters.go 75.98% 68 Missing and 11 partials ⚠️
rpc/v6/events.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2639      +/-   ##
==========================================
- Coverage   75.20%   75.09%   -0.12%     
==========================================
  Files         140      140              
  Lines       16815    16786      -29     
==========================================
- Hits        12646    12605      -41     
- Misses       3340     3349       +9     
- Partials      829      832       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@rodrigo-pino rodrigo-pino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see is still a draft and has the small issues we have discussed recently of the use of T vs *T. I'll let you fix them. I now this is a refactor but I am ok with extend this function to remove these when straightforward

@@ -339,3 +345,392 @@ func adaptFeederExecutionResources(resources *starknet.ExecutionResources) Compu
SegmentArena: builtins.SegmentArena,
}
}

func adaptToFeederResourceBounds(rb *map[Resource]ResourceBounds) *map[starknet.Resource]starknet.ResourceBounds {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for pointers, either as input or output parameters. map[K]V is already a pointer by default

Copy link
Contributor Author

@hudem1 hudem1 Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, I just moved those functions from the other file to this file.
Yeah for sure, I'll make the changes to all functions needing it in this PR!

return &feederResourceBounds
}

func adaptToFeederDAMode(mode *DataAvailabilityMode) *starknet.DataAvailabilityMode {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return value type here.

@rianhughes rianhughes self-requested a review March 14, 2025 09:50
@rianhughes
Copy link
Contributor

This approach looks good to me

@hudem1 hudem1 marked this pull request as ready for review March 14, 2025 11:05
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.

3 participants