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

Implemented starknet_getClassAt and starknet_getClassHashAt #118

Merged
merged 4 commits into from
Feb 7, 2024
Merged

Implemented starknet_getClassAt and starknet_getClassHashAt #118

merged 4 commits into from
Feb 7, 2024

Conversation

Trantorian1
Copy link
Member

Pull Request type

  • Bugfix

What is the current behavior?

  • get_class_hash_at has been marked as TODO and does not return.
  • get_class_at has been marked as TODO and does not retrieve the correct contract ABI.
  • Contract ABI has incorrect values in ABI function output field.
  • Failed blockifier to starknet-core conversion on contrat classes which did not define an L1_HANDLER or CONSTRUCTOR in their entrypoints.

Resolves: #32 #33 #34

What is the new behavior?

  • Contract ABI can now be retrieved based on contract address, not just class hash.
  • starknet_getClassHashAt retrieves the correct class hash.
  • starknet_getClassAt retrieves the correct class and ABI.
  • ABI function output field now has the correct values (was previously using the value of ABI function input field).
  • blockifier to starknet-core contract class conversion now works even if L1_HANDLER or CONSTRUCTOR is not defined.
  • Added info log output for when a class is being downloaded.

Does this introduce a breaking change?

No changes have been made to class or ABI storage, so there is no need to synchronize the database

Other information

⚠️ Note that due to how the genesis block is currently being stored, contract address to class equivalences relations are not being inserted for block 0. This causes issues for starknet_getClassHashAt and starknet_getClassAt on any class/contract defined on block 0. See #54 for more details.

starknet_getClass, starknet_getClassHashAt and starknet_getClassAt were briefly tested on the following classes:

More tests will need to follow in Ditto.

⚠️ Note that there still appears to be a deserialization issue at block 20731. This is likely to be similar to #116.

@Trantorian1 Trantorian1 added the fix Fixed an issue label Feb 7, 2024
@Trantorian1 Trantorian1 self-assigned this Feb 7, 2024
@antiyro antiyro merged commit 73e428f into KasarLabs:main Feb 7, 2024
4 of 7 checks passed
@Trantorian1 Trantorian1 deleted the fix/starknet_getClass branch February 8, 2024 08:49
@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fix Fixed an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat/starknet_getClass
2 participants