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

[cli] Add Task Scheduling Command and Refactor Wallet Context API #2704

Merged
merged 3 commits into from
Sep 28, 2024

Conversation

jolestar
Copy link
Contributor

@jolestar jolestar commented Sep 27, 2024

Summary

This PR introduces several enhancements and new features:

  1. Scheduled Task Command: Implements the rooch task schedule command to run scheduled tasks. This includes checking for OnChainEvent and executing transactions to consume these events.
  2. Wallet Context Refactor: Refactors the wallet context, focusing on password handling and the sign API to simplify the logic and improve usability.

Copy link

github-actions bot commented Sep 27, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

vercel bot commented Sep 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal-v2.1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2024 3:24pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Sep 27, 2024 3:24pm

Comment on lines +162 to +168
//TODO FIXME we should use the state_root from previous tx
let state_root = tx_execution_result
.execution_info
.state_root
.0
.as_bytes()
.to_vec();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@steelgeek091 We use a wrong state_root to execute_tx locally.

Copy link
Collaborator

@steelgeek091 steelgeek091 Sep 27, 2024

Choose a reason for hiding this comment

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

We getting the last Tx order which has been processed by sequencer then use this Tx order to query previous Tx?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the tx has been executed and you use the state_root to execute it again, the ObjectID and Resource may conflict. Maybe the gas profile mode should only execute the tx off-chain.

@jolestar jolestar changed the title [cli] Implement rooch task schedule command [cli] Add Task Scheduling Command and Refactor Wallet Context API Sep 27, 2024

#[async_trait]
impl CommandAction<String> for ScheduleCommand {
async fn execute(self) -> RoochResult<String> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

目前实现的是单节点下的Schedule执行,多节点后再考虑去中心化的Schedule?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Schedule 的应用场景就是单机模式的定时任务。一般应用自己运行一个就行。去中心化的任务系统需要新的协议来搞。

@jolestar jolestar merged commit 3628788 into main Sep 28, 2024
10 checks passed
@jolestar jolestar deleted the cli_task branch September 28, 2024 06:19
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.

3 participants