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

Add missing field to ExecutionResources #1301

Merged
merged 7 commits into from
Feb 23, 2024

Conversation

tkumor3
Copy link
Contributor

@tkumor3 tkumor3 commented Feb 22, 2024

Closes #1300

Missing field: https://github.com/starkware-libs/starknet-specs/blob/v0.6.0/api/starknet_api_openrpc.json#L3848

Introduced changes

  • Add missing segment_arena_builtin field to ExecutionResources
  • Use fields.Integer instead of Felt for serializing/deserializing ExecutionResources fields to align with RPC specification

  • This PR contains breaking changes

@tkumor3 tkumor3 self-assigned this Feb 22, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.99%. Comparing base (303212e) to head (abfa894).

Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1301      +/-   ##
===============================================
+ Coverage        97.96%   97.99%   +0.02%     
===============================================
  Files               93       93              
  Lines             4580     4582       +2     
===============================================
+ Hits              4487     4490       +3     
+ Misses              93       92       -1     
Files Coverage Δ
starknet_py/net/client_models.py 99.76% <100.00%> (+<0.01%) ⬆️
starknet_py/net/schemas/rpc.py 99.15% <100.00%> (+0.21%) ⬆️

Copy link
Contributor

@DelevoXDG DelevoXDG left a comment

Choose a reason for hiding this comment

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

PR name seems a bit misleading, otherwise LGTM

Comment on lines +436 to +443
assert receipt.execution_resources is not None
assert receipt.execution_resources.steps is not None
assert receipt.execution_resources.segment_arena_builtin is not None
assert receipt.execution_resources.bitwise_builtin_applications is not None
assert receipt.execution_resources.ec_op_builtin_applications is not None
assert receipt.execution_resources.memory_holes is not None
assert receipt.execution_resources.pedersen_builtin_applications is not None
assert receipt.execution_resources.range_check_builtin_applications is not None
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: since this is a hardcoded transaction, it should be possible to just assert specific values that we expect (and not just asserting that it is not None), which would give us another layer of testing (I mean serialization).

if you agree, I'd suggest we open an issue and deal with it in a separate PR, at later date.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In an ideal scenario, we should probably have unit tests for out RPC schemas 😅 However the check that you suggest can definitely improve this test. Let's discuss it further in #1219

@ddoktorski ddoktorski merged commit 167e873 into development Feb 23, 2024
16 checks passed
@ddoktorski ddoktorski deleted the tomaszkumor/execution_resources_hotfix branch February 23, 2024 10:25
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.

Error when requesting tx receipt
4 participants