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

feat(rpc): trivial methods using new serialization trait #1851

Merged
merged 10 commits into from
Mar 13, 2024

Conversation

Mirko-von-Leipzig
Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig commented Mar 8, 2024

Implements some of the simpler RPC methods using the new trait.

Note that this explicly targets RPC v0.7-rc2 only. No backwards compatibility yet - let's fully support v0.7 and then we can work backwards. This let's us skip work for v0.4 and v0.5 if we manage to remove them before this work gets there.


Particular review focus should be on the correctness of the DTO serialization ito inner types being used. i.e. ensure that if the spec says BLOCK_HASH is a FELT then the serialization implementation should use serialize(&Felt(...)).

There isn't really a super easy way to enforce this apart from rigorous manual auditing when adding/updating DTOs.


Adds DTO implementations for:

FELT
BLOCK_HASH
BLOCK_NUMBER
SYNC_STATUS
CHAIN_ID

and implements methods

starknet_blockHashAndNumber
starknet_blockNumber
starknet_chainId
starknet_syncing

Part of #1830

@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the feat/version-rpc/starknet_syncing branch from df3dff3 to d09003b Compare March 8, 2024 12:12
@Mirko-von-Leipzig Mirko-von-Leipzig changed the title feat(rpc): starknet_syncing feat(rpc): basic methods using new serialization trait Mar 8, 2024
@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the feat/version-rpc/starknet_syncing branch 3 times, most recently from fae0027 to e83d20f Compare March 11, 2024 13:21
@Mirko-von-Leipzig Mirko-von-Leipzig marked this pull request as ready for review March 11, 2024 13:25
@Mirko-von-Leipzig Mirko-von-Leipzig requested a review from a team as a code owner March 11, 2024 13:25
@Mirko-von-Leipzig Mirko-von-Leipzig changed the title feat(rpc): basic methods using new serialization trait feat(rpc): trivial methods using new serialization trait Mar 11, 2024
Copy link
Contributor

@kkovaacs kkovaacs left a comment

Choose a reason for hiding this comment

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

LGTM, except for the dbg!() @sistemd already pointed out.

@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the feat/version-rpc/starknet_syncing branch from e83d20f to 30c5e0e Compare March 13, 2024 07:17
@Mirko-von-Leipzig Mirko-von-Leipzig merged commit b4b51ea into main Mar 13, 2024
7 checks passed
@Mirko-von-Leipzig Mirko-von-Leipzig deleted the feat/version-rpc/starknet_syncing branch March 13, 2024 08: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.

3 participants