Skip to content

feat(ethexe/cli): add additional commands#5094

Merged
StackOverflowExcept1on merged 1 commit intomasterfrom
av/ethexe-cli-additional-commands
Jan 20, 2026
Merged

feat(ethexe/cli): add additional commands#5094
StackOverflowExcept1on merged 1 commit intomasterfrom
av/ethexe-cli-additional-commands

Conversation

@StackOverflowExcept1on
Copy link
Copy Markdown
Member

Ref #4963

Demo of claiming message from mailbox:

./examples/ping/src/wasm.rs
use gstd::{msg, prelude::*};

#[unsafe(no_mangle)]
extern "C" fn init() {
    gstd::debug!("init() with value={}", msg::value());
    let message_id = msg::send_bytes(
        gstd::actor_id!("0x0000000000000000000000003C44CdDdB6a900fa2b585dd299e03d12FA4293BC"),
        b"HEY",
        10_000_000_000_000_000_000,
    )
    .unwrap();
    gstd::debug!("Sent message with id: {message_id:?}");
}

#[unsafe(no_mangle)]
extern "C" fn handle_reply() {
    let payload = msg::load_bytes().unwrap();
    gstd::debug!(
        "handle_reply() with value={}, payload={:?}",
        msg::value(),
        payload
    );
}
# tab 1
cargo build --package ethexe-cli --release
RUST_LOG="info,gwasm=debug" ./target/release/ethexe run --dev --verbose

# tab 2
./upload.sh
./upload.sh
#!/usr/bin/env bash
set -euo pipefail

SENDER="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
SENDER2="0x71be63f3384f5fb98995898a86b02fb2426c5788"
DEMO_PING="./target/wasm32-gear/release/demo_ping.opt.wasm"
RPC_URL="ws://localhost:9944"

cargo build --package demo-ping --release --features debug,ethexe
cargo build --package ethexe-cli --release

if ! CODE_ID_RESULT=$(./target/release/ethexe tx --sender $SENDER2 upload $DEMO_PING --watch --json 2>/dev/null); then
  ERROR=$(jq -r ".error" <<< "$CODE_ID_RESULT")
  echo "Failed to upload code: $ERROR"
  exit 1
fi

CODE_ID=$(jq -r ".code_id" <<< "$CODE_ID_RESULT")
echo "CodeId of demo-ping: $CODE_ID"

if ! ACTOR_ID_RESULT=$(./target/release/ethexe tx --sender $SENDER2 create "$CODE_ID" --salt "$(cast hash-zero)" --json 2>/dev/null); then
  ERROR=$(jq -r ".error" <<< "$ACTOR_ID_RESULT")
  echo "Failed to create program: $ERROR"
  exit 1
fi

ACTOR_ID=$(jq -r ".actor_id" <<< "$ACTOR_ID_RESULT")
echo "ActorId of demo-ping: $ACTOR_ID"

echo "Topping up executable balance of demo-ping by 100 WVARA (10^14)..."
./target/release/ethexe tx --sender $SENDER2 executable-balance-top-up "$ACTOR_ID" "100 WVARA" --approve --watch 2>/dev/null

./target/release/ethexe tx --sender $SENDER2 send-message "$ACTOR_ID" 0x "10 ETH" --watch --json 2>/dev/null

# try to add/remove --watch to see if it affects balance fetching

./target/release/ethexe tx --sender $SENDER claim-value "$ACTOR_ID" "0x9910d223d2ab595fc7687123a8d14622c9a6fc124082eca26d2c3eff5c6cbff8" --watch --json

# ./target/release/ethexe tx --sender $SENDER send-reply "$ACTOR_ID" "0x9910d223d2ab595fc7687123a8d14622c9a6fc124082eca26d2c3eff5c6cbff8" 0x42424242 "0.1 ETH" --watch --json

echo $(cast balance $SENDER)

@StackOverflowExcept1on StackOverflowExcept1on added A0-pleasereview PR is ready to be reviewed by the team D5-tooling Helper tools and utilities D8-ethexe ethexe-related PR labels Jan 20, 2026
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Jan 20, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  ethexe/ethereum/src/mirror/mod.rs  2% smaller
  ethexe/cli/src/commands/tx.rs Unsupported file format

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @StackOverflowExcept1on, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the ethexe-cli's capabilities for interacting with Ethereum mirror programs by adding new commands for sending replies, claiming values, and managing locked funds. Concurrently, it refines the project's CI/CD infrastructure by updating build tools and optimizing caching mechanisms, ensuring a more robust and efficient development pipeline.

Highlights

  • New CLI Commands: Introduced three new transactional commands to the ethexe-cli: send-reply for sending replies to mirror programs, claim-value for claiming values from mirror programs, and transfer-locked-value-to-inheritor for transferring locked values.
  • GitHub Actions Updates: Updated the cargo-xwin version in the install-cargo-xwin action and refactored the rust-cache action to dynamically determine the cache provider (GitHub or S3) and streamline SCCACHE environment variable setup. Also added LLVM installation for Linux in setup-compilation-env.
  • Ethereum Mirror Interaction: Enhanced the ethexe-ethereum library with new methods for Mirror interactions, including wait_for_value_claimed, send_reply_with_receipt, claim_value_with_receipt, and transfer_locked_value_to_inheritor_with_receipt, providing more granular control and feedback for transactions.
  • Data Structure Refinements: Modified the SendMessagePayload struct by removing the watch field and introduced new result structs (SendReplyResult, ClaimValueResult, TransferLockedValueToInheritorResult) for better structured output in the CLI.
Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/build-unix.yml
    • .github/workflows/build-windows.yml
    • .github/workflows/build.yml
    • .github/workflows/check.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds new ethexe CLI commands: send-reply, claim-value, and transfer-locked-value-to-inheritor. The changes also include updates to CI workflows and dependencies.

The implementation of the new commands in ethexe/cli/src/commands/tx.rs is largely functional but has significant code duplication across the handlers for the new commands. I've suggested refactoring this into helper functions to improve maintainability.

Additionally, in ethexe/ethereum/src/mirror/mod.rs, there's a potential for misleading information in the ClaimInfo struct returned when watching for a claimed value, as the recipient's address is assumed rather than being sourced from the event data.

Overall, the new features are a good addition, and with the suggested refactoring, the code quality can be further improved.

Comment thread ethexe/cli/src/commands/tx.rs
Comment thread ethexe/ethereum/src/mirror/mod.rs
Base automatically changed from av/ethexe-cli-send-message-injected-tx to master January 20, 2026 19:44
@StackOverflowExcept1on StackOverflowExcept1on force-pushed the av/ethexe-cli-additional-commands branch from 583546a to 2e7aa6f Compare January 20, 2026 19:55
@StackOverflowExcept1on StackOverflowExcept1on merged commit d45a76c into master Jan 20, 2026
32 checks passed
@StackOverflowExcept1on StackOverflowExcept1on deleted the av/ethexe-cli-additional-commands branch January 20, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview PR is ready to be reviewed by the team D5-tooling Helper tools and utilities D8-ethexe ethexe-related PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants