-
Notifications
You must be signed in to change notification settings - Fork 188
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(katana-rpc-types): proofs types serde #2872
Conversation
WalkthroughOhayo, sensei! The changes involve adding the Changes
The changes are purely related to serialization behavior and do not modify the underlying data structures or their functionality. The 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/katana/rpc/rpc-types/src/trie.rs (1)
Line range hint
80-117
: Ohayo! Excellent architectural approach to proof type serialization, sensei!The consistent use of
#[serde(transparent)]
across all proof wrapper types creates a clean and unified serialization strategy. This approach:
- Reduces JSON nesting depth
- Maintains type safety through Rust's type system
- Improves the developer experience when working with serialized proofs
The changes align perfectly with the PR's objective of enhancing proof types serialization.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
crates/katana/rpc/rpc-types/src/trie.rs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: docs
- GitHub Check: ensure-wasm
- GitHub Check: clippy
- GitHub Check: build
🔇 Additional comments (3)
crates/katana/rpc/rpc-types/src/trie.rs (3)
80-83
: Ohayo! Nice use of serde transparent attribute, sensei!The
#[serde(transparent)]
attribute is perfectly applied here, as it will serializeClassesProof
directly as its innernodes
field, reducing unnecessary JSON nesting.
105-109
: Excellent serialization optimization, sensei!The
#[serde(transparent)]
attribute will makeContractStorageProofs
serialize directly as its innerVec<Nodes>
, which simplifies the JSON structure.
Line range hint
116-117
: Perfect alignment with newtype pattern, sensei!The
#[serde(transparent)]
attribute complements the existingDeref
/DerefMut
implementations, ensuringNodes
behaves consistently as its innerVec<NodeWithHash>
for both runtime operations and serialization.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2872 +/- ##
==========================================
- Coverage 55.77% 55.76% -0.01%
==========================================
Files 447 447
Lines 57794 57794
==========================================
- Hits 32234 32230 -4
- Misses 25560 25564 +4 ☔ View full report in Codecov by Sentry. |
it should be an array instead of object https://github.com/starkware-libs/starknet-specs/blob/c94df2c5866e11c866abd3d234b0d5df681073c3/api/starknet_api_openrpc.json#L975-L1010
Summary by CodeRabbit
#[serde(transparent)]
attributeClassesProof
,ContractStorageProofs
, andNodes
structs