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: class import #235

Merged
merged 3 commits into from
Sep 9, 2024
Merged

feat: class import #235

merged 3 commits into from
Sep 9, 2024

Conversation

jbcaron
Copy link
Member

@jbcaron jbcaron commented Aug 23, 2024

Pull Request type

  • Refactoring (no functional changes, no API changes)

What is the current behavior?

Resolves: #233

What is the new behavior?

  • computation hash management: now based on Starknet version instead of block numbers
  • database changes: removed the legacy JSON class from the database
  • legacy class decompression: decompress the legacy class and create a blockifier class just-in-time for execution
  • sierra class compilation: sierra class is now compiled using our custom type
  • class fetch optimization: optimized class fetching through FGW

Does this introduce a breaking change?

Other information

@jbcaron jbcaron self-assigned this Aug 23, 2024
@jbcaron jbcaron changed the title Class class import Aug 23, 2024
@antiyro antiyro marked this pull request as ready for review August 26, 2024 14:44
Copy link
Collaborator

@Trantorian1 Trantorian1 left a comment

Choose a reason for hiding this comment

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

Seems good to me. Please check the below comments. It might also be a good idea to have someone like @cchudant check out this PR if you feel like you need a deeper look at the underlying logic of this part of the code, since I feel a bit rusty in this regard.

crates/client/db/src/class_db.rs Show resolved Hide resolved
crates/client/db/src/class_db.rs Show resolved Hide resolved
crates/client/sync/src/fetch/fetchers.rs Show resolved Hide resolved
crates/client/sync/src/fetch/fetchers.rs Show resolved Hide resolved
crates/primitives/class/src/lib.rs Show resolved Hide resolved
crates/primitives/class/resources/missed_classes.json Outdated Show resolved Hide resolved
Copy link
Member

@cchudant cchudant left a comment

Choose a reason for hiding this comment

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

finally, class hashes!! 🥳

crates/client/db/src/class_db.rs Show resolved Hide resolved
crates/client/db/src/class_db.rs Show resolved Hide resolved
crates/client/db/src/class_db.rs Show resolved Hide resolved
crates/client/sync/src/fetch/fetchers.rs Show resolved Hide resolved
crates/primitives/chain_config/src/starknet_version.rs Outdated Show resolved Hide resolved
crates/primitives/chain_config/src/starknet_version.rs Outdated Show resolved Hide resolved
}
}

// use anyhow::{Context, Error, Ok, Result};
Copy link
Member

Choose a reason for hiding this comment

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

should we remove that code?

also i think we should move toward tdelabro's hash chain struct, it's pretty cool

Copy link

github-actions bot commented Sep 3, 2024

Coverage report

The coverage rate is 70.13647742873293%

57% of new lines are covered.

Diff Coverage details (click to unfold)

crates/client/rpc/src/test_utils.rs

100.0% of new lines are covered

crates/primitives/transactions/src/compute_hash.rs

100.0% of new lines are covered

crates/primitives/class/src/class_hash.rs

91.42857142857143% of new lines are covered

crates/primitives/class/src/class_update.rs

0.0% of new lines are covered

crates/client/block_import/src/pre_validate.rs

84.61538461538461% of new lines are covered

crates/primitives/state_update/src/lib.rs

0.0% of new lines are covered

crates/client/rpc/src/versions/v0_7_1/methods/read/get_class_at.rs

100.0% of new lines are covered

crates/primitives/block/src/lib.rs

25.0% of new lines are covered

crates/client/rpc/src/providers/mempool.rs

0.0% of new lines are covered

crates/primitives/class/src/into_starknet_core.rs

100.0% of new lines are covered

crates/client/rpc/src/versions/v0_7_1/methods/trace/simulate_transactions.rs

0.0% of new lines are covered

crates/primitives/transactions/src/broadcasted_to_blockifier.rs

0.0% of new lines are covered

crates/client/rpc/src/utils/transaction.rs

0.0% of new lines are covered

crates/client/db/src/storage_updates.rs

100.0% of new lines are covered

crates/primitives/chain_config/src/chain_config.rs

100.0% of new lines are covered

crates/primitives/class/src/compile.rs

76.59574468085106% of new lines are covered

crates/client/sync/src/fetch/fetchers.rs

89.79591836734694% of new lines are covered

crates/client/rpc/src/versions/v0_7_1/methods/read/get_class.rs

100.0% of new lines are covered

crates/primitives/class/src/lib.rs

46.666666666666664% of new lines are covered

crates/client/rpc/src/versions/v0_7_1/methods/read/estimate_fee.rs

0.0% of new lines are covered

crates/primitives/chain_config/src/starknet_version.rs

56.0% of new lines are covered

crates/client/db/src/class_db.rs

70.73170731707317% of new lines are covered

crates/client/exec/src/blockifier_state_adapter.rs

0.0% of new lines are covered

crates/client/block_import/src/types.rs

100.0% of new lines are covered

crates/primitives/transactions/src/from_broadcasted_transaction.rs

0.0% of new lines are covered

crates/primitives/block/src/header.rs

100.0% of new lines are covered

@jbcaron jbcaron added the full node Full Node only related issues label Sep 9, 2024
@jbcaron jbcaron changed the title class import feat: class import Sep 9, 2024
@antiyro antiyro merged commit d50814a into main Sep 9, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full node Full Node only related issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

handling missing old_declared_contracts on mainnet state updates before block 2700
4 participants