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

chore: rename starcoin-natives to starcoin-frameworks #4189

Merged
merged 3 commits into from
Aug 29, 2024

Conversation

nkysg
Copy link
Collaborator

@nkysg nkysg commented Aug 29, 2024

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

Summary by CodeRabbit

  • New Features

    • Updated references from "starcoin-natives" to "starcoin-frameworks," indicating a reorganization of components within the project.
    • Enhanced dependency management by aligning with the new framework structure.
  • Bug Fixes

    • Corrected import paths for gas parameters, ensuring proper functionality in gas management.
  • Chores

    • Refactored multiple modules to source from "starcoin-frameworks," maintaining overall functionality while improving project architecture.
    • Introduced a new publicly accessible natives module for better organization and modularity.

Copy link

coderabbitai bot commented Aug 29, 2024

Warning

Rate limit exceeded

@nkysg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 37 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 6234cfd and b669410.

Walkthrough

The changes involve a comprehensive renaming and restructuring within the Starcoin project, where references to "starcoin-natives" have been updated to "starcoin-frameworks" across multiple files. This includes modifications in dependency declarations, import statements, and function implementations, reflecting a shift in the organization and categorization of the project's components.

Changes

Files Change Summary
Cargo.toml (multiple locations) Changed references from "vm/natives" to "vm/frameworks" in members, default-members, and dependencies.
vm/frameworks/Cargo.toml Updated package name from "starcoin-natives" to "starcoin-frameworks".
vm/gas-algebra-ext/Cargo.toml Changed dependency from starcoin-natives to starcoin-frameworks.
vm/gas-algebra-ext/src/starcoin_framework.rs Updated import statement from starcoin_natives to starcoin_frameworks.
vm/starcoin-gas-meter/Cargo.toml Replaced dependency starcoin-natives with starcoin-frameworks.
vm/starcoin-gas-meter/src/gas_meter.rs Updated struct field from starcoin_natives::GasParameters to starcoin_frameworks::GasParameters.
vm/vm-runtime/Cargo.toml Changed starcoin-natives to starcoin-frameworks in dependencies and testing features.
vm/vm-runtime/src/natives.rs Updated multiple native function imports from starcoin_natives to starcoin_frameworks.
vm/frameworks/src/lib.rs Added new module declaration for natives.
vm/frameworks/src/natives/* Updated import paths and function calls to reflect new module structure under natives.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Framework
    participant GasMeter
    participant Runtime

    User->>Framework: Request gas parameters
    Framework->>GasMeter: Fetch GasParameters
    GasMeter->>Runtime: Provide gas calculations
    Runtime-->>User: Return gas information
Loading

🐰 "Oh, what a change, a hop and a skip,
From natives to frameworks, we joyfully flip!
With paths now aligned, our code sings anew,
In a world of frameworks, there's much we can do!
So let's celebrate this fresh, bright start,
With binkies and hops, and a happy heart!" 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 044b8cf and 022c584.

Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (8)
  • Cargo.toml (3 hunks)
  • vm/frameworks/Cargo.toml (1 hunks)
  • vm/gas-algebra-ext/Cargo.toml (1 hunks)
  • vm/gas-algebra-ext/src/starcoin_framework.rs (1 hunks)
  • vm/starcoin-gas-meter/Cargo.toml (1 hunks)
  • vm/starcoin-gas-meter/src/gas_meter.rs (2 hunks)
  • vm/vm-runtime/Cargo.toml (2 hunks)
  • vm/vm-runtime/src/natives.rs (3 hunks)
Files skipped from review due to trivial changes (3)
  • Cargo.toml
  • vm/frameworks/Cargo.toml
  • vm/gas-algebra-ext/Cargo.toml
Additional comments not posted (13)
vm/starcoin-gas-meter/Cargo.toml (1)

9-9: LGTM!

The dependency change from starcoin-natives to starcoin-frameworks aligns with the PR objective of renaming.

vm/vm-runtime/Cargo.toml (2)

25-25: LGTM!

The dependency change from starcoin-natives to starcoin-frameworks aligns with the PR objective of renaming.


47-47: LGTM!

The testing feature update to include starcoin-frameworks/testing instead of starcoin-natives/testing aligns with the PR objective of renaming.

vm/gas-algebra-ext/src/starcoin_framework.rs (1)

5-5: LGTM!

The import statement change from starcoin_natives to starcoin_frameworks aligns with the PR objective of renaming.

vm/vm-runtime/src/natives.rs (7)

32-32: LGTM!

The renaming from starcoin_natives::hash::make_all to starcoin_frameworks::hash::make_all is correct and consistent.


40-40: LGTM!

The renaming from starcoin_natives::from_bcs::make_all to starcoin_frameworks::from_bcs::make_all is correct and consistent.


44-44: LGTM!

The renaming from starcoin_natives::signature::make_all to starcoin_frameworks::signature::make_all is correct and consistent.


56-56: LGTM!

The renaming from starcoin_natives::account::make_all to starcoin_frameworks::account::make_all is correct and consistent.


64-64: LGTM!

The renaming from starcoin_natives::token::make_all to starcoin_frameworks::token::make_all is correct and consistent.


68-68: LGTM!

The renaming from starcoin_natives::u256::make_all to starcoin_frameworks::u256::make_all is correct and consistent.


85-85: LGTM!

The renaming from starcoin_natives::secp256k1::make_all to starcoin_frameworks::secp256k1::make_all is correct and consistent.

vm/starcoin-gas-meter/src/gas_meter.rs (2)

43-43: LGTM!

The renaming from starcoin_natives::GasParameters to starcoin_frameworks::GasParameters is correct and consistent.


73-73: LGTM!

The renaming from starcoin_natives::GasParameters::zeros to starcoin_frameworks::GasParameters::zeros is correct and consistent.

@nkysg nkysg enabled auto-merge (squash) August 29, 2024 14:06
Copy link

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 022c584 and 6234cfd.

Files selected for processing (11)
  • vm/frameworks/src/lib.rs (1 hunks)
  • vm/frameworks/src/natives/account.rs (1 hunks)
  • vm/frameworks/src/natives/from_bcs.rs (2 hunks)
  • vm/frameworks/src/natives/hash.rs (4 hunks)
  • vm/frameworks/src/natives/secp256k1.rs (2 hunks)
  • vm/frameworks/src/natives/signature.rs (2 hunks)
  • vm/frameworks/src/natives/token.rs (1 hunks)
  • vm/frameworks/src/natives/u256.rs (2 hunks)
  • vm/gas-algebra-ext/src/starcoin_framework.rs (1 hunks)
  • vm/starcoin-gas-meter/src/gas_meter.rs (2 hunks)
  • vm/vm-runtime/src/natives.rs (3 hunks)
Files skipped from review due to trivial changes (5)
  • vm/frameworks/src/natives/from_bcs.rs
  • vm/frameworks/src/natives/hash.rs
  • vm/frameworks/src/natives/secp256k1.rs
  • vm/frameworks/src/natives/signature.rs
  • vm/frameworks/src/natives/u256.rs
Files skipped from review as they are similar to previous changes (3)
  • vm/gas-algebra-ext/src/starcoin_framework.rs
  • vm/starcoin-gas-meter/src/gas_meter.rs
  • vm/vm-runtime/src/natives.rs
Additional comments not posted (4)
vm/frameworks/src/lib.rs (2)

2-2: LGTM!

The comment provides useful context by referencing a similar file in another project.


3-3: LGTM!

The module declaration is correct and aligns with the file's purpose.

vm/frameworks/src/natives/account.rs (1)

101-101: LGTM! But verify the function usage in the codebase.

The change in the namespace indicates a restructuring of the module organization. Ensure that all references to make_module_natives are updated accordingly.

Run the following script to verify the function usage:

Verification successful

Function usage verified successfully.

All references to make_module_natives have been updated to use the new namespace crate::natives::helpers::make_module_natives consistently across the codebase. No issues were found.

  • Files checked include: u256.rs, token.rs, signature.rs, hash.rs, from_bcs.rs, account.rs, and secp256k1.rs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `make_module_natives` are updated.

# Test: Search for the function usage. Expect: Only occurrences of the new namespace.
rg --type rust -A 5 $'make_module_natives'

Length of output: 1887

vm/frameworks/src/natives/token.rs (1)

90-90: LGTM! But verify the function usage in the codebase.

The change in the namespace indicates a restructuring of the module organization. Ensure that all references to make_module_natives are updated accordingly.

Run the following script to verify the function usage:

Verification successful

Verification Successful: Namespace Update Consistent

All references to the make_module_natives function have been updated to use the new namespace crate::natives::helpers across the codebase. No outdated references were found.

  • Files verified include: u256.rs, signature.rs, secp256k1.rs, helpers.rs, hash.rs, from_bcs.rs, account.rs, and token.rs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `make_module_natives` are updated.

# Test: Search for the function usage. Expect: Only occurrences of the new namespace.
rg --type rust -A 5 $'make_module_natives'

Length of output: 1887

@nkysg nkysg merged commit 12e17fb into dag-master Aug 29, 2024
3 of 5 checks passed
@nkysg nkysg deleted the rename_framework branch August 29, 2024 15:01
@coderabbitai coderabbitai bot mentioned this pull request Sep 29, 2024
7 tasks
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.

2 participants