-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: builders #159
fix: builders #159
Conversation
Warning Rate limit exceeded@beer-1 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 53 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughThe pull request modifies the build process for the MoveVM project by replacing the Docker image used for Linux release builds from CentOS 7 to Debian 11. The Changes
Possibly related PRs
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (5)
builders/Makefile (1)
Documentation needed for platform migration from CentOS to Debian
The verification confirms the migration from CentOS 7 to Debian 11 (Bullseye) and reveals that:
- The
Dockerfile.centos7
has been removed and replaced withDockerfile.debian
- The builders/README.md lacks information about the platform change
- The change impacts the build environment and potentially the minimum glibc requirements
Required documentation updates:
- Add platform requirements and glibc compatibility information to builders/README.md
- Document that builds now use Debian 11 (supported until August 2026)
- Include migration steps for users with existing CentOS-based workflows
- Update the changelog section in builders/README.md
🔗 Analysis chain
Line range hint
1-23
: Consider documenting the migration impactThe switch from CentOS 7 to Debian 11 represents a significant change in the build environment. While the changes look correct, it would be helpful to:
- Document any potential breaking changes for users
- Provide migration steps for existing workflows
- Update related documentation about supported platforms
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for documentation updates # Test: Look for README or documentation files that might need updates fd -e md -e txt -e rst . | xargs rg -l 'centos|debian|ubuntu|alpine'Length of output: 70
Script:
#!/bin/bash # Let's try a different approach to find documentation and platform-related files # First, check if there are any documentation directories fd -t d -i "doc|docs|documentation" # Then, let's look for any README files fd -g "README*" # Also check the Dockerfiles to understand the extent of platform changes fd -g "Dockerfile*" # And check git history for related changes git log --grep="debian\|centos\|platform" -i --pretty=format:"%h %s" --since="6 months ago"Length of output: 709
Script:
#!/bin/bash # Let's check the content of the builders README and the Dockerfiles to understand the platform changes cat builders/README.md # Check the Dockerfiles to see the actual changes in build environment cat builders/Dockerfile.debian cat builders/Dockerfile.cross cat builders/Dockerfile.alpine # Check if there were any previous platform-specific files that were removed git log --diff-filter=D --summary | grep -i "dockerfile\|centos"Length of output: 8792
README.md (1)
16-16
: Consider adding migration notes for CentOS users.Since CentOS 7 support has been removed, it would be helpful to add a note about migration paths for existing CentOS users, either in this section or in a new "Migration Guide" section.
Add something like:
Linux (tested on Ubuntu, Debian, and Alpine) and macOS are supported. + +> **Note for CentOS users:** As of version X.Y.Z, we've moved away from CentOS 7 support. +> If you're currently using CentOS 7, we recommend migrating to one of the supported distributions above.precompile/modules/minitia_stdlib/sources/cosmos.move (1)
147-147
: Consider adding base64 decode error handlingThe base64 encoding implementation is correct, but consider adding error handling for potential base64 decode failures on the receiving end.
Consider adding a comment indicating that these fields expect base64-encoded data:
struct ScriptRequest has copy, drop { _type_: String, sender: String, - code_bytes: String, // base64 encoded + /// Base64-encoded bytecode for the script + code_bytes: String, - args: vector<String> // base64 encoded + /// Vector of base64-encoded arguments + args: vector<String> }Also applies to: 149-149, 158-159
builders/Dockerfile.debian (2)
22-22
: Consolidate redundant permission changesThe
chmod -R 777 /usr/local/cargo
command is executed both in line 22 and line 26. This redundancy can be eliminated to streamline the Dockerfile.Apply this diff to remove the redundant command:
&& rustup --version \ && cargo --version \ && rustc --version \ - && chmod -R 777 /usr/local/cargo \ && rustup target add aarch64-unknown-linux-gnu # allow non-root user to download more deps later RUN chmod -R g+w $RUSTUP_HOME $CARGO_HOME /usr/local/cargo
Also applies to: 26-26
16-16
: Consider using the latest stable Rust toolchainSpecifying Rust toolchain version
1.80.1
may prevent you from receiving the latest features and security updates. Unless there's a specific requirement for this version, consider using thestable
toolchain to automatically get the latest stable release.Apply this diff to use the stable toolchain:
&& chmod +x rustup-init \ - && ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.80.1 \ + && ./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable \ && rm rustup-init \
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (9)
Makefile
(1 hunks)README.md
(1 hunks)builders/Dockerfile.centos7
(0 hunks)builders/Dockerfile.debian
(1 hunks)builders/Makefile
(2 hunks)crates/e2e-move-tests/Cargo.toml
(1 hunks)crates/e2e-move-tests/src/tests/cosmos.rs
(5 hunks)precompile/modules/initia_stdlib/sources/cosmos.move
(9 hunks)precompile/modules/minitia_stdlib/sources/cosmos.move
(9 hunks)
💤 Files with no reviewable changes (1)
- builders/Dockerfile.centos7
✅ Files skipped from review due to trivial changes (1)
- Makefile
🔇 Additional comments (18)
builders/Makefile (3)
3-5
: LGTM: New Debian target properly defined
The new docker-image-debian
target is correctly implemented with proper phony declaration and consistent naming convention.
21-21
: LGTM: Docker push command updated
The docker-publish
target correctly pushes the new Debian image.
16-16
: Verify all dependent targets are updated
The docker-images
target dependencies have been updated to use docker-image-debian
instead of the removed CentOS target.
#!/bin/bash
# Description: Verify no remaining references to centos7 in the codebase
# Test: Search for any remaining references to centos7. Expect: No matches
rg -i 'centos7|centos-7' --type make
crates/e2e-move-tests/Cargo.toml (1)
25-25
: LGTM! Verify workspace-level dependency configuration.
The addition of the base64
dependency with workspace-level version management is consistent with the project's dependency management approach.
Let's verify the workspace-level configuration:
✅ Verification successful
✓ Workspace dependency configuration is correct
The base64
dependency is properly configured:
- Defined in root
Cargo.toml
with version "0.21.7" - Correctly referenced with
workspace = true
in bothe2e-move-tests
andnatives
crates - Follows consistent dependency management pattern across the workspace
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify base64 dependency is properly configured at workspace level
# Test 1: Check if base64 is defined in the workspace's Cargo.toml
rg -A 2 'base64.*=.*{.*version' Cargo.toml
# Test 2: Ensure consistent usage across workspace
rg 'base64.*=.*workspace.*=.*true' -g 'Cargo.toml'
Length of output: 330
Script:
#!/bin/bash
# Let's verify the workspace configuration more precisely
# Check base64 dependency configuration in root Cargo.toml
rg "^\[workspace\.dependencies\]" -A 20 Cargo.toml
# Check if base64 is used consistently across all Cargo.toml files
fd Cargo.toml --exec grep -l "base64"
Length of output: 1047
Script:
#!/bin/bash
# Let's check the base64 dependency in the root Cargo.toml with a more specific pattern
rg "^base64.*=.*" Cargo.toml
# Let's also check the exact content around base64 in the files that use it
rg -C 2 "base64.*=.*" ./crates/natives/Cargo.toml ./crates/e2e-move-tests/Cargo.toml
Length of output: 690
README.md (1)
16-16
: Verify testing on listed distributions.
The README now claims testing on Ubuntu, Debian, and Alpine. Let's verify this claim by checking the CI configuration.
✅ Verification successful
Testing claims in README.md are accurate
Based on the build configuration files:
- Ubuntu/Debian: Confirmed via Dockerfile.debian using debian:11-slim as base image
- Alpine: Confirmed via Dockerfile.alpine using golang:1.22-alpine as base image
- Cross-platform builds are properly set up for both architectures (x86_64 and aarch64)
- Build scripts (build_linux.sh, build_macos.sh, build_muslc.sh) handle compilation for all claimed platforms
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check CI configuration for testing across different Linux distributions
# Expected: Find evidence of testing on Ubuntu, Debian, and Alpine
# Look for CI configuration files
echo "Searching for CI configuration files..."
fd -e yml -e yaml
# Search for distribution specifications in CI files
echo -e "\nSearching for distribution specifications in CI..."
rg -i "ubuntu|debian|alpine" -g "*.{yml,yaml}"
Length of output: 423
Script:
#!/bin/bash
# Let's try a different approach to find CI and build configurations
# Look for any CI/build related files
echo "=== Searching for CI and build files ==="
fd -t f "circle|github|gitlab|azure|jenkins|docker|makefile|build" -i
# Check content of Dockerfiles for distribution info
echo -e "\n=== Checking Dockerfiles for base images ==="
fd -t f "dockerfile" -i -x cat {}
# Check Makefiles for any distribution-specific targets
echo -e "\n=== Checking Makefiles for distribution info ==="
fd -t f "makefile" -i -x cat {}
# Look for any test scripts that might indicate platform testing
echo -e "\n=== Checking for test scripts with platform info ==="
fd -t f -e sh -e bash -x cat {}
Length of output: 18863
precompile/modules/initia_stdlib/sources/cosmos.move (4)
14-14
: LGTM: Base64 import addition
The addition of the base64 module import is appropriate for the new encoding requirements.
82-82
: LGTM: Consistent base64 encoding of binary arguments
The change from vector<vector<u8>>
to vector<String>
with base64 encoding ensures safe transport of binary data while maintaining data integrity.
Also applies to: 93-93
147-149
: LGTM: Consistent encoding of script data
The base64 encoding of both code_bytes
and args
is implemented correctly and maintains consistency with the module's encoding pattern.
Also applies to: 158-159
364-365
: Verify the impact of parameter renaming
The renaming of parameters from source_port/channel
to source_port_id/channel_id
improves clarity but may affect existing integrations.
Also applies to: 389-390
✅ Verification successful
Let's examine the actual usage context in these files to determine if they are affected by the parameter renaming.
Based on the comprehensive search results, I can now provide the final response:
Parameter renaming is safe and properly handled
The parameter renaming from source_port/channel
to source_port_id/channel_id
only occurs within the PayFeeRequest
struct, while the actual function parameters and all other usages maintain the original naming convention of source_port/channel
. The change is localized to the internal request structure and doesn't affect external integrations.
- The
pay_fee
function signature consistently usessource_port/channel
in both the Move modules and documentation - All test files use
source_port/channel
format - The renaming only affects the internal mapping in the
PayFeeRequest
struct where the parameters are mapped to their IBC protocol counterparts
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any existing usages of the old parameter names that might need updating
# Search for potential usages of the old parameter names in tests or dependent modules
rg -l 'source_port[^_]|source_channel[^_]'
Length of output: 288
Script:
#!/bin/bash
# Check the actual usage context in the identified files
echo "=== Checking cosmos.move files ==="
rg -A 2 -B 2 'source_port[^_]|source_channel[^_]' precompile/modules/*/sources/cosmos.move
echo -e "\n=== Checking documentation files ==="
rg -A 2 -B 2 'source_port[^_]|source_channel[^_]' precompile/modules/*/doc/cosmos.md
echo -e "\n=== Checking test files ==="
rg -A 2 -B 2 'source_port[^_]|source_channel[^_]' crates/e2e-move-tests/src/tests/cosmos.rs
Length of output: 28214
precompile/modules/minitia_stdlib/sources/cosmos.move (3)
14-14
: LGTM: Base64 import addition
The addition of the base64 module import is appropriate for the new encoding requirements.
364-365
: Breaking Change: Verify impact of parameter renaming
The renaming of source_port
to source_port_id
and source_channel
to source_channel_id
improves clarity but constitutes a breaking change. Ensure all consumers are updated accordingly.
#!/bin/bash
# Search for PayFeeRequest usage in the codebase
rg -A 5 "PayFeeRequest.*source_port[^_]"
rg -A 5 "PayFeeRequest.*source_channel[^_]"
Consider adding a migration guide or deprecation notice if this is a public API.
Also applies to: 389-390
82-82
: Verify base64 encoding compatibility with consumers
The change from raw bytes to base64-encoded strings is well-implemented. However, ensure that all consumers of this API are updated to handle base64-encoded arguments.
Also applies to: 93-93
✅ Verification successful
The previous ast-grep pattern might have failed due to syntax. Let's try to gather more context about the ExecuteRequest usage and base64 handling in the codebase to make a more informed decision.
Let's look for actual usage of the move_execute function and any test cases to understand how the base64 encoding is handled by consumers.
Based on the gathered information, I can now provide a final response:
Base64 encoding change is properly handled by all consumers
The change from vector<vector<u8>>
to base64-encoded vector<String>
is safe because:
- The base64 encoding is handled internally by the
move_execute
function usingvector::map(args, |arg| base64::to_string(arg))
- All consumers (multisig, multisig_v2, minitswap) call
move_execute
with raw bytes, and the encoding is transparently handled - Test cases in
cosmos.rs
verify the correct base64 encoding of arguments in the final JSON payload
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for direct usage of ExecuteRequest to ensure consumers are updated
ast-grep --pattern 'ExecuteRequest { $$$args$$$ }'
Length of output: 88
Script:
#!/bin/bash
# Search for ExecuteRequest usage with different patterns
rg -A 5 "ExecuteRequest"
# Search for any base64 encoding/decoding related functions
rg -A 3 "base64"
# Search for specific file content to understand the context better
cat precompile/modules/minitia_stdlib/sources/cosmos.move
Length of output: 43419
Script:
#!/bin/bash
# Search for any consumers of move_execute function
rg -A 5 "move_execute\("
# Search for any test files that might be using ExecuteRequest
rg -A 5 "MsgExecute" --type rust
Length of output: 6750
crates/e2e-move-tests/src/tests/cosmos.rs (5)
11-11
: LGTM: Base64 dependency correctly imported.
The addition of the base64 dependency is appropriate for the new encoding requirements.
401-401
: LGTM: Updated MsgPayPacketFee field names.
The field names in the message format have been correctly updated to match the new Cosmos message structure (source_channel_id
and source_port_id
).
446-452
: LGTM: Base64 encoding properly implemented for move_execute.
The implementation correctly:
- Uses the standard base64 engine
- Encodes the arguments before including them in the message
- Maintains proper message structure
537-543
: LGTM: Base64 encoding properly implemented for move_script.
The implementation correctly handles base64 encoding for both code bytes and arguments, maintaining proper message structure.
581-585
: LGTM: Base64 encoding properly implemented for move_script_with_json.
The implementation correctly handles base64 encoding for code bytes while maintaining proper JSON message structure.
builders/Dockerfile.debian (1)
35-37
: Verify the necessity of creating /.cargo
directory
Creating the /.cargo
directory at the root level may not be necessary, as Cargo typically looks for configuration in $CARGO_HOME
or the user's home directory. Ensure that this configuration is required and consider placing it in a standard location.
Run the following script to check for references to /.cargo
in the codebase:
✅ Verification successful
Let me check the cargo-config file and any related documentation to understand the necessity of this configuration.
Let me check if there are any build scripts or documentation that might explain this setup.
Let me check the content of the build scripts and README in the builders directory.
Creating /.cargo
directory at root is necessary for cross-compilation setup
The /.cargo
directory setup is required for this project's cross-compilation workflow. The project uses Docker containers to cross-compile Rust libraries for multiple platforms (Linux, MacOS) and architectures (x86_64, aarch64), as evidenced by the build scripts and README. The root-level cargo config is necessary to ensure consistent build settings across all targets within the containerized build environment.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for references to '/.cargo' in the codebase.
# Search for '/.cargo' usage. Expect: Only necessary references.
rg '/\.cargo'
Length of output: 492
Script:
#!/bin/bash
# Check the content of the cargo config file
cat guest/cargo-config
# Look for any documentation or comments explaining this setup
rg -g "!*.lock" -g "!*.json" -i "cargo.*config" -A 5 -B 5
Length of output: 1554
Script:
#!/bin/bash
# Look for build scripts and documentation
fd -e sh -e md . builders guest
# Check content of any build scripts in guest directory that might explain the cargo setup
fd -e sh . guest --exec cat {}
Length of output: 322
Script:
#!/bin/bash
# Check the content of build scripts and README
cat builders/README.md
cat builders/guest/build_linux.sh
cat builders/guest/build_macos.sh
cat builders/guest/build_muslc.sh
Length of output: 5759
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Chores