-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add cmd to collect withdrawal events and submit as actions (…
…#1261) ## Summary Adds `bridge collect-withdrawals` and `bridge submit-withdrawals` subcommands to `astria-cli`. ## Background The worker service `astria-bridge-withdrawer` is a closed system that collects withdrawal event from the rollup and submits them to the sequencer in a closed loop. But it can be desirable to inspect the withdrawal events generated by the bridge contracts, and then submit them manually. This functionality is now provided by `astria-cli`. ## Changes - Add subcommands `bridge collect-withdrawal-s` to `astria-cli`, which has two different modes of operation, depending on whether `--to-rollup-height` is set: - if set, it fetches all blocks between `--from-rollup-height` and `--to-rollup-height` (inclusive), converts them to seuquencer actions, and then writes them to a file. - if not set, it fetches blocks from `--from-rollup-height` until SIGINT (Ctrl-C) is received. After the signal, the converted actions are written to a file. ## Testing - Added `run-smoke-cli` in `charts/deploy.just` (@joroshiba) - Added a `smoke-cli:` in `.github/workflows/docker-build.yaml` (@joroshiba) --------- Co-authored-by: Jordan Oroshiba <jordan@astria.org>
- Loading branch information
1 parent
bb41dc4
commit 1555c03
Showing
12 changed files
with
993 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use clap::Subcommand; | ||
use color_eyre::eyre; | ||
|
||
/// Interact with a Sequencer node | ||
// allow: these are one-shot variants. the size doesn't matter as they are | ||
// passed around only once. | ||
#[allow(clippy::large_enum_variant)] | ||
#[derive(Debug, Subcommand)] | ||
pub(crate) enum Command { | ||
/// Commands for interacting with Sequencer accounts | ||
CollectWithdrawals(crate::commands::bridge::collect::WithdrawalEvents), | ||
SubmitWithdrawals(crate::commands::bridge::submit::WithdrawalEvents), | ||
} | ||
|
||
impl Command { | ||
pub(crate) async fn run(self) -> eyre::Result<()> { | ||
match self { | ||
Command::CollectWithdrawals(args) => args.run().await, | ||
Command::SubmitWithdrawals(args) => args.run().await, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.