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

fix(rpc): TransactionTrace matches rpc v6 specs #2581

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

Conversation

hudem1
Copy link
Contributor

@hudem1 hudem1 commented Feb 28, 2025

As agreed, i divide #2563 into 3, one PR for each of the 3 rpc pkgs

Here is the PR for rpcv6 pkg: create rpcv6.TransactionTrace instead of using vm.TransactionTrace

Main modifications:

  • TransactionTrace.ExecutionResources matches specs
  • TransactionTrace.FunctionInvocation.Events matches specs

Question

The specs say TransactionTrace.FunctionInvocation.Messages.To should be a Felt (currently a string in the code):

type OrderedL2toL1Message struct {
	Order   uint64       `json:"order"`
	From    *felt.Felt   `json:"from_address,omitempty"`
	To      string       `json:"to_address"` // todo: make common.Address after fixing starknet-api EthAddress serialisation
	Payload []*felt.Felt `json:"payload"`
}

Is this todo in the struct still valid ?
I can just re-create the type in v6 and define To as a felt instead but i'm just not sure we wanna keep it as a string even in the vm pkg.

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 99.27273% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.18%. Comparing base (50efd33) to head (deafd5c).

Files with missing lines Patch % Lines
rpc/v6/trace.go 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2581      +/-   ##
==========================================
+ Coverage   73.70%   74.18%   +0.48%     
==========================================
  Files         137      138       +1     
  Lines       16711    16833     +122     
==========================================
+ Hits        12317    12488     +171     
+ Misses       3534     3490      -44     
+ Partials      860      855       -5     

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

@rianhughes rianhughes self-requested a review February 28, 2025 12:59
@hudem1 hudem1 changed the title feat(rpcv6): Use rpcv6.TransactionTrace instead of vm.TransactionTrace feat(rpcv6): ExecutionResources match rpc v6 specs Feb 28, 2025
@hudem1 hudem1 changed the title feat(rpcv6): ExecutionResources match rpc v6 specs feat(rpcv6): TransactionTrace match rpc v6 specs Feb 28, 2025
@hudem1 hudem1 changed the title feat(rpcv6): TransactionTrace match rpc v6 specs feat(rpcv6): TransactionTrace matches rpc v6 specs Feb 28, 2025
@rodrigo-pino rodrigo-pino changed the title feat(rpcv6): TransactionTrace matches rpc v6 specs fix(rpc): TransactionTrace matches rpc v6 specs Feb 28, 2025
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.

The code looks real good. I would like to add a real world test. Is this possible? Something that without this commit would cause the old code to fail

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.

2 participants