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

Starknet's getProof rpc method #2194

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

Conversation

pnowosie
Copy link
Contributor

@pnowosie pnowosie commented Oct 3, 2024

Fixes #2180

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 67.78243% with 77 lines in your changes missing coverage. Please review.

Project coverage is 75.41%. Comparing base (00ac988) to head (958280b).

Files with missing lines Patch % Lines
rpc/storage.go 69.76% 35 Missing and 17 partials ⚠️
core/state.go 34.37% 15 Missing and 6 partials ⚠️
blockchain/blockchain.go 62.50% 2 Missing and 1 partial ⚠️
core/trie/proof.go 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2194      +/-   ##
==========================================
- Coverage   75.60%   75.41%   -0.20%     
==========================================
  Files         104      105       +1     
  Lines       11102    11313     +211     
==========================================
+ Hits         8394     8532     +138     
- Misses       2074     2124      +50     
- Partials      634      657      +23     

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

@pnowosie pnowosie force-pushed the pnowosie/2180-starknet-getProof-rpc branch from 301250f to d383531 Compare October 3, 2024 15:11
@pnowosie pnowosie force-pushed the pnowosie/2180-starknet-getProof-rpc branch from 1ef09de to a33464e Compare October 10, 2024 07:58
@pnowosie pnowosie marked this pull request as ready for review October 10, 2024 07:59
core/state.go Show resolved Hide resolved
rpc/storage_test.go Outdated Show resolved Hide resolved
rpc/storage_test.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
core/trie/proof.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
rpc/handlers.go Outdated Show resolved Hide resolved
blockchain/pending.go Outdated Show resolved Hide resolved
rpc/handlers.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
rpc/storage.go Outdated Show resolved Hide resolved
@pnowosie pnowosie force-pushed the pnowosie/2180-starknet-getProof-rpc branch 2 times, most recently from b292454 to 1e50ea2 Compare October 11, 2024 07:42
@pnowosie pnowosie force-pushed the pnowosie/2180-starknet-getProof-rpc branch 2 times, most recently from f9089bc to f3ded4a Compare October 16, 2024 12:09
starknet/.gitignore Outdated Show resolved Hide resolved
@rianhughes rianhughes self-requested a review October 17, 2024 06:47
rpc/storage_test.go Outdated Show resolved Hide resolved

func getProof(t *trie.Trie, elt *felt.Felt) ([]*HashToNode, error) {
feltBytes := elt.Bytes()
key := trie.NewKey(core.ContractStorageTrieHeight, feltBytes[:])
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can export the tries height, and use t.Height() here?

rpc/storage.go Outdated Show resolved Hide resolved
@pnowosie pnowosie force-pushed the pnowosie/2180-starknet-getProof-rpc branch 2 times, most recently from bea2913 to 8cdcc08 Compare October 22, 2024 14:39
rpc/handlers.go Outdated
{Name: "block_id"}, {Name: "classes", Optional: true}, {Name: "contracts", Optional: true}, {Name: "storage_keys", Optional: true},
},
Handler: h.StorageProof,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need it here, this method should be present only in 0.8 endpoint

@pnowosie pnowosie force-pushed the pnowosie/2180-starknet-getProof-rpc branch from 8cdcc08 to 992a329 Compare October 22, 2024 15:10
@pnowosie pnowosie requested a review from kirugan October 23, 2024 11:06
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.

RPC08 - starknet_getStorageProof
3 participants